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 minimum 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);
236  bool removeDegreeZero = false; /**< hydrogens that have no bonds */
237  bool removeHigherDegrees = false; /**< hydrogens with two (or more) bonds */
238  bool removeOnlyHNeighbors =
239  false; /**< hydrogens with bonds only to other hydrogens */
240  bool removeIsotopes = false; /**< hydrogens with non-default isotopes */
241  bool removeDummyNeighbors =
242  false; /**< hydrogens with at least one dummy-atom neighbor */
243  bool removeDefiningBondStereo =
244  false; /**< hydrogens defining bond stereochemistry */
245  bool removeWithWedgedBond = true; /**< hydrogens with wedged bonds to them */
246  bool removeWithQuery = false; /**< hydrogens with queries defined */
247  bool removeMapped = true; /**< mapped hydrogens */
248  bool removeInSGroups = false; /**< part of a SubstanceGroup */
249  bool showWarnings = true; /**< display warnings for Hs that are not removed */
250  bool removeNonimplicit = true; /**< DEPRECATED equivalent of implicitOnly */
251  bool updateExplicitCount =
252  false; /**< DEPRECATED equivalent of updateExplicitCount */
253  bool removeHydrides = true; /**< Removing Hydrides */
254 };
255 //! \overload
256 // modifies the molecule in place
258  bool sanitize = true);
259 //! \overload
260 // The caller owns the pointer this returns
262  const RemoveHsParameters &ps,
263  bool sanitize = true);
264 
265 //! removes all Hs from a molecule
266 RDKIT_GRAPHMOL_EXPORT void removeAllHs(RWMol &mol, bool sanitize = true);
267 //! \overload
268 // The caller owns the pointer this returns
270  bool sanitize = true);
271 
272 //! returns a copy of a molecule with hydrogens removed and added as queries
273 //! to the heavy atoms to which they are bound.
274 /*!
275  This is really intended to be used with molecules that contain QueryAtoms
276 
277  \param mol the molecule to remove Hs from
278 
279  \return the new molecule
280 
281  <b>Notes:</b>
282  - Atoms that do not already have hydrogen count queries will have one
283  added, other H-related queries will not be touched. Examples:
284  - C[H] -> [C;!H0]
285  - [C;H1][H] -> [C;H1]
286  - [C;H2][H] -> [C;H2]
287  - Hydrogens which aren't connected to a heavy atom will not be
288  removed. This prevents molecules like <tt>"[H][H]"</tt> from having
289  all atoms removed.
290  - the caller is responsible for <tt>delete</tt>ing the pointer this
291  returns.
292  - By default all hydrogens are removed, however if
293  mergeUnmappedOnly is true, any hydrogen participating
294  in an atom map will be retained
295 
296 */
298  bool mergeUnmappedOnly = false);
299 //! \overload
300 // modifies the molecule in place
302  bool mergeUnmappedOnly = false);
303 
304 typedef enum {
311  ADJUST_IGNOREALL = 0xFFFFFFF
313 
315  bool adjustDegree = true; /**< add degree queries */
316  std::uint32_t adjustDegreeFlags = ADJUST_IGNOREDUMMIES | ADJUST_IGNORECHAINS;
317 
318  bool adjustRingCount = false; /**< add ring-count queries */
319  std::uint32_t adjustRingCountFlags =
321 
322  bool makeDummiesQueries = true; /**< convert dummy atoms without isotope
323  labels to any-atom queries */
324 
325  bool aromatizeIfPossible = true; /**< perceive and set aromaticity */
326 
327  bool makeBondsGeneric =
328  false; /**< convert bonds to generic queries (any bonds) */
329  std::uint32_t makeBondsGenericFlags = ADJUST_IGNORENONE;
330 
331  bool makeAtomsGeneric =
332  false; /**< convert atoms to generic queries (any atoms) */
333  std::uint32_t makeAtomsGenericFlags = ADJUST_IGNORENONE;
334 
335  bool adjustHeavyDegree = false; /**< adjust the heavy-atom degree instead of
336  overall degree */
337  std::uint32_t adjustHeavyDegreeFlags =
339 
340  bool adjustRingChain = false; /**< add ring-chain queries */
341  std::uint32_t adjustRingChainFlags = ADJUST_IGNORENONE;
342 
343  bool useStereoCareForBonds =
344  false; /**< remove stereochemistry info from double bonds that do not have
345  the stereoCare property set */
346 
348 };
349 
350 //! updates an AdjustQueryParameters object from a JSON string
352  MolOps::AdjustQueryParameters &p, const std::string &json);
353 
354 //! returns a copy of a molecule with query properties adjusted
355 /*!
356  \param mol the molecule to adjust
357  \param params controls the adjustments made
358 
359  \return the new molecule
360 */
362  const ROMol &mol, const AdjustQueryParameters *params = NULL);
363 //! \overload
364 // modifies the molecule in place
366  RWMol &mol, const AdjustQueryParameters *params = NULL);
367 
368 //! returns a copy of a molecule with the atoms renumbered
369 /*!
370 
371  \param mol the molecule to work with
372  \param newOrder the new ordering of the atoms (should be numAtoms long)
373  for example: if newOrder is [3,2,0,1], then atom 3 in the original
374  molecule will be atom 0 in the new one
375 
376  \return the new molecule
377 
378  <b>Notes:</b>
379  - the caller is responsible for <tt>delete</tt>ing the pointer this
380  returns.
381 
382 */
384  const ROMol &mol, const std::vector<unsigned int> &newOrder);
385 
386 //@}
387 
388 //! \name Sanitization
389 //@{
390 
391 typedef enum {
403  SANITIZE_ALL = 0xFFFFFFF
405 
406 //! \brief carries out a collection of tasks for cleaning up a molecule and
407 // ensuring
408 //! that it makes "chemical sense"
409 /*!
410  This functions calls the following in sequence
411  -# MolOps::cleanUp()
412  -# mol.updatePropertyCache()
413  -# MolOps::symmetrizeSSSR()
414  -# MolOps::Kekulize()
415  -# MolOps::assignRadicals()
416  -# MolOps::setAromaticity()
417  -# MolOps::setConjugation()
418  -# MolOps::setHybridization()
419  -# MolOps::cleanupChirality()
420  -# MolOps::adjustHs()
421 
422  \param mol : the RWMol to be cleaned
423 
424  \param operationThatFailed : the first (if any) sanitization operation that
425  fails is set here.
426  The values are taken from the \c SanitizeFlags
427  enum. On success, the value is \c
428  SanitizeFlags::SANITIZE_NONE
429 
430  \param sanitizeOps : the bits here are used to set which sanitization
431  operations are carried out. The elements of the \c
432  SanitizeFlags enum define the operations.
433 
434  <b>Notes:</b>
435  - If there is a failure in the sanitization, a \c MolSanitizeException
436  will be thrown.
437  - in general the user of this function should cast the molecule following
438  this function to a ROMol, so that new atoms and bonds cannot be added to
439  the molecule and screw up the sanitizing that has been done here
440 */
442  unsigned int &operationThatFailed,
443  unsigned int sanitizeOps = SANITIZE_ALL);
444 //! \overload
446 
447 //! \brief Identifies chemistry problems (things that don't make chemical
448 //! sense) in a molecule
449 /*!
450  This functions uses the operations in sanitizeMol but does not change
451  the input structure and returns a list of the problems encountered instead
452  of stopping at the first failure,
453 
454  The problems this looks for come from the sanitization operations:
455  -# mol.updatePropertyCache() : Unreasonable valences
456  -# MolOps::Kekulize() : Unkekulizable ring systems, aromatic atoms not
457  in rings, aromatic bonds to non-aromatic atoms.
458 
459  \param mol : the RWMol to be cleaned
460 
461  \param sanitizeOps : the bits here are used to set which sanitization
462  operations are carried out. The elements of the \c
463  SanitizeFlags enum define the operations.
464 
465  \return a vector of \c MolSanitizeException values that indicate what
466  problems were encountered
467 
468 */
470 std::vector<std::unique_ptr<MolSanitizeException>> detectChemistryProblems(
471  const ROMol &mol, unsigned int sanitizeOps = SANITIZE_ALL);
472 
473 //! Possible aromaticity models
474 /*!
475 - \c AROMATICITY_DEFAULT at the moment always uses \c AROMATICITY_RDKIT
476 - \c AROMATICITY_RDKIT is the standard RDKit model (as documented in the RDKit
477 Book)
478 - \c AROMATICITY_SIMPLE only considers 5- and 6-membered simple rings (it
479 does not consider the outer envelope of fused rings)
480 - \c AROMATICITY_MDL
481 - \c AROMATICITY_CUSTOM uses a caller-provided function
482 */
483 typedef enum {
484  AROMATICITY_DEFAULT = 0x0, ///< future proofing
488  AROMATICITY_CUSTOM = 0xFFFFFFF ///< use a function
490 
491 //! Sets up the aromaticity for a molecule
492 /*!
493 
494  This is what happens here:
495  -# find all the simple rings by calling the findSSSR function
496  -# loop over all the Atoms in each ring and mark them if they are
497  candidates
498  for aromaticity. A ring atom is a candidate if it can spare electrons
499  to the ring and if it's from the first two rows of the periodic table.
500  -# based on the candidate atoms, mark the rings to be either candidates
501  or non-candidates. A ring is a candidate only if all its atoms are
502  candidates
503  -# apply Hueckel rule to each of the candidate rings to check if the ring
504  can be
505  aromatic
506 
507  \param mol the RWMol of interest
508  \param model the aromaticity model to use
509  \param func a custom function for assigning aromaticity (only used when
510  model=\c AROMATICITY_CUSTOM)
511 
512  \return >0 on success, <= 0 otherwise
513 
514  <b>Assumptions:</b>
515  - Kekulization has been done (i.e. \c MolOps::Kekulize() has already
516  been called)
517 
518 */
521  int (*func)(RWMol &) = NULL);
522 
523 //! Designed to be called by the sanitizer to handle special cases before
524 // anything is done.
525 /*!
526 
527  Currently this:
528  - modifies nitro groups, so that the nitrogen does not have an
529  unreasonable valence of 5, as follows:
530  - the nitrogen gets a positive charge
531  - one of the oxygens gets a negative chage and the double bond to
532  this oxygen is changed to a single bond The net result is that nitro groups
533  can be counted on to be: \c "[N+](=O)[O-]"
534  - modifies halogen-oxygen containing species as follows:
535  \c [Cl,Br,I](=O)(=O)(=O)O -> [X+3]([O-])([O-])([O-])O
536  \c [Cl,Br,I](=O)(=O)O -> [X+3]([O-])([O-])O
537  \c [Cl,Br,I](=O)O -> [X+]([O-])O
538  - converts the substructure [N,C]=P(=O)-* to [N,C]=[P+](-[O-])-*
539 
540  \param mol the molecule of interest
541 
542 */
544 
545 //! Called by the sanitizer to assign radical counts to atoms
547 
548 //! adjust the number of implicit and explicit Hs for special cases
549 /*!
550 
551  Currently this:
552  - modifies aromatic nitrogens so that, when appropriate, they have an
553  explicit H marked (e.g. so that we get things like \c "c1cc[nH]cc1"
554 
555  \param mol the molecule of interest
556 
557  <b>Assumptions</b>
558  - this is called after the molecule has been sanitized,
559  aromaticity has been perceived, and the implicit valence of
560  everything has been calculated.
561 
562 */
564 
565 //! Kekulizes the molecule
566 /*!
567 
568  \param mol the molecule of interest
569  \param markAtomsBonds if this is set to true, \c isAromatic boolean
570  settings on both the Bonds and Atoms are turned to false following the
571  Kekulization, otherwise they are left alone in their original state. \param
572  maxBackTracks the maximum number of attempts at back-tracking. The
573  algorithm
574  uses a back-tracking procedure to revisit a previous
575  setting of
576  double bond if we hit a wall in the kekulization
577  process
578 
579  <b>Notes:</b>
580  - even if \c markAtomsBonds is \c false the \c BondType for all aromatic
581  bonds will be changed from \c RDKit::Bond::AROMATIC to \c
582  RDKit::Bond::SINGLE
583  or RDKit::Bond::DOUBLE during Kekulization.
584 
585 */
586 RDKIT_GRAPHMOL_EXPORT void Kekulize(RWMol &mol, bool markAtomsBonds = true,
587  unsigned int maxBackTracks = 100);
588 
589 //! flags the molecule's conjugated bonds
591 
592 //! calculates and sets the hybridization of all a molecule's Stoms
594 
595 // @}
596 
597 //! \name Ring finding and SSSR
598 //@{
599 
600 //! finds a molecule's Smallest Set of Smallest Rings
601 /*!
602  Currently this implements a modified form of Figueras algorithm
603  (JCICS - Vol. 36, No. 5, 1996, 986-991)
604 
605  \param mol the molecule of interest
606  \param res used to return the vector of rings. Each entry is a vector with
607  atom indices. This information is also stored in the molecule's
608  RingInfo structure, so this argument is optional (see overload)
609 
610  \return number of smallest rings found
611 
612  Base algorithm:
613  - The original algorithm starts by finding representative degree 2
614  nodes.
615  - Representative because if a series of deg 2 nodes are found only
616  one of them is picked.
617  - The smallest ring around each of them is found.
618  - The bonds that connect to this degree 2 node are them chopped off,
619  yielding
620  new deg two nodes
621  - The process is repeated on the new deg 2 nodes.
622  - If no deg 2 nodes are found, a deg 3 node is picked. The smallest ring
623  with it is found. A bond from this is "carefully" (look in the paper)
624  selected and chopped, yielding deg 2 nodes. The process is same as
625  above once this is done.
626 
627  Our Modifications:
628  - If available, more than one smallest ring around a representative deg 2
629  node will be computed and stored
630  - Typically 3 rings are found around a degree 3 node (when no deg 2s are
631  available)
632  and all the bond to that node are chopped.
633  - The extra rings that were found in this process are removed after all
634  the nodes have been covered.
635 
636  These changes were motivated by several factors:
637  - We believe the original algorithm fails to find the correct SSSR
638  (finds the correct number of them but the wrong ones) on some sample
639  mols
640  - Since SSSR may not be unique, a post-SSSR step to symmetrize may be
641  done. The extra rings this process adds can be quite useful.
642 */
644  std::vector<std::vector<int>> &res);
645 //! \overload
647  std::vector<std::vector<int>> *res = 0);
648 
649 //! use a DFS algorithm to identify ring bonds and atoms in a molecule
650 /*!
651  \b NOTE: though the RingInfo structure is populated by this function,
652  the only really reliable calls that can be made are to check if
653  mol.getRingInfo().numAtomRings(idx) or mol.getRingInfo().numBondRings(idx)
654  return values >0
655 */
657 
659 
660 //! symmetrize the molecule's Smallest Set of Smallest Rings
661 /*!
662  SSSR rings obatined from "findSSSR" can be non-unique in some case.
663  For example, cubane has five SSSR rings, not six as one would hope.
664 
665  This function adds additional rings to the SSSR list if necessary
666  to make the list symmetric, e.g. all atoms in cubane will be part of the
667  same number of SSSRs. This function choses these extra rings from the extra
668  rings computed and discarded during findSSSR. The new ring are chosen such
669  that:
670  - replacing a same sized ring in the SSSR list with an extra ring yields
671  the same union of bond IDs as the original SSSR list
672 
673  \param mol - the molecule of interest
674  \param res used to return the vector of rings. Each entry is a vector with
675  atom indices. This information is also stored in the molecule's
676  RingInfo structure, so this argument is optional (see overload)
677 
678  \return the total number of rings = (new rings + old SSSRs)
679 
680  <b>Notes:</b>
681  - if no SSSR rings are found on the molecule - MolOps::findSSSR() is called
682  first
683 */
685  std::vector<std::vector<int>> &res);
686 //! \overload
688 
689 //@}
690 
691 //! \name Shortest paths and other matrices
692 //@{
693 
694 //! returns a molecule's adjacency matrix
695 /*!
696  \param mol the molecule of interest
697  \param useBO toggles use of bond orders in the matrix
698  \param emptyVal sets the empty value (for non-adjacent atoms)
699  \param force forces calculation of the matrix, even if already
700  computed
701  \param propNamePrefix used to set the cached property name
702 
703  \return the adjacency matrix.
704 
705  <b>Notes</b>
706  - The result of this is cached in the molecule's local property
707  dictionary, which will handle deallocation. The caller should <b>not</b> \c
708  delete this pointer.
709 
710 */
712  const ROMol &mol, bool useBO = false, int emptyVal = 0, bool force = false,
713  const char *propNamePrefix = 0,
714  const boost::dynamic_bitset<> *bondsToUse = 0);
715 
716 //! Computes the molecule's topological distance matrix
717 /*!
718  Uses the Floyd-Warshall all-pairs-shortest-paths algorithm.
719 
720  \param mol the molecule of interest
721  \param useBO toggles use of bond orders in the matrix
722  \param useAtomWts sets the diagonal elements of the result to
723  6.0/(atomic number) so that the matrix can be used to calculate
724  Balaban J values. This does not affect the bond weights.
725  \param force forces calculation of the matrix, even if already
726  computed
727  \param propNamePrefix used to set the cached property name
728 
729  \return the distance matrix.
730 
731  <b>Notes</b>
732  - The result of this is cached in the molecule's local property
733  dictionary, which will handle deallocation. The caller should <b>not</b> \c
734  delete this pointer.
735 
736 
737 */
739  bool useBO = false,
740  bool useAtomWts = false,
741  bool force = false,
742  const char *propNamePrefix = 0);
743 
744 //! Computes the molecule's topological distance matrix
745 /*!
746  Uses the Floyd-Warshall all-pairs-shortest-paths algorithm.
747 
748  \param mol the molecule of interest
749  \param activeAtoms only elements corresponding to these atom indices
750  will be included in the calculation
751  \param bonds only bonds found in this list will be included in the
752  calculation
753  \param useBO toggles use of bond orders in the matrix
754  \param useAtomWts sets the diagonal elements of the result to
755  6.0/(atomic number) so that the matrix can be used to calculate
756  Balaban J values. This does not affect the bond weights.
757 
758  \return the distance matrix.
759 
760  <b>Notes</b>
761  - The results of this call are not cached, the caller <b>should</b> \c
762  delete
763  this pointer.
764 
765 
766 */
768  const ROMol &mol, const std::vector<int> &activeAtoms,
769  const std::vector<const Bond *> &bonds, bool useBO = false,
770  bool useAtomWts = false);
771 
772 //! Computes the molecule's 3D distance matrix
773 /*!
774 
775  \param mol the molecule of interest
776  \param confId the conformer to use
777  \param useAtomWts sets the diagonal elements of the result to
778  6.0/(atomic number)
779  \param force forces calculation of the matrix, even if already
780  computed
781  \param propNamePrefix used to set the cached property name
782  (if set to an empty string, the matrix will not be
783  cached)
784 
785  \return the distance matrix.
786 
787  <b>Notes</b>
788  - If propNamePrefix is not empty the result of this is cached in the
789  molecule's local property dictionary, which will handle deallocation.
790  In other cases the caller is responsible for freeing the memory.
791 
792 */
794  int confId = -1,
795  bool useAtomWts = false,
796  bool force = false,
797  const char *propNamePrefix = 0);
798 //! Find the shortest path between two atoms
799 /*!
800  Uses the Bellman-Ford algorithm
801 
802  \param mol molecule of interest
803  \param aid1 index of the first atom
804  \param aid2 index of the second atom
805 
806  \return an std::list with the indices of the atoms along the shortest
807  path
808 
809  <b>Notes:</b>
810  - the starting and end atoms are included in the path
811  - if no path is found, an empty path is returned
812 
813 */
814 RDKIT_GRAPHMOL_EXPORT std::list<int> getShortestPath(const ROMol &mol, int aid1,
815  int aid2);
816 
817 //@}
818 
819 #if 0
820  //! \name Canonicalization
821  //@{
822 
823  //! assign a canonical ordering to a molecule's atoms
824  /*!
825  The algorithm used here is a modification of the published Daylight canonical
826  smiles algorithm (i.e. it uses atom invariants and products of primes).
827 
828  \param mol the molecule of interest
829  \param ranks used to return the ranks
830  \param breakTies toggles breaking of ties (see below)
831  \param includeChirality toggles inclusion of chirality in the invariants
832  \param includeIsotopes toggles inclusion of isotopes in the invariants
833  \param rankHistory used to return the rank history (see below)
834 
835  <b>Notes:</b>
836  - Tie breaking should be done when it's important to have a full ordering
837  of the atoms (e.g. when generating canonical traversal trees). If it's
838  acceptable to have ties between symmetry-equivalent atoms (e.g. when
839  generating CIP codes), tie breaking can/should be skipped.
840  - if the \c rankHistory argument is provided, the evolution of the ranks of
841  individual atoms will be tracked. The \c rankHistory pointer should be
842  to a VECT_INT_VECT that has at least \c mol.getNumAtoms() elements.
843  */
844  RDKIT_GRAPHMOL_EXPORT void rankAtoms(const ROMol &mol,std::vector<int> &ranks,
845  bool breakTies=true,
846  bool includeChirality=true,
847  bool includeIsotopes=true,
848  std::vector<std::vector<int> > *rankHistory=0);
849  //! assign a canonical ordering to a sub-molecule's atoms
850  /*!
851  The algorithm used here is a modification of the published Daylight canonical
852  smiles algorithm (i.e. it uses atom invariants and products of primes).
853 
854  \param mol the molecule of interest
855  \param atomsToUse atoms to be included
856  \param bondsToUse bonds to be included
857  \param atomSymbols symbols to use for the atoms in the output (these are
858  used in place of atomic number and isotope information)
859  \param ranks used to return the ranks
860  \param breakTies toggles breaking of ties (see below)
861  \param rankHistory used to return the rank history (see below)
862 
863  <b>Notes:</b>
864  - Tie breaking should be done when it's important to have a full ordering
865  of the atoms (e.g. when generating canonical traversal trees). If it's
866  acceptable to have ties between symmetry-equivalent atoms (e.g. when
867  generating CIP codes), tie breaking can/should be skipped.
868  - if the \c rankHistory argument is provided, the evolution of the ranks of
869  individual atoms will be tracked. The \c rankHistory pointer should be
870  to a VECT_INT_VECT that has at least \c mol.getNumAtoms() elements.
871  */
872  RDKIT_GRAPHMOL_EXPORT void rankAtomsInFragment(const ROMol &mol,std::vector<int> &ranks,
873  const boost::dynamic_bitset<> &atomsToUse,
874  const boost::dynamic_bitset<> &bondsToUse,
875  const std::vector<std::string> *atomSymbols=0,
876  const std::vector<std::string> *bondSymbols=0,
877  bool breakTies=true,
878  std::vector<std::vector<int> > *rankHistory=0);
879 
880  // @}
881 #endif
882 //! \name Stereochemistry
883 //@{
884 
885 //! removes bogus chirality markers (those on non-sp3 centers):
887 
888 //! \brief Uses a conformer to assign ChiralType to a molecule's atoms
889 /*!
890  \param mol the molecule of interest
891  \param confId the conformer to use
892  \param replaceExistingTags if this flag is true, any existing atomic chiral
893  tags will be replaced
894 
895  If the conformer provided is not a 3D conformer, nothing will be done.
896 */
898  ROMol &mol, int confId = -1, bool replaceExistingTags = true);
899 
900 //! \brief Uses a conformer to assign ChiralTypes to a molecule's atoms and
901 //! stereo flags to its bonds
902 /*!
903 
904  \param mol the molecule of interest
905  \param confId the conformer to use
906  \param replaceExistingTags if this flag is true, any existing info about
907  stereochemistry will be replaced
908 
909  If the conformer provided is not a 3D conformer, nothing will be done.
910 */
912  ROMol &mol, int confId = -1, bool replaceExistingTags = true);
913 
914 //! \brief Use bond directions to assign ChiralTypes to a molecule's atoms and
915 //! stereo flags to its bonds
916 /*!
917 
918  \param mol the molecule of interest
919  \param confId the conformer to use
920  \param replaceExistingTags if this flag is true, any existing info about
921  stereochemistry will be replaced
922 */
924  ROMol &mol, int confId = -1, bool replaceExistingTags = true);
925 
926 //! \deprecated: this function will be removed in a future release. Use
927 //! setDoubleBondNeighborDirections() instead
929  int confId = -1);
930 //! Sets bond directions based on double bond stereochemistry
932  ROMol &mol, const Conformer *conf = nullptr);
933 
934 //! Assign CIS/TRANS bond stereochemistry tags based on neighboring directions
936 
937 //! Assign stereochemistry tags to atoms (i.e. R/S) and bonds (i.e. Z/E)
938 /*!
939  Does the CIP stereochemistry assignment for the molecule's atoms
940  (R/S) and double bond (Z/E). Chiral atoms will have a property
941  '_CIPCode' indicating their chiral code.
942 
943  \param mol the molecule to use
944  \param cleanIt if true, any existing values of the property `_CIPCode`
945  will be cleared, atoms with a chiral specifier that aren't
946  actually chiral (e.g. atoms with duplicate
947  substituents or only 2 substituents, etc.) will have
948  their chiral code set to CHI_UNSPECIFIED. Bonds with
949  STEREOCIS/STEREOTRANS specified that have duplicate
950  substituents based upon the CIP atom ranks will be
951  marked STEREONONE.
952  \param force causes the calculation to be repeated even if it has
953  already been done
954  \param flagPossibleStereoCenters set the _ChiralityPossible property on
955  atoms that are possible stereocenters
956 
957  <b>Notes:M</b>
958  - Throughout we assume that we're working with a hydrogen-suppressed
959  graph.
960 
961 */
963  ROMol &mol, bool cleanIt = false, bool force = false,
964  bool flagPossibleStereoCenters = false);
965 //! Removes all stereochemistry information from atoms (i.e. R/S) and bonds
966 //(i.e. Z/E)
967 /*!
968 
969  \param mol the molecule of interest
970 */
972 
973 //! \brief finds bonds that could be cis/trans in a molecule and mark them as
974 //! Bond::STEREOANY.
975 /*!
976  \param mol the molecule of interest
977  \param cleanIt toggles removal of stereo flags from double bonds that can
978  not have stereochemistry
979 
980  This function finds any double bonds that can potentially be part of
981  a cis/trans system. No attempt is made here to mark them cis or
982  trans. No attempt is made to detect double bond stereo in ring systems.
983 
984  This function is useful in the following situations:
985  - when parsing a mol file; for the bonds marked here, coordinate
986  information on the neighbors can be used to indentify cis or trans states
987  - when writing a mol file; bonds that can be cis/trans but not marked as
988  either need to be specially marked in the mol file
989  - finding double bonds with unspecified stereochemistry so they
990  can be enumerated for downstream 3D tools
991 
992  The CIPranks on the neighboring atoms are checked in this function. The
993  _CIPCode property if set to any on the double bond.
994 */
996  bool cleanIt = false);
997 //@}
998 
999 //! \brief Uses the molParity atom property to assign ChiralType to a molecule's
1000 //! atoms
1001 /*!
1002  \param mol the molecule of interest
1003  \param replaceExistingTags if this flag is true, any existing atomic chiral
1004  tags will be replaced
1005 */
1007  ROMol &mol, bool replaceExistingTags = true);
1008 
1009 //! returns the number of atoms which have a particular property set
1011  const ROMol &mol, std::string prop);
1012 
1013 }; // end of namespace MolOps
1014 }; // end of namespace RDKit
1015 
1016 #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:391
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:486
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:398
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:306
RDKit::MolOps::AdjustQueryParameters
Definition: MolOps.h:314
types.h
BoostStartInclude.h
RDKit::MolOps::AROMATICITY_CUSTOM
@ AROMATICITY_CUSTOM
use a function
Definition: MolOps.h:488
RDKit::MolOps::parseAdjustQueryParametersFromJSON
RDKIT_GRAPHMOL_EXPORT void parseAdjustQueryParametersFromJSON(MolOps::AdjustQueryParameters &p, const std::string &json)
updates an AdjustQueryParameters object from a JSON string
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:309
RDKit::MolOps::removeAllHs
RDKIT_GRAPHMOL_EXPORT void removeAllHs(RWMol &mol, bool sanitize=true)
removes all Hs from a molecule
RDKit::MolOps::SANITIZE_FINDRADICALS
@ SANITIZE_FINDRADICALS
Definition: MolOps.h:397
RDKit::MolOps::RemoveHsParameters
Definition: MolOps.h:235
RDKit::MolOps::ADJUST_IGNOREALL
@ ADJUST_IGNOREALL
Definition: MolOps.h:311
RDKit::MolOps::mergeQueryHs
RDKIT_GRAPHMOL_EXPORT ROMol * mergeQueryHs(const ROMol &mol, bool mergeUnmappedOnly=false)
RDKit::MolOps::SANITIZE_ADJUSTHS
@ SANITIZE_ADJUSTHS
Definition: MolOps.h:402
RDKit::MolOps::findRingFamilies
RDKIT_GRAPHMOL_EXPORT void findRingFamilies(const ROMol &mol)
RDKit::MolOps::SANITIZE_PROPERTIES
@ SANITIZE_PROPERTIES
Definition: MolOps.h:394
RDKit::Atom
The class for representing atoms.
Definition: Atom.h:69
RDKit::MolOps::SANITIZE_SYMMRINGS
@ SANITIZE_SYMMRINGS
Definition: MolOps.h:395
BoostEndInclude.h
RDKit::MolOps::ADJUST_IGNORERINGS
@ ADJUST_IGNORERINGS
Definition: MolOps.h:307
RDKit::MolOps::AROMATICITY_MDL
@ AROMATICITY_MDL
Definition: MolOps.h:487
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::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::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:304
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:285
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:399
RDKit::MolOps::SANITIZE_KEKULIZE
@ SANITIZE_KEKULIZE
Definition: MolOps.h:396
RDKit::Conformer
The class for representing 2D or 3D conformation of a molecule.
Definition: Conformer.h:44
RDKit::MolOps::SANITIZE_ALL
@ SANITIZE_ALL
Definition: MolOps.h:403
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::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::assignChiralTypesFromMolParity
RDKIT_GRAPHMOL_EXPORT void assignChiralTypesFromMolParity(ROMol &mol, bool replaceExistingTags=true)
Uses the molParity atom property to assign ChiralType to a molecule's atoms.
RDKit::MolOps::ADJUST_IGNORENONE
@ ADJUST_IGNORENONE
Definition: MolOps.h:305
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:400
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:401
RDKit::MolOps::AROMATICITY_RDKIT
@ AROMATICITY_RDKIT
Definition: MolOps.h:485
RDKit::MolOps::getShortestPath
RDKIT_GRAPHMOL_EXPORT std::list< int > getShortestPath(const ROMol &mol, int aid1, int aid2)
Find the shortest path between two atoms.
ci_LOCAL_INF
RDKIT_GRAPHMOL_EXPORT const int ci_LOCAL_INF
RDKit::MolOps::SANITIZE_CLEANUP
@ SANITIZE_CLEANUP
Definition: MolOps.h:393
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:347
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:483
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:484
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:308
RDKit::MolOps::setConjugation
RDKIT_GRAPHMOL_EXPORT void setConjugation(ROMol &mol)
flags the molecule's conjugated bonds
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:392
RDKit::MolOps::ADJUST_IGNOREMAPPED
@ ADJUST_IGNOREMAPPED
Definition: MolOps.h:310
export.h