RDKit
Open-source cheminformatics and machine learning.
MolOps.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2001-2019 Greg Landrum and Rational Discovery LLC
3 // Copyright (c) 2014, Novartis Institutes for BioMedical Research Inc.
4 //
5 // @@ All Rights Reserved @@
6 // This file is part of the RDKit.
7 // The contents are covered by the terms of the BSD license
8 // which is included in the file license.txt, found at the root
9 // of the RDKit source tree.
10 //
11 #include <RDGeneral/export.h>
12 #ifndef _RD_MOL_OPS_H_
13 #define _RD_MOL_OPS_H_
14 
15 #include <vector>
16 #include <map>
17 #include <list>
19 #include <boost/smart_ptr.hpp>
20 #include <boost/dynamic_bitset.hpp>
22 #include <RDGeneral/types.h>
23 #include "SanitException.h"
24 
25 RDKIT_GRAPHMOL_EXPORT extern const int ci_LOCAL_INF;
26 namespace RDKit {
27 class ROMol;
28 class RWMol;
29 class Atom;
30 class Bond;
31 class Conformer;
32 typedef std::vector<double> INVAR_VECT;
33 typedef INVAR_VECT::iterator INVAR_VECT_I;
34 typedef INVAR_VECT::const_iterator INVAR_VECT_CI;
35 
36 //! \brief Groups a variety of molecular query and transformation operations.
37 namespace MolOps {
38 
39 //! return the number of electrons available on an atom to donate for
40 // aromaticity
41 /*!
42  The result is determined using the default valency, number of lone pairs,
43  number of bonds and the formal charge. Note that the atom may not donate
44  all of these electrons to a ring for aromaticity (also used in Conjugation
45  and hybridization code).
46 
47  \param at the atom of interest
48 
49  \return the number of electrons
50 */
52 
53 //! sums up all atomic formal charges and returns the result
55 
56 //! returns whether or not the given Atom is involved in a conjugated bond
58 
59 //! find fragments (disconnected components of the molecular graph)
60 /*!
61 
62  \param mol the molecule of interest
63  \param mapping used to return the mapping of Atoms->fragments.
64  On return \c mapping will be <tt>mol->getNumAtoms()</tt> long
65  and will contain the fragment assignment for each Atom
66 
67  \return the number of fragments found.
68 
69 */
70 RDKIT_GRAPHMOL_EXPORT unsigned int getMolFrags(const ROMol &mol,
71  std::vector<int> &mapping);
72 //! find fragments (disconnected components of the molecular graph)
73 /*!
74 
75  \param mol the molecule of interest
76  \param frags used to return the Atoms in each fragment
77  On return \c mapping will be \c numFrags long, and each entry
78  will contain the indices of the Atoms in that fragment.
79 
80  \return the number of fragments found.
81 
82 */
84  const ROMol &mol, std::vector<std::vector<int>> &frags);
85 
86 //! splits a molecule into its component fragments
87 // (disconnected components of the molecular graph)
88 /*!
89 
90  \param mol the molecule of interest
91  \param sanitizeFrags toggles sanitization of the fragments after
92  they are built
93  \param frags used to return the mapping of Atoms->fragments.
94  if provided, \c frags will be <tt>mol->getNumAtoms()</tt> long
95  on return and will contain the fragment assignment for each Atom
96  \param fragsMolAtomMapping used to return the Atoms in each fragment
97  On return \c mapping will be \c numFrags long, and each entry
98  will contain the indices of the Atoms in that fragment.
99  \param copyConformers toggles copying conformers of the fragments after
100  they are built
101  \return a vector of the fragments as smart pointers to ROMols
102 
103 */
104 RDKIT_GRAPHMOL_EXPORT std::vector<boost::shared_ptr<ROMol>> getMolFrags(
105  const ROMol &mol, bool sanitizeFrags = true, std::vector<int> *frags = 0,
106  std::vector<std::vector<int>> *fragsMolAtomMapping = 0,
107  bool copyConformers = true);
108 
109 //! splits a molecule into pieces based on labels assigned using a query
110 /*!
111 
112  \param mol the molecule of interest
113  \param query the query used to "label" the molecule for fragmentation
114  \param sanitizeFrags toggles sanitization of the fragments after
115  they are built
116  \param whiteList if provided, only labels in the list will be kept
117  \param negateList if true, the white list logic will be inverted: only labels
118  not in the list will be kept
119 
120  \return a map of the fragments and their labels
121 
122 */
123 template <typename T>
124 RDKIT_GRAPHMOL_EXPORT std::map<T, boost::shared_ptr<ROMol>>
125 getMolFragsWithQuery(const ROMol &mol, T (*query)(const ROMol &, const Atom *),
126  bool sanitizeFrags = true,
127  const std::vector<T> *whiteList = 0,
128  bool negateList = false);
129 
130 #if 0
131  //! finds a molecule's minimium spanning tree (MST)
132  /*!
133  \param mol the molecule of interest
134  \param mst used to return the MST as a vector of bond indices
135  */
136  RDKIT_GRAPHMOL_EXPORT void findSpanningTree(const ROMol &mol,std::vector<int> &mst);
137 #endif
138 
139 //! calculates Balaban's J index for the molecule
140 /*!
141  \param mol the molecule of interest
142  \param useBO toggles inclusion of the bond order in the calculation
143  (when false, we're not really calculating the J value)
144  \param force forces the calculation (instead of using cached results)
145  \param bondPath when included, only paths using bonds whose indices occur
146  in this vector will be included in the calculation
147  \param cacheIt If this is true, the calculated value will be cached
148  as a property on the molecule
149  \return the J index
150 
151 */
153  const ROMol &mol, bool useBO = true, bool force = false,
154  const std::vector<int> *bondPath = 0, bool cacheIt = true);
155 //! \overload
156 RDKIT_GRAPHMOL_EXPORT double computeBalabanJ(double *distMat, int nb, int nAts);
157 
158 //! \name Dealing with hydrogens
159 //{@
160 
161 //! returns a copy of a molecule with hydrogens added in as explicit Atoms
162 /*!
163  \param mol the molecule to add Hs to
164  \param explicitOnly (optional) if this \c true, only explicit Hs will be
165  added
166  \param addCoords (optional) If this is true, estimates for the atomic
167  coordinates
168  of the added Hs will be used.
169  \param onlyOnAtoms (optional) if provided, this should be a vector of
170  IDs of the atoms that will be considered for H addition.
171  \param addResidueInfo (optional) if this is true, add residue info to
172  hydrogen atoms (useful for PDB files).
173 
174  \return the new molecule
175 
176  <b>Notes:</b>
177  - it makes no sense to use the \c addCoords option if the molecule's
178  heavy
179  atoms don't already have coordinates.
180  - the caller is responsible for <tt>delete</tt>ing the pointer this
181  returns.
182  */
183 RDKIT_GRAPHMOL_EXPORT ROMol *addHs(const ROMol &mol, bool explicitOnly = false,
184  bool addCoords = false,
185  const UINT_VECT *onlyOnAtoms = NULL,
186  bool addResidueInfo = false);
187 //! \overload
188 // modifies the molecule in place
189 RDKIT_GRAPHMOL_EXPORT void addHs(RWMol &mol, bool explicitOnly = false,
190  bool addCoords = false,
191  const UINT_VECT *onlyOnAtoms = NULL,
192  bool addResidueInfo = false);
193 
194 //! returns a copy of a molecule with hydrogens removed
195 /*!
196  \param mol the molecule to remove Hs from
197  \param implicitOnly (optional) if this \c true, only implicit Hs will be
198  removed
199  \param updateExplicitCount (optional) If this is \c true, when explicit Hs
200  are removed
201  from the graph, the heavy atom to which they are bound will have its
202  counter of
203  explicit Hs increased.
204  \param sanitize: (optional) If this is \c true, the final molecule will be
205  sanitized
206 
207  \return the new molecule
208 
209  <b>Notes:</b>
210  - Hydrogens which aren't connected to a heavy atom will not be
211  removed. This prevents molecules like <tt>"[H][H]"</tt> from having
212  all atoms removed.
213  - Labelled hydrogen (e.g. atoms with atomic number=1, but mass > 1),
214  will not be removed.
215  - two coordinate Hs, like the central H in C[H-]C, will not be removed
216  - Hs connected to dummy atoms will not be removed
217  - Hs that are part of the definition of double bond Stereochemistry
218  will not be removed
219  - Hs that are not connected to anything else will not be removed
220  - Hs that have a query defined (i.e. hasQuery() returns true) will not
221  be removed
222 
223  - the caller is responsible for <tt>delete</tt>ing the pointer this
224  returns.
225 */
227  bool implicitOnly = false,
228  bool updateExplicitCount = false,
229  bool sanitize = true);
230 //! \overload
231 // modifies the molecule in place
232 RDKIT_GRAPHMOL_EXPORT void removeHs(RWMol &mol, bool implicitOnly = false,
233  bool updateExplicitCount = false,
234  bool sanitize = true);
235 
236 //! returns a copy of a molecule with hydrogens removed and added as queries
237 //! to the heavy atoms to which they are bound.
238 /*!
239  This is really intended to be used with molecules that contain QueryAtoms
240 
241  \param mol the molecule to remove Hs from
242 
243  \return the new molecule
244 
245  <b>Notes:</b>
246  - Atoms that do not already have hydrogen count queries will have one
247  added, other H-related queries will not be touched. Examples:
248  - C[H] -> [C;!H0]
249  - [C;H1][H] -> [C;H1]
250  - [C;H2][H] -> [C;H2]
251  - Hydrogens which aren't connected to a heavy atom will not be
252  removed. This prevents molecules like <tt>"[H][H]"</tt> from having
253  all atoms removed.
254  - the caller is responsible for <tt>delete</tt>ing the pointer this returns.
255  - By default all hydrogens are removed, however if
256  mergeUnmappedOnly is true, any hydrogen participating
257  in an atom map will be retained
258 
259 */
261  bool mergeUnmappedOnly = false);
262 //! \overload
263 // modifies the molecule in place
265  bool mergeUnmappedOnly = false);
266 
267 typedef enum {
274  ADJUST_IGNOREALL = 0xFFFFFFF
276 
278  bool adjustDegree; /**< add degree queries */
279  std::uint32_t adjustDegreeFlags;
280  bool adjustRingCount; /**< add ring-count queries */
281  std::uint32_t adjustRingCountFlags;
282 
283  bool makeDummiesQueries; /**< convert dummy atoms without isotope labels to
284  any-atom queries */
286  bool makeBondsGeneric; /**< convert bonds to generic queries (any bonds) */
287  std::uint32_t makeBondsGenericFlags;
288  bool makeAtomsGeneric; /**< convert atoms to generic queries (any atoms) */
289  std::uint32_t makeAtomsGenericFlags;
290  bool adjustHeavyDegree; /**< adjust the heavy-atom degree instead of overall
291  degree */
292  std::uint32_t adjustHeavyDegreeFlags;
293  bool adjustRingChain; /**< add ring-chain queries */
294  std::uint32_t adjustRingChainFlags;
295 
297  : adjustDegree(true),
298  adjustDegreeFlags(ADJUST_IGNOREDUMMIES | ADJUST_IGNORECHAINS),
299  adjustRingCount(false),
300  adjustRingCountFlags(ADJUST_IGNOREDUMMIES | ADJUST_IGNORECHAINS),
301  makeDummiesQueries(true),
302  aromatizeIfPossible(true),
303  makeBondsGeneric(false),
304  makeBondsGenericFlags(ADJUST_IGNORENONE),
305  makeAtomsGeneric(false),
306  makeAtomsGenericFlags(ADJUST_IGNORENONE),
307  adjustHeavyDegree(false),
308  adjustHeavyDegreeFlags(ADJUST_IGNOREDUMMIES | ADJUST_IGNORECHAINS),
309  adjustRingChain(false),
310  adjustRingChainFlags(ADJUST_IGNORENONE) {}
311 };
312 //! returns a copy of a molecule with query properties adjusted
313 /*!
314  \param mol the molecule to adjust
315  \param params controls the adjustments made
316 
317  \return the new molecule
318 */
320  const ROMol &mol, const AdjustQueryParameters *params = NULL);
321 //! \overload
322 // modifies the molecule in place
324  RWMol &mol, const AdjustQueryParameters *params = NULL);
325 
326 //! returns a copy of a molecule with the atoms renumbered
327 /*!
328 
329  \param mol the molecule to work with
330  \param newOrder the new ordering of the atoms (should be numAtoms long)
331  for example: if newOrder is [3,2,0,1], then atom 3 in the original
332  molecule will be atom 0 in the new one
333 
334  \return the new molecule
335 
336  <b>Notes:</b>
337  - the caller is responsible for <tt>delete</tt>ing the pointer this returns.
338 
339 */
341  const ROMol &mol, const std::vector<unsigned int> &newOrder);
342 
343 //@}
344 
345 //! \name Sanitization
346 //@{
347 
348 typedef enum {
360  SANITIZE_ALL = 0xFFFFFFF
361 } SanitizeFlags;
362 
363 //! \brief carries out a collection of tasks for cleaning up a molecule and
364 // ensuring
365 //! that it makes "chemical sense"
366 /*!
367  This functions calls the following in sequence
368  -# MolOps::cleanUp()
369  -# mol.updatePropertyCache()
370  -# MolOps::symmetrizeSSSR()
371  -# MolOps::Kekulize()
372  -# MolOps::assignRadicals()
373  -# MolOps::setAromaticity()
374  -# MolOps::setConjugation()
375  -# MolOps::setHybridization()
376  -# MolOps::cleanupChirality()
377  -# MolOps::adjustHs()
378 
379  \param mol : the RWMol to be cleaned
380 
381  \param operationThatFailed : the first (if any) sanitization operation that
382  fails is set here.
383  The values are taken from the \c SanitizeFlags
384  enum. On success, the value is \c
385  SanitizeFlags::SANITIZE_NONE
386 
387  \param sanitizeOps : the bits here are used to set which sanitization
388  operations are carried out. The elements of the \c
389  SanitizeFlags enum define the operations.
390 
391  <b>Notes:</b>
392  - If there is a failure in the sanitization, a \c MolSanitizeException
393  will be thrown.
394  - in general the user of this function should cast the molecule following
395  this function to a ROMol, so that new atoms and bonds cannot be added to
396  the molecule and screw up the sanitizing that has been done here
397 */
399  unsigned int &operationThatFailed,
400  unsigned int sanitizeOps = SANITIZE_ALL);
401 //! \overload
403 
404 //! \brief Identifies chemistry problems (things that don't make chemical sense)
405 //! in a molecule
406 /*!
407  This functions uses the operations in sanitizeMol but does not change
408  the input structure and returns a list of the problems encountered instead of
409  stopping at the first failure,
410 
411  The problems this looks for come from the sanitization operations:
412  -# mol.updatePropertyCache() : Unreasonable valences
413  -# MolOps::Kekulize() : Unkekulizable ring systems, aromatic atoms not in
414  rings, aromatic bonds to non-aromatic atoms.
415 
416  \param mol : the RWMol to be cleaned
417 
418  \param sanitizeOps : the bits here are used to set which sanitization
419  operations are carried out. The elements of the \c
420  SanitizeFlags enum define the operations.
421 
422  \return a vector of \c MolSanitizeException values that indicate what
423  problems were encountered
424 
425 */
427 std::vector<std::unique_ptr<MolSanitizeException>> detectChemistryProblems(
428  const ROMol &mol, unsigned int sanitizeOps = SANITIZE_ALL);
429 
430 //! Possible aromaticity models
431 /*!
432 - \c AROMATICITY_DEFAULT at the moment always uses \c AROMATICITY_RDKIT
433 - \c AROMATICITY_RDKIT is the standard RDKit model (as documented in the RDKit
434 Book)
435 - \c AROMATICITY_SIMPLE only considers 5- and 6-membered simple rings (it
436 does not consider the outer envelope of fused rings)
437 - \c AROMATICITY_MDL
438 - \c AROMATICITY_CUSTOM uses a caller-provided function
439 */
440 typedef enum {
441  AROMATICITY_DEFAULT = 0x0, ///< future proofing
445  AROMATICITY_CUSTOM = 0xFFFFFFF ///< use a function
447 
448 //! Sets up the aromaticity for a molecule
449 /*!
450 
451  This is what happens here:
452  -# find all the simple rings by calling the findSSSR function
453  -# loop over all the Atoms in each ring and mark them if they are
454  candidates
455  for aromaticity. A ring atom is a candidate if it can spare electrons
456  to the ring and if it's from the first two rows of the periodic table.
457  -# based on the candidate atoms, mark the rings to be either candidates
458  or non-candidates. A ring is a candidate only if all its atoms are
459  candidates
460  -# apply Hueckel rule to each of the candidate rings to check if the ring
461  can be
462  aromatic
463 
464  \param mol the RWMol of interest
465  \param model the aromaticity model to use
466  \param func a custom function for assigning aromaticity (only used when
467  model=\c AROMATICITY_CUSTOM)
468 
469  \return >0 on success, <= 0 otherwise
470 
471  <b>Assumptions:</b>
472  - Kekulization has been done (i.e. \c MolOps::Kekulize() has already
473  been called)
474 
475 */
478  int (*func)(RWMol &) = NULL);
479 
480 //! Designed to be called by the sanitizer to handle special cases before
481 // anything is done.
482 /*!
483 
484  Currently this:
485  - modifies nitro groups, so that the nitrogen does not have an unreasonable
486  valence of 5, as follows:
487  - the nitrogen gets a positive charge
488  - one of the oxygens gets a negative chage and the double bond to this
489  oxygen is changed to a single bond
490  The net result is that nitro groups can be counted on to be:
491  \c "[N+](=O)[O-]"
492  - modifies halogen-oxygen containing species as follows:
493  \c [Cl,Br,I](=O)(=O)(=O)O -> [X+3]([O-])([O-])([O-])O
494  \c [Cl,Br,I](=O)(=O)O -> [X+3]([O-])([O-])O
495  \c [Cl,Br,I](=O)O -> [X+]([O-])O
496  - converts the substructure [N,C]=P(=O)-* to [N,C]=[P+](-[O-])-*
497 
498  \param mol the molecule of interest
499 
500 */
502 
503 //! Called by the sanitizer to assign radical counts to atoms
505 
506 //! adjust the number of implicit and explicit Hs for special cases
507 /*!
508 
509  Currently this:
510  - modifies aromatic nitrogens so that, when appropriate, they have an
511  explicit H marked (e.g. so that we get things like \c "c1cc[nH]cc1"
512 
513  \param mol the molecule of interest
514 
515  <b>Assumptions</b>
516  - this is called after the molecule has been sanitized,
517  aromaticity has been perceived, and the implicit valence of
518  everything has been calculated.
519 
520 */
522 
523 //! Kekulizes the molecule
524 /*!
525 
526  \param mol the molecule of interest
527  \param markAtomsBonds if this is set to true, \c isAromatic boolean settings
528  on both the Bonds and Atoms are turned to false
529  following
530  the Kekulization, otherwise they are left alone in
531  their
532  original state.
533  \param maxBackTracks the maximum number of attempts at back-tracking. The
534  algorithm
535  uses a back-tracking procedure to revist a previous
536  setting of
537  double bond if we hit a wall in the kekulization
538  process
539 
540  <b>Notes:</b>
541  - even if \c markAtomsBonds is \c false the \c BondType for all aromatic
542  bonds will be changed from \c RDKit::Bond::AROMATIC to \c
543  RDKit::Bond::SINGLE
544  or RDKit::Bond::DOUBLE during Kekulization.
545 
546 */
547 RDKIT_GRAPHMOL_EXPORT void Kekulize(RWMol &mol, bool markAtomsBonds = true,
548  unsigned int maxBackTracks = 100);
549 
550 //! flags the molecule's conjugated bonds
552 
553 //! calculates and sets the hybridization of all a molecule's Stoms
555 
556 // @}
557 
558 //! \name Ring finding and SSSR
559 //@{
560 
561 //! finds a molecule's Smallest Set of Smallest Rings
562 /*!
563  Currently this implements a modified form of Figueras algorithm
564  (JCICS - Vol. 36, No. 5, 1996, 986-991)
565 
566  \param mol the molecule of interest
567  \param res used to return the vector of rings. Each entry is a vector with
568  atom indices. This information is also stored in the molecule's
569  RingInfo structure, so this argument is optional (see overload)
570 
571  \return number of smallest rings found
572 
573  Base algorithm:
574  - The original algorithm starts by finding representative degree 2
575  nodes.
576  - Representative because if a series of deg 2 nodes are found only
577  one of them is picked.
578  - The smallest ring around each of them is found.
579  - The bonds that connect to this degree 2 node are them chopped off,
580  yielding
581  new deg two nodes
582  - The process is repeated on the new deg 2 nodes.
583  - If no deg 2 nodes are found, a deg 3 node is picked. The smallest ring
584  with it is found. A bond from this is "carefully" (look in the paper)
585  selected and chopped, yielding deg 2 nodes. The process is same as
586  above once this is done.
587 
588  Our Modifications:
589  - If available, more than one smallest ring around a representative deg 2
590  node will be computed and stored
591  - Typically 3 rings are found around a degree 3 node (when no deg 2s are
592  available)
593  and all the bond to that node are chopped.
594  - The extra rings that were found in this process are removed after all the
595  nodes
596  have been covered.
597 
598  These changes were motivated by several factors:
599  - We believe the original algorithm fails to find the correct SSSR
600  (finds the correct number of them but the wrong ones) on some sample mols
601  - Since SSSR may not be unique, a post-SSSR step to symmetrize may be done.
602  The extra rings this process adds can be quite useful.
603 */
604 RDKIT_GRAPHMOL_EXPORT int findSSSR(const ROMol &mol,
605  std::vector<std::vector<int>> &res);
606 //! \overload
607 RDKIT_GRAPHMOL_EXPORT int findSSSR(const ROMol &mol,
608  std::vector<std::vector<int>> *res = 0);
609 
610 //! use a DFS algorithm to identify ring bonds and atoms in a molecule
611 /*!
612  \b NOTE: though the RingInfo structure is populated by this function,
613  the only really reliable calls that can be made are to check if
614  mol.getRingInfo().numAtomRings(idx) or mol.getRingInfo().numBondRings(idx)
615  return values >0
616 */
617 RDKIT_GRAPHMOL_EXPORT void fastFindRings(const ROMol &mol);
618 
620 
621 //! symmetrize the molecule's Smallest Set of Smallest Rings
622 /*!
623  SSSR rings obatined from "findSSSR" can be non-unique in some case.
624  For example, cubane has five SSSR rings, not six as one would hope.
625 
626  This function adds additional rings to the SSSR list if necessary
627  to make the list symmetric, e.g. all atoms in cubane will be part of the same
628  number
629  of SSSRs. This function choses these extra rings from the extra rings
630  computed
631  and discarded during findSSSR. The new ring are chosen such that:
632  - replacing a same sized ring in the SSSR list with an extra ring yields
633  the same union of bond IDs as the orignal SSSR list
634 
635  \param mol - the molecule of interest
636  \param res used to return the vector of rings. Each entry is a vector with
637  atom indices. This information is also stored in the molecule's
638  RingInfo structure, so this argument is optional (see overload)
639 
640  \return the total number of rings = (new rings + old SSSRs)
641 
642  <b>Notes:</b>
643  - if no SSSR rings are found on the molecule - MolOps::findSSSR() is called
644  first
645 */
647  std::vector<std::vector<int>> &res);
648 //! \overload
650 
651 //@}
652 
653 //! \name Shortest paths and other matrices
654 //@{
655 
656 //! returns a molecule's adjacency matrix
657 /*!
658  \param mol the molecule of interest
659  \param useBO toggles use of bond orders in the matrix
660  \param emptyVal sets the empty value (for non-adjacent atoms)
661  \param force forces calculation of the matrix, even if already
662  computed
663  \param propNamePrefix used to set the cached property name
664 
665  \return the adjacency matrix.
666 
667  <b>Notes</b>
668  - The result of this is cached in the molecule's local property dictionary,
669  which will handle deallocation. The caller should <b>not</b> \c delete
670  this pointer.
671 
672 */
674  const ROMol &mol, bool useBO = false, int emptyVal = 0, bool force = false,
675  const char *propNamePrefix = 0,
676  const boost::dynamic_bitset<> *bondsToUse = 0);
677 
678 //! Computes the molecule's topological distance matrix
679 /*!
680  Uses the Floyd-Warshall all-pairs-shortest-paths algorithm.
681 
682  \param mol the molecule of interest
683  \param useBO toggles use of bond orders in the matrix
684  \param useAtomWts sets the diagonal elements of the result to
685  6.0/(atomic number) so that the matrix can be used to calculate
686  Balaban J values. This does not affect the bond weights.
687  \param force forces calculation of the matrix, even if already
688  computed
689  \param propNamePrefix used to set the cached property name
690 
691  \return the distance matrix.
692 
693  <b>Notes</b>
694  - The result of this is cached in the molecule's local property dictionary,
695  which will handle deallocation. The caller should <b>not</b> \c delete
696  this pointer.
697 
698 
699 */
700 RDKIT_GRAPHMOL_EXPORT double *getDistanceMat(const ROMol &mol,
701  bool useBO = false,
702  bool useAtomWts = false,
703  bool force = false,
704  const char *propNamePrefix = 0);
705 
706 //! Computes the molecule's topological distance matrix
707 /*!
708  Uses the Floyd-Warshall all-pairs-shortest-paths algorithm.
709 
710  \param mol the molecule of interest
711  \param activeAtoms only elements corresponding to these atom indices
712  will be included in the calculation
713  \param bonds only bonds found in this list will be included in the
714  calculation
715  \param useBO toggles use of bond orders in the matrix
716  \param useAtomWts sets the diagonal elements of the result to
717  6.0/(atomic number) so that the matrix can be used to calculate
718  Balaban J values. This does not affect the bond weights.
719 
720  \return the distance matrix.
721 
722  <b>Notes</b>
723  - The results of this call are not cached, the caller <b>should</b> \c
724  delete
725  this pointer.
726 
727 
728 */
730  const ROMol &mol, const std::vector<int> &activeAtoms,
731  const std::vector<const Bond *> &bonds, bool useBO = false,
732  bool useAtomWts = false);
733 
734 //! Computes the molecule's 3D distance matrix
735 /*!
736 
737  \param mol the molecule of interest
738  \param confId the conformer to use
739  \param useAtomWts sets the diagonal elements of the result to
740  6.0/(atomic number)
741  \param force forces calculation of the matrix, even if already
742  computed
743  \param propNamePrefix used to set the cached property name
744  (if set to an empty string, the matrix will not be
745  cached)
746 
747  \return the distance matrix.
748 
749  <b>Notes</b>
750  - If propNamePrefix is not empty the result of this is cached in the
751  molecule's local property dictionary, which will handle deallocation.
752  In other cases the caller is responsible for freeing the memory.
753 
754 */
755 RDKIT_GRAPHMOL_EXPORT double *get3DDistanceMat(const ROMol &mol,
756  int confId = -1,
757  bool useAtomWts = false,
758  bool force = false,
759  const char *propNamePrefix = 0);
760 //! Find the shortest path between two atoms
761 /*!
762  Uses the Bellman-Ford algorithm
763 
764  \param mol molecule of interest
765  \param aid1 index of the first atom
766  \param aid2 index of the second atom
767 
768  \return an std::list with the indices of the atoms along the shortest
769  path
770 
771  <b>Notes:</b>
772  - the starting and end atoms are included in the path
773  - if no path is found, an empty path is returned
774 
775 */
776 RDKIT_GRAPHMOL_EXPORT std::list<int> getShortestPath(const ROMol &mol, int aid1,
777  int aid2);
778 
779 //@}
780 
781 #if 0
782  //! \name Canonicalization
783  //@{
784 
785  //! assign a canonical ordering to a molecule's atoms
786  /*!
787  The algorithm used here is a modification of the published Daylight canonical
788  smiles algorithm (i.e. it uses atom invariants and products of primes).
789 
790  \param mol the molecule of interest
791  \param ranks used to return the ranks
792  \param breakTies toggles breaking of ties (see below)
793  \param includeChirality toggles inclusion of chirality in the invariants
794  \param includeIsotopes toggles inclusion of isotopes in the invariants
795  \param rankHistory used to return the rank history (see below)
796 
797  <b>Notes:</b>
798  - Tie breaking should be done when it's important to have a full ordering
799  of the atoms (e.g. when generating canonical traversal trees). If it's
800  acceptable to have ties between symmetry-equivalent atoms (e.g. when
801  generating CIP codes), tie breaking can/should be skipped.
802  - if the \c rankHistory argument is provided, the evolution of the ranks of
803  individual atoms will be tracked. The \c rankHistory pointer should be
804  to a VECT_INT_VECT that has at least \c mol.getNumAtoms() elements.
805  */
806  RDKIT_GRAPHMOL_EXPORT void rankAtoms(const ROMol &mol,std::vector<int> &ranks,
807  bool breakTies=true,
808  bool includeChirality=true,
809  bool includeIsotopes=true,
810  std::vector<std::vector<int> > *rankHistory=0);
811  //! assign a canonical ordering to a sub-molecule's atoms
812  /*!
813  The algorithm used here is a modification of the published Daylight canonical
814  smiles algorithm (i.e. it uses atom invariants and products of primes).
815 
816  \param mol the molecule of interest
817  \param atomsToUse atoms to be included
818  \param bondsToUse bonds to be included
819  \param atomSymbols symbols to use for the atoms in the output (these are
820  used in place of atomic number and isotope information)
821  \param ranks used to return the ranks
822  \param breakTies toggles breaking of ties (see below)
823  \param rankHistory used to return the rank history (see below)
824 
825  <b>Notes:</b>
826  - Tie breaking should be done when it's important to have a full ordering
827  of the atoms (e.g. when generating canonical traversal trees). If it's
828  acceptable to have ties between symmetry-equivalent atoms (e.g. when
829  generating CIP codes), tie breaking can/should be skipped.
830  - if the \c rankHistory argument is provided, the evolution of the ranks of
831  individual atoms will be tracked. The \c rankHistory pointer should be
832  to a VECT_INT_VECT that has at least \c mol.getNumAtoms() elements.
833  */
834  RDKIT_GRAPHMOL_EXPORT void rankAtomsInFragment(const ROMol &mol,std::vector<int> &ranks,
835  const boost::dynamic_bitset<> &atomsToUse,
836  const boost::dynamic_bitset<> &bondsToUse,
837  const std::vector<std::string> *atomSymbols=0,
838  const std::vector<std::string> *bondSymbols=0,
839  bool breakTies=true,
840  std::vector<std::vector<int> > *rankHistory=0);
841 
842  // @}
843 #endif
844 //! \name Stereochemistry
845 //@{
846 
847 //! removes bogus chirality markers (those on non-sp3 centers):
849 
850 //! \brief Uses a conformer to assign ChiralType to a molecule's atoms
851 /*!
852  \param mol the molecule of interest
853  \param confId the conformer to use
854  \param replaceExistingTags if this flag is true, any existing atomic chiral
855  tags will be replaced
856 
857  If the conformer provided is not a 3D conformer, nothing will be done.
858 */
860  ROMol &mol, int confId = -1, bool replaceExistingTags = true);
861 
862 //! \brief Uses a conformer to assign ChiralTypes to a molecule's atoms and
863 //! stereo flags to its bonds
864 /*!
865 
866  \param mol the molecule of interest
867  \param confId the conformer to use
868  \param replaceExistingTags if this flag is true, any existing info about
869  stereochemistry will be replaced
870 
871  If the conformer provided is not a 3D conformer, nothing will be done.
872 */
874  ROMol &mol, int confId = -1, bool replaceExistingTags = true);
875 
876 //! \brief Use bond directions to assign ChiralTypes to a molecule's atoms and
877 //! stereo flags to its bonds
878 /*!
879 
880  \param mol the molecule of interest
881  \param confId the conformer to use
882  \param replaceExistingTags if this flag is true, any existing info about
883  stereochemistry will be replaced
884 */
886  ROMol &mol, int confId = -1, bool replaceExistingTags = true);
887 
888 //! \deprecated: this function will be removed in a future release. Use
889 //! setDoubleBondNeighborDirections() instead
891  int confId = -1);
892 //! Sets bond directions based on double bond stereochemistry
894  ROMol &mol, const Conformer *conf = nullptr);
895 
896 //! Assign CIS/TRANS bond stereochemistry tags based on neighboring directions
898 
899 //! Assign stereochemistry tags to atoms (i.e. R/S) and bonds (i.e. Z/E)
900 /*!
901  Does the CIP stereochemistry assignment for the molecule's atoms
902  (R/S) and double bond (Z/E). Chiral atoms will have a property
903  '_CIPCode' indicating their chiral code.
904 
905  \param mol the molecule to use
906  \param cleanIt if true, atoms with a chiral specifier that aren't
907  actually chiral (e.g. atoms with duplicate
908  substituents or only 2 substituents, etc.) will have
909  their chiral code set to CHI_UNSPECIFIED. Bonds with
910  STEREOCIS/STEREOTRANS specified that have duplicate
911  substituents based upon the CIP atom ranks will be
912  marked STEREONONE.
913  \param force causes the calculation to be repeated even if it has
914  already been done
915  \param flagPossibleStereoCenters set the _ChiralityPossible property on
916  atoms that are possible stereocenters
917 
918  <b>Notes:M</b>
919  - Throughout we assume that we're working with a hydrogen-suppressed
920  graph.
921 
922 */
924  ROMol &mol, bool cleanIt = false, bool force = false,
925  bool flagPossibleStereoCenters = false);
926 //! Removes all stereochemistry information from atoms (i.e. R/S) and bonds
927 //(i.e. Z/E)
928 /*!
929 
930  \param mol the molecule of interest
931 */
933 
934 //! \brief finds bonds that could be cis/trans in a molecule and mark them as
935 //! Bond::STEREOANY.
936 /*!
937  \param mol the molecule of interest
938  \param cleanIt toggles removal of stereo flags from double bonds that can
939  not have stereochemistry
940 
941  This function finds any double bonds that can potentially be part of
942  a cis/trans system. No attempt is made here to mark them cis or
943  trans. No attempt is made to detect double bond stereo in ring systems.
944 
945  This function is useful in the following situations:
946  - when parsing a mol file; for the bonds marked here, coordinate
947  information on the neighbors can be used to indentify cis or trans states
948  - when writing a mol file; bonds that can be cis/trans but not marked as
949  either need to be specially marked in the mol file
950  - finding double bonds with unspecified stereochemistry so they
951  can be enumerated for downstream 3D tools
952 
953  The CIPranks on the neighboring atoms are checked in this function. The
954  _CIPCode property if set to any on the double bond.
955 */
957  bool cleanIt = false);
958 //@}
959 
960 //! returns the number of atoms which have a particular property set
962  const ROMol &mol, std::string prop);
963 
964 }; // end of namespace MolOps
965 }; // end of namespace RDKit
966 
967 #endif
RDKit::MolOps::getMolFrags
RDKIT_GRAPHMOL_EXPORT unsigned int getMolFrags(const ROMol &mol, std::vector< int > &mapping)
find fragments (disconnected components of the molecular graph)
RDKit::MolOps::Kekulize
RDKIT_GRAPHMOL_EXPORT void Kekulize(RWMol &mol, bool markAtomsBonds=true, unsigned int maxBackTracks=100)
Kekulizes the molecule.
RDKit::MolOps::getAdjacencyMatrix
RDKIT_GRAPHMOL_EXPORT double * getAdjacencyMatrix(const ROMol &mol, bool useBO=false, int emptyVal=0, bool force=false, const char *propNamePrefix=0, const boost::dynamic_bitset<> *bondsToUse=0)
returns a molecule's adjacency matrix
RDKit::MolOps::SanitizeFlags
SanitizeFlags
Definition: MolOps.h:348
RDKit::MolOps::cleanupChirality
RDKIT_GRAPHMOL_EXPORT void cleanupChirality(RWMol &mol)
removes bogus chirality markers (those on non-sp3 centers):
RDKit::MolOps::removeStereochemistry
RDKIT_GRAPHMOL_EXPORT void removeStereochemistry(ROMol &mol)
Removes all stereochemistry information from atoms (i.e. R/S) and bonds.
RDKit::MolOps::AROMATICITY_SIMPLE
@ AROMATICITY_SIMPLE
Definition: MolOps.h:443
RDKit::MolOps::AdjustQueryParameters::aromatizeIfPossible
bool aromatizeIfPossible
Definition: MolOps.h:285
RDKit::MolOps::assignRadicals
RDKIT_GRAPHMOL_EXPORT void assignRadicals(RWMol &mol)
Called by the sanitizer to assign radical counts to atoms.
RDKit::MolOps::SANITIZE_SETAROMATICITY
@ SANITIZE_SETAROMATICITY
Definition: MolOps.h:355
RDKit::MolOps::symmetrizeSSSR
RDKIT_GRAPHMOL_EXPORT int symmetrizeSSSR(ROMol &mol, std::vector< std::vector< int >> &res)
symmetrize the molecule's Smallest Set of Smallest Rings
RDKit::MolOps::computeBalabanJ
RDKIT_GRAPHMOL_EXPORT double computeBalabanJ(const ROMol &mol, bool useBO=true, bool force=false, const std::vector< int > *bondPath=0, bool cacheIt=true)
calculates Balaban's J index for the molecule
RDKit::MolOps::ADJUST_IGNORECHAINS
@ ADJUST_IGNORECHAINS
Definition: MolOps.h:269
RDKit::MolOps::AdjustQueryParameters
Definition: MolOps.h:277
types.h
BoostStartInclude.h
RDKit::MolOps::AROMATICITY_CUSTOM
@ AROMATICITY_CUSTOM
use a function
Definition: MolOps.h:445
RDKit::MolOps::setDoubleBondNeighborDirections
RDKIT_GRAPHMOL_EXPORT void setDoubleBondNeighborDirections(ROMol &mol, const Conformer *conf=nullptr)
Sets bond directions based on double bond stereochemistry.
RDKit::MolOps::adjustQueryProperties
RDKIT_GRAPHMOL_EXPORT ROMol * adjustQueryProperties(const ROMol &mol, const AdjustQueryParameters *params=NULL)
returns a copy of a molecule with query properties adjusted
RDKit::RWMol
RWMol is a molecule class that is intended to be edited.
Definition: RWMol.h:31
RDKit::MolOps::ADJUST_IGNORENONDUMMIES
@ ADJUST_IGNORENONDUMMIES
Definition: MolOps.h:272
RDKit::MolOps::AdjustQueryParameters::makeDummiesQueries
bool makeDummiesQueries
Definition: MolOps.h:283
RDKit::MolOps::SANITIZE_FINDRADICALS
@ SANITIZE_FINDRADICALS
Definition: MolOps.h:354
RDKit::MolOps::AdjustQueryParameters::adjustDegree
bool adjustDegree
Definition: MolOps.h:278
RDKit::MolOps::ADJUST_IGNOREALL
@ ADJUST_IGNOREALL
Definition: MolOps.h:274
RDKit::MolOps::mergeQueryHs
RDKIT_GRAPHMOL_EXPORT ROMol * mergeQueryHs(const ROMol &mol, bool mergeUnmappedOnly=false)
RDKit::MolOps::SANITIZE_ADJUSTHS
@ SANITIZE_ADJUSTHS
Definition: MolOps.h:359
RDKit::MolOps::findRingFamilies
RDKIT_GRAPHMOL_EXPORT void findRingFamilies(const ROMol &mol)
RDKit::MolOps::SANITIZE_PROPERTIES
@ SANITIZE_PROPERTIES
Definition: MolOps.h:351
RDKit::Atom
The class for representing atoms.
Definition: Atom.h:69
RDKit::MolOps::AdjustQueryParameters::adjustRingCountFlags
std::uint32_t adjustRingCountFlags
Definition: MolOps.h:281
RDKit::MolOps::SANITIZE_SYMMRINGS
@ SANITIZE_SYMMRINGS
Definition: MolOps.h:352
BoostEndInclude.h
RDKit::MolOps::ADJUST_IGNORERINGS
@ ADJUST_IGNORERINGS
Definition: MolOps.h:270
RDKit::MolOps::AROMATICITY_MDL
@ AROMATICITY_MDL
Definition: MolOps.h:444
RDKit::MolOps::AdjustQueryParameters::makeBondsGeneric
bool makeBondsGeneric
Definition: MolOps.h:286
RDKit::ROMol
Definition: ROMol.h:171
RDKit::MolOps::detectChemistryProblems
RDKIT_GRAPHMOL_EXPORT std::vector< std::unique_ptr< MolSanitizeException > > detectChemistryProblems(const ROMol &mol, unsigned int sanitizeOps=SANITIZE_ALL)
Identifies chemistry problems (things that don't make chemical sense) in a molecule.
RDKit::MolOps::AdjustQueryParameters::adjustRingChain
bool adjustRingChain
Definition: MolOps.h:293
RDKit::MolOps::get3DDistanceMat
RDKIT_GRAPHMOL_EXPORT double * get3DDistanceMat(const ROMol &mol, int confId=-1, bool useAtomWts=false, bool force=false, const char *propNamePrefix=0)
Computes the molecule's 3D distance matrix.
RDKit::MolOps::AdjustQueryParameters::adjustRingCount
bool adjustRingCount
Definition: MolOps.h:280
RDKit::MolOps::cleanUp
RDKIT_GRAPHMOL_EXPORT void cleanUp(RWMol &mol)
Designed to be called by the sanitizer to handle special cases before.
RDKit::MolOps::findSSSR
RDKIT_GRAPHMOL_EXPORT int findSSSR(const ROMol &mol, std::vector< std::vector< int >> &res)
finds a molecule's Smallest Set of Smallest Rings
RDKit::MolOps::sanitizeMol
RDKIT_GRAPHMOL_EXPORT void sanitizeMol(RWMol &mol, unsigned int &operationThatFailed, unsigned int sanitizeOps=SANITIZE_ALL)
carries out a collection of tasks for cleaning up a molecule and
RDKit::INVAR_VECT_CI
INVAR_VECT::const_iterator INVAR_VECT_CI
Definition: MolOps.h:34
RDKit::MolOps::AdjustQueryWhichFlags
AdjustQueryWhichFlags
Definition: MolOps.h:267
RDKit::MolOps::assignStereochemistryFrom3D
RDKIT_GRAPHMOL_EXPORT void assignStereochemistryFrom3D(ROMol &mol, int confId=-1, bool replaceExistingTags=true)
Uses a conformer to assign ChiralTypes to a molecule's atoms and stereo flags to its bonds.
RDKIT_GRAPHMOL_EXPORT
#define RDKIT_GRAPHMOL_EXPORT
Definition: export.h:307
RDKit::UINT_VECT
std::vector< UINT > UINT_VECT
Definition: types.h:273
RDKit::MolOps::fastFindRings
RDKIT_GRAPHMOL_EXPORT void fastFindRings(const ROMol &mol)
use a DFS algorithm to identify ring bonds and atoms in a molecule
RDKit::MolOps::assignStereochemistry
RDKIT_GRAPHMOL_EXPORT void assignStereochemistry(ROMol &mol, bool cleanIt=false, bool force=false, bool flagPossibleStereoCenters=false)
Assign stereochemistry tags to atoms (i.e. R/S) and bonds (i.e. Z/E)
RDKit::MolOps::SANITIZE_SETCONJUGATION
@ SANITIZE_SETCONJUGATION
Definition: MolOps.h:356
RDKit::MolOps::SANITIZE_KEKULIZE
@ SANITIZE_KEKULIZE
Definition: MolOps.h:353
RDKit::Conformer
The class for representing 2D or 3D conformation of a molecule.
Definition: Conformer.h:43
RDKit::MolOps::AdjustQueryParameters::adjustHeavyDegree
bool adjustHeavyDegree
Definition: MolOps.h:290
RDKit::MolOps::SANITIZE_ALL
@ SANITIZE_ALL
Definition: MolOps.h:360
RDKit::MolOps::setAromaticity
RDKIT_GRAPHMOL_EXPORT int setAromaticity(RWMol &mol, AromaticityModel model=AROMATICITY_DEFAULT, int(*func)(RWMol &)=NULL)
Sets up the aromaticity for a molecule.
RDKit::MolOps::addHs
RDKIT_GRAPHMOL_EXPORT ROMol * addHs(const ROMol &mol, bool explicitOnly=false, bool addCoords=false, const UINT_VECT *onlyOnAtoms=NULL, bool addResidueInfo=false)
returns a copy of a molecule with hydrogens added in as explicit Atoms
RDKit::MolOps::assignChiralTypesFrom3D
RDKIT_GRAPHMOL_EXPORT void assignChiralTypesFrom3D(ROMol &mol, int confId=-1, bool replaceExistingTags=true)
Uses a conformer to assign ChiralType to a molecule's atoms.
RDKit::MolOps::AdjustQueryParameters::makeAtomsGeneric
bool makeAtomsGeneric
Definition: MolOps.h:288
RDKit::MolOps::getMolFragsWithQuery
RDKIT_GRAPHMOL_EXPORT std::map< T, boost::shared_ptr< ROMol > > getMolFragsWithQuery(const ROMol &mol, T(*query)(const ROMol &, const Atom *), bool sanitizeFrags=true, const std::vector< T > *whiteList=0, bool negateList=false)
splits a molecule into pieces based on labels assigned using a query
RDKit::INVAR_VECT_I
INVAR_VECT::iterator INVAR_VECT_I
Definition: MolOps.h:33
SanitException.h
RDKit::MolOps::AdjustQueryParameters::adjustRingChainFlags
std::uint32_t adjustRingChainFlags
Definition: MolOps.h:294
RDKit::MolOps::ADJUST_IGNORENONE
@ ADJUST_IGNORENONE
Definition: MolOps.h:268
RDKit
Std stuff.
Definition: Atom.h:30
RDKit::INVAR_VECT
std::vector< double > INVAR_VECT
Definition: MolOps.h:31
RDKit::MolOps::SANITIZE_SETHYBRIDIZATION
@ SANITIZE_SETHYBRIDIZATION
Definition: MolOps.h:357
RDKit::MolOps::setHybridization
RDKIT_GRAPHMOL_EXPORT void setHybridization(ROMol &mol)
calculates and sets the hybridization of all a molecule's Stoms
RDKit::MolOps::countAtomElec
RDKIT_GRAPHMOL_EXPORT int countAtomElec(const Atom *at)
return the number of electrons available on an atom to donate for
RDKit::MolOps::atomHasConjugatedBond
RDKIT_GRAPHMOL_EXPORT bool atomHasConjugatedBond(const Atom *at)
returns whether or not the given Atom is involved in a conjugated bond
RDKit::MolOps::removeHs
RDKIT_GRAPHMOL_EXPORT ROMol * removeHs(const ROMol &mol, bool implicitOnly=false, bool updateExplicitCount=false, bool sanitize=true)
returns a copy of a molecule with hydrogens removed
RDKit::MolOps::SANITIZE_CLEANUPCHIRALITY
@ SANITIZE_CLEANUPCHIRALITY
Definition: MolOps.h:358
RDKit::MolOps::AROMATICITY_RDKIT
@ AROMATICITY_RDKIT
Definition: MolOps.h:442
RDKit::MolOps::getShortestPath
RDKIT_GRAPHMOL_EXPORT std::list< int > getShortestPath(const ROMol &mol, int aid1, int aid2)
Find the shortest path between two atoms.
RDKit::MolOps::AdjustQueryParameters::adjustDegreeFlags
std::uint32_t adjustDegreeFlags
Definition: MolOps.h:279
RDKit::MolOps::SANITIZE_CLEANUP
@ SANITIZE_CLEANUP
Definition: MolOps.h:350
RDKit::MolOps::setBondStereoFromDirections
RDKIT_GRAPHMOL_EXPORT void setBondStereoFromDirections(ROMol &mol)
Assign CIS/TRANS bond stereochemistry tags based on neighboring directions.
RDKit::MolOps::AdjustQueryParameters::AdjustQueryParameters
AdjustQueryParameters()
Definition: MolOps.h:296
RDKit::MolOps::adjustHs
RDKIT_GRAPHMOL_EXPORT void adjustHs(RWMol &mol)
adjust the number of implicit and explicit Hs for special cases
RDKit::MolOps::AromaticityModel
AromaticityModel
Possible aromaticity models.
Definition: MolOps.h:440
RDKit::MolOps::detectBondStereochemistry
RDKIT_GRAPHMOL_EXPORT void detectBondStereochemistry(ROMol &mol, int confId=-1)
RDKit::MolOps::getDistanceMat
RDKIT_GRAPHMOL_EXPORT double * getDistanceMat(const ROMol &mol, bool useBO=false, bool useAtomWts=false, bool force=false, const char *propNamePrefix=0)
Computes the molecule's topological distance matrix.
RDKit::MolOps::assignChiralTypesFromBondDirs
RDKIT_GRAPHMOL_EXPORT void assignChiralTypesFromBondDirs(ROMol &mol, int confId=-1, bool replaceExistingTags=true)
Use bond directions to assign ChiralTypes to a molecule's atoms and stereo flags to its bonds.
RDKit::MolOps::getNumAtomsWithDistinctProperty
RDKIT_GRAPHMOL_EXPORT unsigned getNumAtomsWithDistinctProperty(const ROMol &mol, std::string prop)
returns the number of atoms which have a particular property set
RDKit::MolOps::AROMATICITY_DEFAULT
@ AROMATICITY_DEFAULT
future proofing
Definition: MolOps.h:441
RDKit::MolOps::getFormalCharge
RDKIT_GRAPHMOL_EXPORT int getFormalCharge(const ROMol &mol)
sums up all atomic formal charges and returns the result
RDKit::MolOps::ADJUST_IGNOREDUMMIES
@ ADJUST_IGNOREDUMMIES
Definition: MolOps.h:271
RDKit::MolOps::AdjustQueryParameters::makeBondsGenericFlags
std::uint32_t makeBondsGenericFlags
Definition: MolOps.h:287
RDKit::MolOps::setConjugation
RDKIT_GRAPHMOL_EXPORT void setConjugation(ROMol &mol)
flags the molecule's conjugated bonds
ci_LOCAL_INF
const RDKIT_GRAPHMOL_EXPORT int ci_LOCAL_INF
RDKit::MolOps::AdjustQueryParameters::adjustHeavyDegreeFlags
std::uint32_t adjustHeavyDegreeFlags
Definition: MolOps.h:292
RDKit::MolOps::renumberAtoms
RDKIT_GRAPHMOL_EXPORT ROMol * renumberAtoms(const ROMol &mol, const std::vector< unsigned int > &newOrder)
returns a copy of a molecule with the atoms renumbered
RDKit::MolOps::findPotentialStereoBonds
RDKIT_GRAPHMOL_EXPORT void findPotentialStereoBonds(ROMol &mol, bool cleanIt=false)
finds bonds that could be cis/trans in a molecule and mark them as Bond::STEREOANY.
RDKit::MolOps::SANITIZE_NONE
@ SANITIZE_NONE
Definition: MolOps.h:349
RDKit::MolOps::ADJUST_IGNOREMAPPED
@ ADJUST_IGNOREMAPPED
Definition: MolOps.h:273
RDKit::MolOps::AdjustQueryParameters::makeAtomsGenericFlags
std::uint32_t makeAtomsGenericFlags
Definition: MolOps.h:289
export.h