RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
MolOps.h
Go to the documentation of this file.
1//
2// Copyright (C) 2001-2021 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
25RDKIT_GRAPHMOL_EXPORT extern const int ci_LOCAL_INF;
26namespace RDKit {
27class ROMol;
28class RWMol;
29class Atom;
30class Bond;
31class Conformer;
32typedef std::vector<double> INVAR_VECT;
33typedef INVAR_VECT::iterator INVAR_VECT_I;
34typedef INVAR_VECT::const_iterator INVAR_VECT_CI;
35
36//! \brief Groups a variety of molecular query and transformation operations.
37namespace 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*/
70RDKIT_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*/
104RDKIT_GRAPHMOL_EXPORT std::vector<boost::shared_ptr<ROMol>> getMolFrags(
105 const ROMol &mol, bool sanitizeFrags = true,
106 std::vector<int> *frags = nullptr,
107 std::vector<std::vector<int>> *fragsMolAtomMapping = nullptr,
108 bool copyConformers = true);
109
110//! splits a molecule into pieces based on labels assigned using a query
111/*!
112
113 \param mol the molecule of interest
114 \param query the query used to "label" the molecule for fragmentation
115 \param sanitizeFrags toggles sanitization of the fragments after
116 they are built
117 \param whiteList if provided, only labels in the list will be kept
118 \param negateList if true, the white list logic will be inverted: only labels
119 not in the list will be kept
120
121 \return a map of the fragments and their labels
122
123*/
124template <typename T>
125RDKIT_GRAPHMOL_EXPORT std::map<T, boost::shared_ptr<ROMol>>
126getMolFragsWithQuery(const ROMol &mol, T (*query)(const ROMol &, const Atom *),
127 bool sanitizeFrags = true,
128 const std::vector<T> *whiteList = nullptr,
129 bool negateList = false);
130
131#if 0
132 //! finds a molecule's minimum spanning tree (MST)
133 /*!
134 \param mol the molecule of interest
135 \param mst used to return the MST as a vector of bond indices
136 */
137 RDKIT_GRAPHMOL_EXPORT void findSpanningTree(const ROMol &mol,std::vector<int> &mst);
138#endif
139
140//! \name Dealing with hydrogens
141//{@
142
143//! returns a copy of a molecule with hydrogens added in as explicit Atoms
144/*!
145 \param mol the molecule to add Hs to
146 \param explicitOnly (optional) if this \c true, only explicit Hs will be
147 added
148 \param addCoords (optional) If this is true, estimates for the atomic
149 coordinates
150 of the added Hs will be used.
151 \param onlyOnAtoms (optional) if provided, this should be a vector of
152 IDs of the atoms that will be considered for H addition.
153 \param addResidueInfo (optional) if this is true, add residue info to
154 hydrogen atoms (useful for PDB files).
155
156 \return the new molecule
157
158 <b>Notes:</b>
159 - it makes no sense to use the \c addCoords option if the molecule's
160 heavy
161 atoms don't already have coordinates.
162 - the caller is responsible for <tt>delete</tt>ing the pointer this
163 returns.
164 */
166 bool addCoords = false,
167 const UINT_VECT *onlyOnAtoms = nullptr,
168 bool addResidueInfo = false);
169//! \overload
170/// modifies the molecule in place
172 bool addCoords = false,
173 const UINT_VECT *onlyOnAtoms = nullptr,
174 bool addResidueInfo = false);
175
176//! Sets Cartesian coordinates for a terminal atom.
177//! Useful for growing an atom off a molecule with sensible
178//! coordinates based on the geometry of the neighbor.
179/*!
180 NOTE: this sets appropriate coordinates in all of the molecule's conformers.
181 \param mol the molecule the atoms belong to
182 \param idx index of the terminal atom whose coordinates are set
183 \param otherIdx index of the bonded neighbor atom
184*/
185
187 unsigned int otherIdx);
188
189//! returns a copy of a molecule with hydrogens removed
190/*!
191 \param mol the molecule to remove Hs from
192 \param implicitOnly (optional) if this \c true, only implicit Hs will be
193 removed
194 \param updateExplicitCount (optional) If this is \c true, when explicit Hs
195 are removed
196 from the graph, the heavy atom to which they are bound will have its
197 counter of
198 explicit Hs increased.
199 \param sanitize: (optional) If this is \c true, the final molecule will be
200 sanitized
201
202 \return the new molecule
203
204 <b>Notes:</b>
205 - Hydrogens which aren't connected to a heavy atom will not be
206 removed. This prevents molecules like <tt>"[H][H]"</tt> from having
207 all atoms removed.
208 - Labelled hydrogen (e.g. atoms with atomic number=1, but mass > 1),
209 will not be removed.
210 - two coordinate Hs, like the central H in C[H-]C, will not be removed
211 - Hs connected to dummy atoms will not be removed
212 - Hs that are part of the definition of double bond Stereochemistry
213 will not be removed
214 - Hs that are not connected to anything else will not be removed
215 - Hs that have a query defined (i.e. hasQuery() returns true) will not
216 be removed
217
218 - the caller is responsible for <tt>delete</tt>ing the pointer this
219 returns.
220*/
221
223 bool implicitOnly = false,
224 bool updateExplicitCount = false,
225 bool sanitize = true);
226//! \overload
227/// modifies the molecule in place
229 bool updateExplicitCount = false,
230 bool sanitize = true);
232 bool removeDegreeZero = false; /**< hydrogens that have no bonds */
233 bool removeHigherDegrees = false; /**< hydrogens with two (or more) bonds */
234 bool removeOnlyHNeighbors =
235 false; /**< hydrogens with bonds only to other hydrogens */
236 bool removeIsotopes = false; /**< hydrogens with non-default isotopes */
237 bool removeAndTrackIsotopes = false; /**< removes hydrogens with non-default
238 isotopes and keeps track of the heavy atom the isotopes were attached to in
239 the private _isotopicHs atom property, so they are re-added by AddHs() as the
240 original isotopes if possible*/
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 = true; /**< part of a SubstanceGroup.
249 An H atom will only be removed if it doesn't cause any SGroup to become empty,
250 and if it doesn't play a special role in the SGroup (XBOND, attach point
251 or a CState) */
252 bool showWarnings = true; /**< display warnings for Hs that are not removed */
253 bool removeNonimplicit = true; /**< DEPRECATED equivalent of !implicitOnly */
254 bool updateExplicitCount =
255 false; /**< DEPRECATED equivalent of updateExplicitCount */
256 bool removeHydrides = true; /**< Removing Hydrides */
257 bool removeNontetrahedralNeighbors =
258 false; /**< remove Hs which are bonded to atoms with specified
259 non-tetrahedral stereochemistry */
260};
261//! \overload
262/// modifies the molecule in place
264 bool sanitize = true);
265//! \overload
266/// The caller owns the pointer this returns
268 const RemoveHsParameters &ps,
269 bool sanitize = true);
270
271//! removes all Hs from a molecule
272RDKIT_GRAPHMOL_EXPORT void removeAllHs(RWMol &mol, bool sanitize = true);
273//! \overload
274/// The caller owns the pointer this returns
276 bool sanitize = true);
277
278//! returns a copy of a molecule with hydrogens removed and added as queries
279//! to the heavy atoms to which they are bound.
280/*!
281 This is really intended to be used with molecules that contain QueryAtoms
282
283 \param mol the molecule to remove Hs from
284
285 \return the new molecule
286
287 <b>Notes:</b>
288 - Atoms that do not already have hydrogen count queries will have one
289 added, other H-related queries will not be touched. Examples:
290 - C[H] -> [C;!H0]
291 - [C;H1][H] -> [C;H1]
292 - [C;H2][H] -> [C;H2]
293 - Hydrogens which aren't connected to a heavy atom will not be
294 removed. This prevents molecules like <tt>"[H][H]"</tt> from having
295 all atoms removed.
296 - the caller is responsible for <tt>delete</tt>ing the pointer this
297 returns.
298 - By default all hydrogens are removed, however if
299 mergeUnmappedOnly is true, any hydrogen participating
300 in an atom map will be retained
301
302*/
304 bool mergeUnmappedOnly = false,
305 bool mergeIsotopes = false);
306//! \overload
307/// modifies the molecule in place
309 bool mergeUnmappedOnly = false,
310 bool mergeIsotopes = false);
311
312//! returns a pair of booleans (hasQueryHs, hasUnmergaebleQueryHs)
313/*!
314 This is really intended to be used with molecules that contain QueryAtoms
315 such as when checking smarts patterns for explicit hydrogens
316
317
318 \param mol the molecule to check for query Hs from
319 \return std::pair if pair.first is true if the molecule has query hydrogens,
320 if pair.second is true, the queryHs cannot be removed my mergeQueryHs
321*/
322RDKIT_GRAPHMOL_EXPORT std::pair<bool, bool> hasQueryHs(const ROMol &mol);
323
333
334//! Parameters controlling the behavior of MolOps::adjustQueryProperties
335/*!
336
337 Note that some of the options here are either directly contradictory or make
338 no sense when combined with each other. We generally assume that client code
339 is doing something sensible and don't attempt to detect possible conflicts or
340 problems.
341
342*/
344 bool adjustDegree = true; /**< add degree queries */
345 std::uint32_t adjustDegreeFlags = ADJUST_IGNOREDUMMIES | ADJUST_IGNORECHAINS;
346
347 bool adjustRingCount = false; /**< add ring-count queries */
348 std::uint32_t adjustRingCountFlags =
350
351 bool makeDummiesQueries = true; /**< convert dummy atoms without isotope
352 labels to any-atom queries */
353
354 bool aromatizeIfPossible = true; /**< perceive and set aromaticity */
355
356 bool makeBondsGeneric =
357 false; /**< convert bonds to generic queries (any bonds) */
358 std::uint32_t makeBondsGenericFlags = ADJUST_IGNORENONE;
359
360 bool makeAtomsGeneric =
361 false; /**< convert atoms to generic queries (any atoms) */
362 std::uint32_t makeAtomsGenericFlags = ADJUST_IGNORENONE;
363
364 bool adjustHeavyDegree = false; /**< adjust the heavy-atom degree instead of
365 overall degree */
366 std::uint32_t adjustHeavyDegreeFlags =
368
369 bool adjustRingChain = false; /**< add ring-chain queries */
370 std::uint32_t adjustRingChainFlags = ADJUST_IGNORENONE;
371
372 bool useStereoCareForBonds =
373 false; /**< remove stereochemistry info from double bonds that do not have
374 the stereoCare property set */
375
376 bool adjustConjugatedFiveRings =
377 false; /**< sets bond queries in conjugated five-rings to
378 SINGLE|DOUBLE|AROMATIC */
379
380 bool setMDLFiveRingAromaticity =
381 false; /**< uses the 5-ring aromaticity behavior of the (former) MDL
382 software as documented in the Chemical Representation Guide */
383
384 bool adjustSingleBondsToDegreeOneNeighbors =
385 false; /**< sets single bonds between aromatic or conjugated atoms and
386 degree one neighbors to SINGLE|AROMATIC */
387
388 bool adjustSingleBondsBetweenAromaticAtoms =
389 false; /**< sets non-ring single bonds between two aromatic or conjugated
390 atoms to SINGLE|AROMATIC */
391
392 //! \brief returns an AdjustQueryParameters object with all adjustments
393 //! disabled
396 res.adjustDegree = false;
397 res.makeDummiesQueries = false;
398 res.aromatizeIfPossible = false;
399 return res;
400 }
402};
403
404//! updates an AdjustQueryParameters object from a JSON string
406 MolOps::AdjustQueryParameters &p, const std::string &json);
407
408//! returns a copy of a molecule with query properties adjusted
409/*!
410 \param mol the molecule to adjust
411 \param params controls the adjustments made
412
413 \return the new molecule, the caller owns the memory
414*/
416 const ROMol &mol, const AdjustQueryParameters *params = nullptr);
417//! \overload
418/// modifies the molecule in place
420 RWMol &mol, const AdjustQueryParameters *params = nullptr);
421
422//! returns a copy of a molecule with the atoms renumbered
423/*!
424
425 \param mol the molecule to work with
426 \param newOrder the new ordering of the atoms (should be numAtoms long)
427 for example: if newOrder is [3,2,0,1], then atom 3 in the original
428 molecule will be atom 0 in the new one
429
430 \return the new molecule
431
432 <b>Notes:</b>
433 - the caller is responsible for <tt>delete</tt>ing the pointer this
434 returns.
435
436*/
438 const ROMol &mol, const std::vector<unsigned int> &newOrder);
439
440//! @}
441
442//! \name Sanitization
443/// {
444
460
461//! \brief carries out a collection of tasks for cleaning up a molecule and
462//! ensuring that it makes "chemical sense"
463/*!
464 This functions calls the following in sequence
465 -# MolOps::cleanUp()
466 -# mol.updatePropertyCache()
467 -# MolOps::symmetrizeSSSR()
468 -# MolOps::Kekulize()
469 -# MolOps::assignRadicals()
470 -# MolOps::setAromaticity()
471 -# MolOps::setConjugation()
472 -# MolOps::setHybridization()
473 -# MolOps::cleanupChirality()
474 -# MolOps::adjustHs()
475 -# mol.updatePropertyCache()
476
477 \param mol : the RWMol to be cleaned
478
479 \param operationThatFailed : the first (if any) sanitization operation that
480 fails is set here.
481 The values are taken from the \c SanitizeFlags
482 enum. On success, the value is \c
483 SanitizeFlags::SANITIZE_NONE
484
485 \param sanitizeOps : the bits here are used to set which sanitization
486 operations are carried out. The elements of the \c
487 SanitizeFlags enum define the operations.
488
489 <b>Notes:</b>
490 - If there is a failure in the sanitization, a \c MolSanitizeException
491 will be thrown.
492 - in general the user of this function should cast the molecule following
493 this function to a ROMol, so that new atoms and bonds cannot be added to
494 the molecule and screw up the sanitizing that has been done here
495*/
497 unsigned int &operationThatFailed,
498 unsigned int sanitizeOps = SANITIZE_ALL);
499//! \overload
501
502//! \brief Identifies chemistry problems (things that don't make chemical
503//! sense) in a molecule
504/*!
505 This functions uses the operations in sanitizeMol but does not change
506 the input structure and returns a list of the problems encountered instead
507 of stopping at the first failure,
508
509 The problems this looks for come from the sanitization operations:
510 -# mol.updatePropertyCache() : Unreasonable valences
511 -# MolOps::Kekulize() : Unkekulizable ring systems, aromatic atoms not
512 in rings, aromatic bonds to non-aromatic atoms.
513
514 \param mol : the ROMol to be cleaned
515
516 \param sanitizeOps : the bits here are used to set which sanitization
517 operations are carried out. The elements of the \c
518 SanitizeFlags enum define the operations.
519
520 \return a vector of \c MolSanitizeException values that indicate what
521 problems were encountered
522
523*/
525std::vector<std::unique_ptr<MolSanitizeException>> detectChemistryProblems(
526 const ROMol &mol, unsigned int sanitizeOps = SANITIZE_ALL);
527
528//! Possible aromaticity models
529/*!
530- \c AROMATICITY_DEFAULT at the moment always uses \c AROMATICITY_RDKIT
531- \c AROMATICITY_RDKIT is the standard RDKit model (as documented in the RDKit
532Book)
533- \c AROMATICITY_SIMPLE only considers 5- and 6-membered simple rings (it
534does not consider the outer envelope of fused rings)
535- \c AROMATICITY_MDL
536- \c AROMATICITY_CUSTOM uses a caller-provided function
537*/
538typedef enum {
539 AROMATICITY_DEFAULT = 0x0, ///< future proofing
543 AROMATICITY_CUSTOM = 0xFFFFFFF ///< use a function
545
546//! Sets up the aromaticity for a molecule
547/*!
548
549 This is what happens here:
550 -# find all the simple rings by calling the findSSSR function
551 -# loop over all the Atoms in each ring and mark them if they are
552 candidates
553 for aromaticity. A ring atom is a candidate if it can spare electrons
554 to the ring and if it's from the first two rows of the periodic table.
555 -# based on the candidate atoms, mark the rings to be either candidates
556 or non-candidates. A ring is a candidate only if all its atoms are
557 candidates
558 -# apply Hueckel rule to each of the candidate rings to check if the ring
559 can be
560 aromatic
561
562 \param mol the RWMol of interest
563 \param model the aromaticity model to use
564 \param func a custom function for assigning aromaticity (only used when
565 model=\c AROMATICITY_CUSTOM)
566
567 \return >0 on success, <= 0 otherwise
568
569 <b>Assumptions:</b>
570 - Kekulization has been done (i.e. \c MolOps::Kekulize() has already
571 been called)
572
573*/
576 int (*func)(RWMol &) = nullptr);
577
578//! Designed to be called by the sanitizer to handle special cases before
579/// anything is done.
580/*!
581
582 Currently this:
583 - modifies nitro groups, so that the nitrogen does not have an
584 unreasonable valence of 5, as follows:
585 - the nitrogen gets a positive charge
586 - one of the oxygens gets a negative chage and the double bond to
587 this oxygen is changed to a single bond The net result is that nitro groups
588 can be counted on to be: \c "[N+](=O)[O-]"
589 - modifies halogen-oxygen containing species as follows:
590 \c [Cl,Br,I](=O)(=O)(=O)O -> [X+3]([O-])([O-])([O-])O
591 \c [Cl,Br,I](=O)(=O)O -> [X+3]([O-])([O-])O
592 \c [Cl,Br,I](=O)O -> [X+]([O-])O
593 - converts the substructure [N,C]=P(=O)-* to [N,C]=[P+](-[O-])-*
594
595 \param mol the molecule of interest
596
597*/
599
600//! Designed to be called by the sanitizer to handle special cases for
601//! organometallic species before valence is perceived
602/*!
603
604 \b Note that this function is experimental and may either change in behavior
605 or be replaced with something else in future releases.
606
607 Currently this:
608 - replaces single bonds between "hypervalent" organic atoms and metals with
609 dative bonds (this is following an IUPAC recommendation:
610 https://iupac.qmul.ac.uk/tetrapyrrole/TP8.html)
611
612 \param mol the molecule of interest
613
614*/
616
617//! Called by the sanitizer to assign radical counts to atoms
619
620//! adjust the number of implicit and explicit Hs for special cases
621/*!
622
623 Currently this:
624 - modifies aromatic nitrogens so that, when appropriate, they have an
625 explicit H marked (e.g. so that we get things like \c "c1cc[nH]cc1"
626
627 \param mol the molecule of interest
628
629 <b>Assumptions</b>
630 - this is called after the molecule has been sanitized,
631 aromaticity has been perceived, and the implicit valence of
632 everything has been calculated.
633
634*/
636
637//! Kekulizes the molecule
638/*!
639
640 \param mol the molecule of interest
641
642 \param markAtomsBonds if this is set to true, \c isAromatic boolean
643 settings on both the Bonds and Atoms are turned to false following the
644 Kekulization, otherwise they are left alone in their original state.
645
646 \param maxBackTracks the maximum number of attempts at back-tracking. The
647 algorithm uses a back-tracking procedure to revisit a previous setting of
648 double bond if we hit a wall in the kekulization process
649
650 <b>Notes:</b>
651 - this does not modify query bonds which have bond type queries (like
652 those which come from SMARTS) or rings containing them.
653 - even if \c markAtomsBonds is \c false the \c BondType for all modified
654 aromatic bonds will be changed from \c RDKit::Bond::AROMATIC to \c
655 RDKit::Bond::SINGLE or RDKit::Bond::DOUBLE during Kekulization.
656
657*/
659 unsigned int maxBackTracks = 100);
660//! Kekulizes the molecule if possible. If the kekulization fails the molecule
661//! will not be modified
662/*!
663
664 \param mol the molecule of interest
665
666 \param markAtomsBonds if this is set to true, \c isAromatic boolean
667 settings on both the Bonds and Atoms are turned to false following the
668 Kekulization, otherwise they are left alone in their original state.
669
670 \param maxBackTracks the maximum number of attempts at back-tracking. The
671 algorithm uses a back-tracking procedure to revisit a previous setting of
672 double bond if we hit a wall in the kekulization process
673
674 \returns whether or not the kekulization succeeded
675
676 <b>Notes:</b>
677 - even if \c markAtomsBonds is \c false the \c BondType for all aromatic
678 bonds will be changed from \c RDKit::Bond::AROMATIC to \c
679 RDKit::Bond::SINGLE or RDKit::Bond::DOUBLE during Kekulization.
680
681*/
683 bool markAtomsBonds = true,
684 unsigned int maxBackTracks = 100);
685
686//! flags the molecule's conjugated bonds
688
689//! calculates and sets the hybridization of all a molecule's Stoms
691
692//! @}
693
694//! \name Ring finding and SSSR
695//! @{
696
697//! finds a molecule's Smallest Set of Smallest Rings
698/*!
699 Currently this implements a modified form of Figueras algorithm
700 (JCICS - Vol. 36, No. 5, 1996, 986-991)
701
702 \param mol the molecule of interest
703 \param res used to return the vector of rings. Each entry is a vector with
704 atom indices. This information is also stored in the molecule's
705 RingInfo structure, so this argument is optional (see overload)
706 \param includeDativeBonds - determines whether or not dative bonds are used in
707 the ring finding.
708
709 \return number of smallest rings found
710
711 Base algorithm:
712 - The original algorithm starts by finding representative degree 2
713 nodes.
714 - Representative because if a series of deg 2 nodes are found only
715 one of them is picked.
716 - The smallest ring around each of them is found.
717 - The bonds that connect to this degree 2 node are them chopped off,
718 yielding
719 new deg two nodes
720 - The process is repeated on the new deg 2 nodes.
721 - If no deg 2 nodes are found, a deg 3 node is picked. The smallest ring
722 with it is found. A bond from this is "carefully" (look in the paper)
723 selected and chopped, yielding deg 2 nodes. The process is same as
724 above once this is done.
725
726 Our Modifications:
727 - If available, more than one smallest ring around a representative deg 2
728 node will be computed and stored
729 - Typically 3 rings are found around a degree 3 node (when no deg 2s are
730 available)
731 and all the bond to that node are chopped.
732 - The extra rings that were found in this process are removed after all
733 the nodes have been covered.
734
735 These changes were motivated by several factors:
736 - We believe the original algorithm fails to find the correct SSSR
737 (finds the correct number of them but the wrong ones) on some sample
738 mols
739 - Since SSSR may not be unique, a post-SSSR step to symmetrize may be
740 done. The extra rings this process adds can be quite useful.
741*/
743 std::vector<std::vector<int>> &res,
744 bool includeDativeBonds = false);
745//! \overload
747 std::vector<std::vector<int>> *res = nullptr,
748 bool includeDativeBonds = false);
749
750//! use a DFS algorithm to identify ring bonds and atoms in a molecule
751/*!
752 \b NOTE: though the RingInfo structure is populated by this function,
753 the only really reliable calls that can be made are to check if
754 mol.getRingInfo().numAtomRings(idx) or mol.getRingInfo().numBondRings(idx)
755 return values >0
756*/
758
760
761//! symmetrize the molecule's Smallest Set of Smallest Rings
762/*!
763 SSSR rings obatined from "findSSSR" can be non-unique in some case.
764 For example, cubane has five SSSR rings, not six as one would hope.
765
766 This function adds additional rings to the SSSR list if necessary
767 to make the list symmetric, e.g. all atoms in cubane will be part of the
768 same number of SSSRs. This function choses these extra rings from the extra
769 rings computed and discarded during findSSSR. The new ring are chosen such
770 that:
771 - replacing a same sized ring in the SSSR list with an extra ring yields
772 the same union of bond IDs as the original SSSR list
773
774 \param mol - the molecule of interest
775 \param res used to return the vector of rings. Each entry is a vector with
776 atom indices. This information is also stored in the molecule's
777 RingInfo structure, so this argument is optional (see overload)
778 \param includeDativeBonds - determines whether or not dative bonds are used in
779 the ring finding.
780
781 \return the total number of rings = (new rings + old SSSRs)
782
783 <b>Notes:</b>
784 - if no SSSR rings are found on the molecule - MolOps::findSSSR() is called
785 first
786*/
788 std::vector<std::vector<int>> &res,
789 bool includeDativeBonds = false);
790//! \overload
792 bool includeDativeBonds = false);
793
794//! @}
795
796//! \name Shortest paths and other matrices
797//! @{
798
799//! returns a molecule's adjacency matrix
800/*!
801 \param mol the molecule of interest
802 \param useBO toggles use of bond orders in the matrix
803 \param emptyVal sets the empty value (for non-adjacent atoms)
804 \param force forces calculation of the matrix, even if already
805 computed
806 \param propNamePrefix used to set the cached property name
807
808 \return the adjacency matrix.
809
810 <b>Notes</b>
811 - The result of this is cached in the molecule's local property
812 dictionary, which will handle deallocation. The caller should <b>not</b> \c
813 delete this pointer.
814
815*/
817 const ROMol &mol, bool useBO = false, int emptyVal = 0, bool force = false,
818 const char *propNamePrefix = nullptr,
819 const boost::dynamic_bitset<> *bondsToUse = nullptr);
820
821//! Computes the molecule's topological distance matrix
822/*!
823 Uses the Floyd-Warshall all-pairs-shortest-paths algorithm.
824
825 \param mol the molecule of interest
826 \param useBO toggles use of bond orders in the matrix
827 \param useAtomWts sets the diagonal elements of the result to
828 6.0/(atomic number) so that the matrix can be used to calculate
829 Balaban J values. This does not affect the bond weights.
830 \param force forces calculation of the matrix, even if already
831 computed
832 \param propNamePrefix used to set the cached property name
833
834 \return the distance matrix.
835
836 <b>Notes</b>
837 - The result of this is cached in the molecule's local property
838 dictionary, which will handle deallocation. The caller should <b>not</b> \c
839 delete this pointer.
840
841
842*/
844 const ROMol &mol, bool useBO = false, bool useAtomWts = false,
845 bool force = false, const char *propNamePrefix = nullptr);
846
847//! Computes the molecule's topological distance matrix
848/*!
849 Uses the Floyd-Warshall all-pairs-shortest-paths algorithm.
850
851 \param mol the molecule of interest
852 \param activeAtoms only elements corresponding to these atom indices
853 will be included in the calculation
854 \param bonds only bonds found in this list will be included in the
855 calculation
856 \param useBO toggles use of bond orders in the matrix
857 \param useAtomWts sets the diagonal elements of the result to
858 6.0/(atomic number) so that the matrix can be used to calculate
859 Balaban J values. This does not affect the bond weights.
860
861 \return the distance matrix.
862
863 <b>Notes</b>
864 - The results of this call are not cached, the caller <b>should</b> \c
865 delete
866 this pointer.
867
868
869*/
871 const ROMol &mol, const std::vector<int> &activeAtoms,
872 const std::vector<const Bond *> &bonds, bool useBO = false,
873 bool useAtomWts = false);
874
875//! Computes the molecule's 3D distance matrix
876/*!
877
878 \param mol the molecule of interest
879 \param confId the conformer to use
880 \param useAtomWts sets the diagonal elements of the result to
881 6.0/(atomic number)
882 \param force forces calculation of the matrix, even if already
883 computed
884 \param propNamePrefix used to set the cached property name
885 (if set to an empty string, the matrix will not be
886 cached)
887
888 \return the distance matrix.
889
890 <b>Notes</b>
891 - If propNamePrefix is not empty the result of this is cached in the
892 molecule's local property dictionary, which will handle deallocation.
893 In other cases the caller is responsible for freeing the memory.
894
895*/
897 const ROMol &mol, int confId = -1, bool useAtomWts = false,
898 bool force = false, const char *propNamePrefix = nullptr);
899//! Find the shortest path between two atoms
900/*!
901 Uses the Bellman-Ford algorithm
902
903 \param mol molecule of interest
904 \param aid1 index of the first atom
905 \param aid2 index of the second atom
906
907 \return an std::list with the indices of the atoms along the shortest
908 path
909
910 <b>Notes:</b>
911 - the starting and end atoms are included in the path
912 - if no path is found, an empty path is returned
913
914*/
915RDKIT_GRAPHMOL_EXPORT std::list<int> getShortestPath(const ROMol &mol, int aid1,
916 int aid2);
917
918//! @}
919
920//! \name Stereochemistry
921//! @{
922
923//! removes bogus chirality markers (those on non-sp3 centers):
925
926//! \brief Uses a conformer to assign ChiralTypes to a molecule's atoms
927/*!
928 \param mol the molecule of interest
929 \param confId the conformer to use
930 \param replaceExistingTags if this flag is true, any existing atomic chiral
931 tags will be replaced
932
933 If the conformer provided is not a 3D conformer, nothing will be done.
934
935
936 NOTE that this does not check to see if atoms are chiral centers (i.e. all
937 substituents are different), it merely sets the chiral type flags based on
938 the coordinates and atom ordering. Use \c assignStereochemistryFrom3D() if
939 you want chiral flags only on actual stereocenters.
940*/
942 ROMol &mol, int confId = -1, bool replaceExistingTags = true);
943
944//! \brief Uses a conformer to assign ChiralTypes to a molecule's atoms and
945//! stereo flags to its bonds
946/*!
947
948 \param mol the molecule of interest
949 \param confId the conformer to use
950 \param replaceExistingTags if this flag is true, any existing info about
951 stereochemistry will be replaced
952
953 If the conformer provided is not a 3D conformer, nothing will be done.
954*/
956 ROMol &mol, int confId = -1, bool replaceExistingTags = true);
957
958//! \brief Use bond directions to assign ChiralTypes to a molecule's atoms and
959//! stereo flags to its bonds
960/*!
961
962 \param mol the molecule of interest
963 \param confId the conformer to use
964 \param replaceExistingTags if this flag is true, any existing info about
965 stereochemistry will be replaced
966*/
968 ROMol &mol, int confId = -1, bool replaceExistingTags = true);
969
970//! \deprecated: this function will be removed in a future release. Use
971//! setDoubleBondNeighborDirections() instead
973 int confId = -1);
974//! Sets bond directions based on double bond stereochemistry
976 ROMol &mol, const Conformer *conf = nullptr);
977//! removes directions from single bonds. Wiggly bonds will have the property
978//! _UnknownStereo set on them. If retainCisTransInfo is true,
979//! ENDUPRIGHT and ENDDOWNRIGHT bond directions will not be cleared
981 ROMol &mol, bool retainCisTransInfo = false);
982
983//! Assign CIS/TRANS bond stereochemistry tags based on neighboring
984//! directions
986
987//! Assign stereochemistry tags to atoms and bonds.
988/*!
989 If useLegacyStereoPerception is true, it also does the CIP stereochemistry
990 assignment for the molecule's atoms (R/S) and double bonds (Z/E).
991 This assignment is based on legacy code which is fast, but is
992 known to incorrectly assign CIP labels in some cases.
993 instead, to assign CIP labels based on an accurate, though slower,
994 implementation of the CIP rules, call CIPLabeler::assignCIPLabels().
995 Chiral atoms will have a property '_CIPCode' indicating their chiral code.
996
997 \param mol the molecule to use
998 \param cleanIt if true, any existing values of the property `_CIPCode`
999 will be cleared, atoms with a chiral specifier that aren't
1000 actually chiral (e.g. atoms with duplicate
1001 substituents or only 2 substituents, etc.) will have
1002 their chiral code set to CHI_UNSPECIFIED. Bonds with
1003 STEREOCIS/STEREOTRANS specified that have duplicate
1004 substituents based upon the CIP atom ranks will be
1005 marked STEREONONE.
1006 \param force causes the calculation to be repeated even if it has
1007 already been done
1008 \param flagPossibleStereoCenters set the _ChiralityPossible property on
1009 atoms that are possible stereocenters
1010
1011 <b>Notes:M</b>
1012 - Throughout we assume that we're working with a hydrogen-suppressed
1013 graph.
1014
1015*/
1017 ROMol &mol, bool cleanIt = false, bool force = false,
1018 bool flagPossibleStereoCenters = false);
1019//! Removes all stereochemistry information from atoms (i.e. R/S) and bonds
1020/// i.e. Z/E)
1021/*!
1022
1023 \param mol the molecule of interest
1024*/
1026
1027//! \brief finds bonds that could be cis/trans in a molecule and mark them as
1028//! Bond::STEREOANY.
1029/*!
1030 \param mol the molecule of interest
1031 \param cleanIt toggles removal of stereo flags from double bonds that can
1032 not have stereochemistry
1033
1034 This function finds any double bonds that can potentially be part of
1035 a cis/trans system. No attempt is made here to mark them cis or
1036 trans. No attempt is made to detect double bond stereo in ring systems.
1037
1038 This function is useful in the following situations:
1039 - when parsing a mol file; for the bonds marked here, coordinate
1040 information on the neighbors can be used to indentify cis or trans
1041 states
1042 - when writing a mol file; bonds that can be cis/trans but not marked as
1043 either need to be specially marked in the mol file
1044 - finding double bonds with unspecified stereochemistry so they
1045 can be enumerated for downstream 3D tools
1046
1047 The CIPranks on the neighboring atoms are checked in this function. The
1048 _CIPCode property if set to any on the double bond.
1049*/
1051 bool cleanIt = false);
1052//! \brief Uses the molParity atom property to assign ChiralType to a
1053//! molecule's atoms
1054/*!
1055 \param mol the molecule of interest
1056 \param replaceExistingTags if this flag is true, any existing atomic chiral
1057 tags will be replaced
1058*/
1060 ROMol &mol, bool replaceExistingTags = true);
1061
1062//! @}
1063
1064//! returns the number of atoms which have a particular property set
1066 const ROMol &mol, std::string prop);
1067
1068//! returns whether or not a molecule needs to have Hs added to it.
1070
1071//! \brief Replaces haptic bond with explicit dative bonds.
1072/*!
1073 *
1074 * @param mol the molecule of interest
1075 *
1076 * One way of showing haptic bonds (such as cyclopentadiene to iron in
1077 * ferrocene) is to use a dummy atom with a dative bond to the iron atom with
1078 * the bond labelled with the atoms involved in the organic end of the bond.
1079 * Another way is to have explicit dative bonds from the atoms of the haptic
1080 * group to the metal atom. This function converts the former representation to
1081 * the latter.
1082 */
1084
1085//! \overload modifies molecule in place.
1087
1088//! \brief Replaces explicit dative bonds with haptic.
1089/*!
1090 *
1091 * @param mol the molecule of interest
1092 *
1093 * Does the reverse of hapticBondsToDative. If there are multiple contiguous
1094 * atoms attached by dative bonds to an atom (probably a metal atom), the dative
1095 * bonds will be replaced by a dummy atom in their centre attached to the
1096 * (metal) atom by a dative bond, which is labelled with ENDPTS of the atoms
1097 * that had the original dative bonds.
1098 */
1100
1101//! \overload modifies molecule in place.
1103
1104namespace details {
1105//! not recommended for use in other code
1107 RWMol &mol, const boost::dynamic_bitset<> &atomsToUse,
1108 boost::dynamic_bitset<> bondsToUse, bool markAtomsBonds = true,
1109 unsigned int maxBackTracks = 100);
1110
1111// If the bond is dative, and it has a common_properties::MolFileBondEndPts
1112// prop, returns a vector of the indices of the atoms mentioned in the prop.
1113RDKIT_GRAPHMOL_EXPORT std::vector<int> hapticBondEndpoints(const Bond *bond);
1114
1115} // namespace details
1116
1117} // namespace MolOps
1118} // namespace RDKit
1119
1120#endif
RDKIT_GRAPHMOL_EXPORT const int ci_LOCAL_INF
The class for representing atoms.
Definition Atom.h:75
class for representing a bond
Definition Bond.h:47
The class for representing 2D or 3D conformation of a molecule.
Definition Conformer.h:46
RWMol is a molecule class that is intended to be edited.
Definition RWMol.h:32
#define RDKIT_GRAPHMOL_EXPORT
Definition export.h:233
RDKIT_GRAPHMOL_EXPORT void KekulizeFragment(RWMol &mol, const boost::dynamic_bitset<> &atomsToUse, boost::dynamic_bitset<> bondsToUse, bool markAtomsBonds=true, unsigned int maxBackTracks=100)
not recommended for use in other code
RDKIT_GRAPHMOL_EXPORT std::vector< int > hapticBondEndpoints(const Bond *bond)
RDKIT_GRAPHMOL_EXPORT void cleanUp(RWMol &mol)
RDKIT_GRAPHMOL_EXPORT void assignStereochemistry(ROMol &mol, bool cleanIt=false, bool force=false, bool flagPossibleStereoCenters=false)
Assign stereochemistry tags to atoms and bonds.
RDKIT_GRAPHMOL_EXPORT bool KekulizeIfPossible(RWMol &mol, bool markAtomsBonds=true, unsigned int maxBackTracks=100)
RDKIT_GRAPHMOL_EXPORT int findSSSR(const ROMol &mol, std::vector< std::vector< int > > &res, bool includeDativeBonds=false)
finds a molecule's Smallest Set of Smallest Rings
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_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_GRAPHMOL_EXPORT int setAromaticity(RWMol &mol, AromaticityModel model=AROMATICITY_DEFAULT, int(*func)(RWMol &)=nullptr)
Sets up the aromaticity for a molecule.
RDKIT_GRAPHMOL_EXPORT void findRingFamilies(const ROMol &mol)
RDKIT_GRAPHMOL_EXPORT bool needsHs(const ROMol &mol)
returns whether or not a molecule needs to have Hs added to it.
RDKIT_GRAPHMOL_EXPORT void fastFindRings(const ROMol &mol)
use a DFS algorithm to identify ring bonds and atoms in a molecule
RDKIT_GRAPHMOL_EXPORT std::pair< bool, bool > hasQueryHs(const ROMol &mol)
returns a pair of booleans (hasQueryHs, hasUnmergaebleQueryHs)
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=nullptr, bool negateList=false)
splits a molecule into pieces based on labels assigned using a query
RDKIT_GRAPHMOL_EXPORT int getFormalCharge(const ROMol &mol)
sums up all atomic formal charges and returns the result
AromaticityModel
Possible aromaticity models.
Definition MolOps.h:538
@ AROMATICITY_RDKIT
Definition MolOps.h:540
@ AROMATICITY_MDL
Definition MolOps.h:542
@ AROMATICITY_CUSTOM
use a function
Definition MolOps.h:543
@ AROMATICITY_DEFAULT
future proofing
Definition MolOps.h:539
@ AROMATICITY_SIMPLE
Definition MolOps.h:541
RDKIT_GRAPHMOL_EXPORT void cleanUpOrganometallics(RWMol &mol)
RDKIT_GRAPHMOL_EXPORT double * getDistanceMat(const ROMol &mol, bool useBO=false, bool useAtomWts=false, bool force=false, const char *propNamePrefix=nullptr)
Computes the molecule's topological distance matrix.
RDKIT_GRAPHMOL_EXPORT ROMol * hapticBondsToDative(const ROMol &mol)
Replaces haptic bond with explicit dative bonds.
RDKIT_GRAPHMOL_EXPORT void setTerminalAtomCoords(ROMol &mol, unsigned int idx, unsigned int otherIdx)
RDKIT_GRAPHMOL_EXPORT void removeStereochemistry(ROMol &mol)
RDKIT_GRAPHMOL_EXPORT ROMol * adjustQueryProperties(const ROMol &mol, const AdjustQueryParameters *params=nullptr)
returns a copy of a molecule with query properties adjusted
RDKIT_GRAPHMOL_EXPORT void assignChiralTypesFromMolParity(ROMol &mol, bool replaceExistingTags=true)
Uses the molParity atom property to assign ChiralType to a molecule's atoms.
RDKIT_GRAPHMOL_EXPORT ROMol * mergeQueryHs(const ROMol &mol, bool mergeUnmappedOnly=false, bool mergeIsotopes=false)
RDKIT_GRAPHMOL_EXPORT unsigned int getMolFrags(const ROMol &mol, std::vector< int > &mapping)
find fragments (disconnected components of the molecular graph)
RDKIT_GRAPHMOL_EXPORT void adjustHs(RWMol &mol)
adjust the number of implicit and explicit Hs for special cases
RDKIT_GRAPHMOL_EXPORT ROMol * dativeBondsToHaptic(const ROMol &mol)
Replaces explicit dative bonds with haptic.
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.
@ SANITIZE_SETAROMATICITY
Definition MolOps.h:452
@ SANITIZE_PROPERTIES
Definition MolOps.h:448
@ SANITIZE_CLEANUP_ORGANOMETALLICS
Definition MolOps.h:457
@ SANITIZE_SETCONJUGATION
Definition MolOps.h:453
@ SANITIZE_SYMMRINGS
Definition MolOps.h:449
@ SANITIZE_ADJUSTHS
Definition MolOps.h:456
@ SANITIZE_CLEANUPCHIRALITY
Definition MolOps.h:455
@ SANITIZE_FINDRADICALS
Definition MolOps.h:451
@ SANITIZE_KEKULIZE
Definition MolOps.h:450
@ SANITIZE_SETHYBRIDIZATION
Definition MolOps.h:454
@ SANITIZE_CLEANUP
Definition MolOps.h:447
RDKIT_GRAPHMOL_EXPORT int countAtomElec(const Atom *at)
RDKIT_GRAPHMOL_EXPORT void detectBondStereochemistry(ROMol &mol, int confId=-1)
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 ensuring that it makes "chemical sen...
RDKIT_GRAPHMOL_EXPORT void parseAdjustQueryParametersFromJSON(MolOps::AdjustQueryParameters &p, const std::string &json)
updates an AdjustQueryParameters object from a JSON string
RDKIT_GRAPHMOL_EXPORT void removeAllHs(RWMol &mol, bool sanitize=true)
removes all Hs from a molecule
RDKIT_GRAPHMOL_EXPORT void setBondStereoFromDirections(ROMol &mol)
RDKIT_GRAPHMOL_EXPORT double * get3DDistanceMat(const ROMol &mol, int confId=-1, bool useAtomWts=false, bool force=false, const char *propNamePrefix=nullptr)
Computes the molecule's 3D distance matrix.
RDKIT_GRAPHMOL_EXPORT bool atomHasConjugatedBond(const Atom *at)
returns whether or not the given Atom is involved in a conjugated bond
RDKIT_GRAPHMOL_EXPORT int symmetrizeSSSR(ROMol &mol, std::vector< std::vector< int > > &res, bool includeDativeBonds=false)
symmetrize the molecule's Smallest Set of Smallest Rings
RDKIT_GRAPHMOL_EXPORT void cleanupChirality(RWMol &mol)
removes bogus chirality markers (those on non-sp3 centers):
RDKIT_GRAPHMOL_EXPORT double * getAdjacencyMatrix(const ROMol &mol, bool useBO=false, int emptyVal=0, bool force=false, const char *propNamePrefix=nullptr, const boost::dynamic_bitset<> *bondsToUse=nullptr)
returns a molecule's adjacency matrix
RDKIT_GRAPHMOL_EXPORT void Kekulize(RWMol &mol, bool markAtomsBonds=true, unsigned int maxBackTracks=100)
Kekulizes the molecule.
RDKIT_GRAPHMOL_EXPORT void assignRadicals(RWMol &mol)
Called by the sanitizer to assign radical counts to atoms.
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_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_GRAPHMOL_EXPORT void clearSingleBondDirFlags(ROMol &mol, bool retainCisTransInfo=false)
RDKIT_GRAPHMOL_EXPORT void setHybridization(ROMol &mol)
calculates and sets the hybridization of all a molecule's Stoms
RDKIT_GRAPHMOL_EXPORT unsigned getNumAtomsWithDistinctProperty(const ROMol &mol, std::string prop)
returns the number of atoms which have a particular property set
RDKIT_GRAPHMOL_EXPORT void assignChiralTypesFrom3D(ROMol &mol, int confId=-1, bool replaceExistingTags=true)
Uses a conformer to assign ChiralTypes to a molecule's atoms.
RDKIT_GRAPHMOL_EXPORT std::list< int > getShortestPath(const ROMol &mol, int aid1, int aid2)
Find the shortest path between two atoms.
RDKIT_GRAPHMOL_EXPORT void setConjugation(ROMol &mol)
flags the molecule's conjugated bonds
RDKIT_GRAPHMOL_EXPORT void setDoubleBondNeighborDirections(ROMol &mol, const Conformer *conf=nullptr)
Sets bond directions based on double bond stereochemistry.
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_GRAPHMOL_EXPORT ROMol * addHs(const ROMol &mol, bool explicitOnly=false, bool addCoords=false, const UINT_VECT *onlyOnAtoms=nullptr, bool addResidueInfo=false)
returns a copy of a molecule with hydrogens added in as explicit Atoms
AdjustQueryWhichFlags
Definition MolOps.h:324
@ ADJUST_IGNORERINGS
Definition MolOps.h:327
@ ADJUST_IGNORENONE
Definition MolOps.h:325
@ ADJUST_IGNOREMAPPED
Definition MolOps.h:330
@ ADJUST_IGNORENONDUMMIES
Definition MolOps.h:329
@ ADJUST_IGNOREDUMMIES
Definition MolOps.h:328
@ ADJUST_IGNORECHAINS
Definition MolOps.h:326
@ ADJUST_IGNOREALL
Definition MolOps.h:331
Std stuff.
std::vector< double > INVAR_VECT
Definition MolOps.h:32
bool rdvalue_is(const RDValue_cast_t)
INVAR_VECT::iterator INVAR_VECT_I
Definition MolOps.h:33
INVAR_VECT::const_iterator INVAR_VECT_CI
Definition MolOps.h:34
std::vector< UINT > UINT_VECT
Definition types.h:300
Parameters controlling the behavior of MolOps::adjustQueryProperties.
Definition MolOps.h:343
static AdjustQueryParameters noAdjustments()
returns an AdjustQueryParameters object with all adjustments disabled
Definition MolOps.h:394