~ubuntu-branches/ubuntu/saucy/rdkit/saucy-proposed

« back to all changes in this revision

Viewing changes to Code/GraphMol/MolOps.h

  • Committer: Package Import Robot
  • Author(s): Michael Banck
  • Date: 2012-05-18 15:09:10 UTC
  • mfrom: (2.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20120518150910-0wavbii0kr13pifa
Tags: 201203-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
#ifndef _RD_MOL_OPS_H_
11
11
#define _RD_MOL_OPS_H_
12
12
 
13
 
#include <RDGeneral/types.h>
14
 
#include <boost/tuple/tuple.hpp>
 
13
#include <vector>
 
14
#include <list>
15
15
#include <boost/smart_ptr.hpp>
16
16
 
17
17
extern const int ci_LOCAL_INF;
190
190
    //! \name Sanitization
191
191
    //@{
192
192
 
 
193
    typedef enum {
 
194
      SANITIZE_NONE=0x0,
 
195
      SANITIZE_CLEANUP=0x1,
 
196
      SANITIZE_PROPERTIES=0x2,
 
197
      SANITIZE_SYMMRINGS=0x4,
 
198
      SANITIZE_KEKULIZE=0x8,
 
199
      SANITIZE_FINDRADICALS=0x10,
 
200
      SANITIZE_SETAROMATICITY=0x20,
 
201
      SANITIZE_SETCONJUGATION=0x40,
 
202
      SANITIZE_SETHYBRIDIZATION=0x80,
 
203
      SANITIZE_CLEANUPCHIRALITY=0x100,
 
204
      SANITIZE_ADJUSTHS=0x200,
 
205
      SANITIZE_ALL=0xFFFFFFFF
 
206
    } SanitizeFlags;
 
207
 
193
208
    //! \brief carries out a collection of tasks for cleaning up a molecule and ensuring
194
209
    //! that it makes "chemical sense"
195
210
    /*!
196
211
       This functions calls the following in sequence
197
212
         -# MolOps::cleanUp()
 
213
         -# mol.updatPropertyCache()
 
214
         -# MolOps::symmetrizeSSSR()
198
215
         -# MolOps::Kekulize()
 
216
         -# MolOps::assignRadicals()
199
217
         -# MolOps::setAromaticity()
200
218
         -# MolOps::setConjugation()
201
219
         -# MolOps::setHybridization()
202
220
         -# MolOps::cleanupChirality()
203
221
         -# MolOps::adjustHs()
204
222
         
205
 
       \param mol the RWMol to be cleaned
206
 
 
 
223
       \param mol : the RWMol to be cleaned
 
224
 
 
225
       \param operationThatFailed : the first (if any) sanitization operation that fails is set here.
 
226
                                    The values are taken from the \c SanitizeFlags enum.
 
227
                                    On success, the value is  \c SanitizeFlags::SANITIZE_NONE
 
228
 
 
229
       \param sanitizeOps : the bits here are used to set which sanitization operations are carried
 
230
                            out. The elements of the \c SanitizeFlags enum define the operations.
 
231
       
207
232
       <b>Notes:</b>
208
233
        - If there is a failure in the sanitization, a \c SanitException
209
234
          will be thrown.
211
236
          function to a ROMol, so that new atoms and bonds cannot be added to the 
212
237
          molecule and screw up the sanitizing that has been done here
213
238
    */
 
239
    void sanitizeMol(RWMol &mol,unsigned int &operationThatFailed,
 
240
                     unsigned int sanitizeOps=SANITIZE_ALL);
 
241
    //! \overload
214
242
    void sanitizeMol(RWMol &mol);
215
243
 
216
244
    //! Sets up the aromaticity for a molecule
351
379
    //! \overload
352
380
    int findSSSR(const ROMol &mol, std::vector<std::vector<int> > *res=0);
353
381
 
 
382
    //! use a DFS algorithm to identify ring bonds and atoms in a molecule
 
383
    /*!
 
384
      \b NOTE: though the RingInfo structure is populated by this function,
 
385
      the only really reliable calls that can be made are to check if
 
386
      mol.getRingInfo().numAtomRings(idx) or mol.getRingInfo().numBondRings(idx)
 
387
      return values >0
 
388
    */  
 
389
    void fastFindRings(const ROMol &mol);
 
390
 
 
391
 
354
392
    //! symmetrize the molecule's Smallest Set of Smallest Rings
355
393
    /*!
356
394
       SSSR rings obatined from "findSSSR" can be non-unique in some case.