18#include <boost/smart_ptr.hpp>
19#include <boost/dynamic_bitset.hpp>
72 std::vector<int> &mapping);
85 const ROMol &mol, std::vector<std::vector<int>> &frags);
108 const ROMol &mol, std::vector<std::unique_ptr<ROMol>> &molFrags,
109 bool sanitizeFrags =
true, std::vector<int> *frags =
nullptr,
110 std::vector<std::vector<int>> *fragsMolAtomMapping =
nullptr,
111 bool copyConformers =
true);
132 const ROMol &mol,
bool sanitizeFrags =
true,
133 std::vector<int> *frags =
nullptr,
134 std::vector<std::vector<int>> *fragsMolAtomMapping =
nullptr,
135 bool copyConformers =
true);
155 bool sanitizeFrags =
true,
156 const std::vector<T> *whiteList =
nullptr,
157 bool negateList =
false);
178 std::map<T, std::unique_ptr<ROMol>> &molFrags,
bool sanitizeFrags =
true,
179 const std::vector<T> *whiteList =
nullptr,
bool negateList =
false);
229 bool addCoords =
false,
231 bool addResidueInfo =
false) {
233 std::unique_ptr<RWMol> res{
new RWMol(mol)};
234 addHs(*res, ps, onlyOnAtoms);
235 return static_cast<ROMol *
>(res.release());
239inline void addHs(
RWMol &mol,
bool explicitOnly =
false,
bool addCoords =
false,
241 bool addResidueInfo =
false) {
243 addHs(mol, ps, onlyOnAtoms);
259 unsigned int otherIdx);
295 bool updateExplicitCount =
false,
bool sanitize =
true);
301 bool sanitize =
true);
337 bool sanitize =
true);
342 bool sanitize =
true);
349 bool sanitize =
true);
377 bool mergeUnmappedOnly =
false,
378 bool mergeIsotopes =
false);
382 bool mergeUnmappedOnly =
false,
383 bool mergeIsotopes =
false);
512 const ROMol &mol,
const std::vector<unsigned int> &newOrder);
522 SANITIZE_CLEANUP = 0x1,
523 SANITIZE_PROPERTIES = 0x2,
524 SANITIZE_SYMMRINGS = 0x4,
525 SANITIZE_KEKULIZE = 0x8,
526 SANITIZE_FINDRADICALS = 0x10,
527 SANITIZE_SETAROMATICITY = 0x20,
528 SANITIZE_SETCONJUGATION = 0x40,
529 SANITIZE_SETHYBRIDIZATION = 0x80,
530 SANITIZE_CLEANUPCHIRALITY = 0x100,
531 SANITIZE_ADJUSTHS = 0x200,
532 SANITIZE_CLEANUP_ORGANOMETALLICS = 0x400,
533 SANITIZE_CLEANUPATROPISOMERS = 0x800,
534 SANITIZE_ALL = 0xFFFFFFF
574 RWMol &mol,
unsigned int &operationThatFailed,
575 unsigned int sanitizeOps = SanitizeFlags::SANITIZE_ALL);
603 const ROMol &mol,
unsigned int sanitizeOps = SanitizeFlags::SANITIZE_ALL);
658 int (*func)(
RWMol &) =
nullptr);
741 unsigned int maxBackTracks = 100);
765 bool markAtomsBonds =
true,
766 unsigned int maxBackTracks = 100);
827 std::vector<std::vector<int>> &res,
828 bool includeDativeBonds =
false,
829 bool includeHydrogenBonds =
false);
832 std::vector<std::vector<int>> *res =
nullptr,
833 bool includeDativeBonds =
false,
834 bool includeHydrogenBonds =
false);
846 bool includeDativeBonds =
false,
847 bool includeHydrogenBonds =
false);
878 std::vector<std::vector<int>> &res,
879 bool includeDativeBonds =
false,
880 bool includeHydrogenBonds =
false);
883 bool includeDativeBonds =
false,
884 bool includeHydrogenBonds =
false);
910 const ROMol &mol,
bool useBO =
false,
int emptyVal = 0,
bool force =
false,
911 const char *propNamePrefix =
nullptr,
912 const boost::dynamic_bitset<> *bondsToUse =
nullptr);
937 const ROMol &mol,
bool useBO =
false,
bool useAtomWts =
false,
938 bool force =
false,
const char *propNamePrefix =
nullptr);
964 const ROMol &mol,
const std::vector<int> &activeAtoms,
965 const std::vector<const Bond *> &bonds,
bool useBO =
false,
966 bool useAtomWts =
false);
990 const ROMol &mol,
int confId = -1,
bool useAtomWts =
false,
991 bool force =
false,
const char *propNamePrefix =
nullptr);
1041 unsigned int size()
const {
return d_hybridizations.size(); }
1044 std::vector<int> d_hybridizations;
1074 ROMol &mol,
int confId = -1,
bool replaceExistingTags =
true);
1088 ROMol &mol,
int confId = -1,
bool replaceExistingTags =
true);
1099 ROMol &mol,
int confId = -1,
bool replaceExistingTags =
true);
1111 bool onlyWedgeFlags =
false);
1119 bool onlyWedgeFlags =
false);
1155 ROMol &mol,
bool cleanIt =
false,
bool force =
false,
1156 bool flagPossibleStereoCenters =
false);
1189 bool cleanIt =
false);
1198 ROMol &mol,
bool replaceExistingTags =
true);
1204 const ROMol &mol, std::string prop);
1252 bool onlyHeavy =
false);
1263 bool onlyHeavy =
false);
1278 const ROMol &mol,
bool separateIsotopes =
false,
1279 bool abbreviateHIsotopes =
true);
1284 RWMol &mol,
const boost::dynamic_bitset<> &atomsToUse,
1285 boost::dynamic_bitset<> bondsToUse,
bool markAtomsBonds =
true,
1286 unsigned int maxBackTracks = 100);
1306 bool addAsQueries =
true,
1307 bool addCoords =
true);
1323 bool markedOnly =
true);
1341 RWMol &mol,
unsigned int atomIdx,
unsigned int val,
bool addAsQuery =
true,
1342 bool addCoords =
true);
1358 bool markedOnly =
true);
#define BETTER_ENUM(Enum, Underlying,...)
RDKIT_GRAPHMOL_EXPORT const int ci_LOCAL_INF
The class for representing atoms.
HybridizationType
store hybridization
class for representing a bond
used by various file parsing classes to indicate a parse error
unsigned int size() const
Atom::HybridizationType operator[](int idx)
~Hybridizations()=default
Hybridizations(const Hybridizations &)
Hybridizations(const ROMol &mol)
RWMol is a molecule class that is intended to be edited.
#define RDKIT_GRAPHMOL_EXPORT
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 bool isAttachmentPoint(const Atom *atom, bool markedOnly=true)
returns whether or not an atom is an attachment point
RDKIT_GRAPHMOL_EXPORT unsigned int addExplicitAttachmentPoint(RWMol &mol, unsigned int atomIdx, unsigned int val, bool addAsQuery=true, bool addCoords=true)
Groups a variety of molecular query and transformation operations.
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 void findRingFamilies(const ROMol &mol, bool includeDativeBonds=false, bool includeHydrogenBonds=false)
RDKIT_GRAPHMOL_EXPORT bool KekulizeIfPossible(RWMol &mol, bool markAtomsBonds=true, unsigned int maxBackTracks=100)
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 std::string getMolFormula(const ROMol &mol, bool separateIsotopes=false, bool abbreviateHIsotopes=true)
RDKIT_GRAPHMOL_EXPORT void cleanupAtropisomers(RWMol &mol, Hybridizations &hybridizations)
RDKIT_GRAPHMOL_EXPORT void assignChiralTypesFromBondDirs(ROMol &mol, int confId=-1, bool replaceExistingTags=true)
Use bond directions to assign ChiralTypes to a molecule's atoms.
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 sanitizeMol(RWMol &mol, unsigned int &operationThatFailed, unsigned int sanitizeOps=SanitizeFlags::SANITIZE_ALL)
carries out a collection of tasks for cleaning up a molecule and ensuring that it makes "chemical sen...
RDKIT_GRAPHMOL_EXPORT double getExactMolWt(const ROMol &mol, bool onlyHeavy=false)
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.
@ AROMATICITY_CUSTOM
use a function
@ AROMATICITY_DEFAULT
future proofing
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 void clearSingleBondDirFlags(ROMol &mol, bool onlyWedgeFlags=false)
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 void expandAttachmentPoints(RWMol &mol, bool addAsQueries=true, bool addCoords=true)
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.
RDKIT_GRAPHMOL_EXPORT int countAtomElec(const Atom *at)
RDKIT_GRAPHMOL_EXPORT void detectBondStereochemistry(ROMol &mol, int confId=-1)
RDKIT_GRAPHMOL_EXPORT void setMMFFAromaticity(RWMol &mol)
sets the aromaticity model for a molecule to MMFF94
RDKIT_GRAPHMOL_EXPORT ROMol * removeHs(const ROMol &mol, bool implicitOnly, bool updateExplicitCount=false, bool sanitize=true)
returns a copy of a molecule with hydrogens removed
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 clearAllBondDirFlags(ROMol &mol)
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 std::vector< std::unique_ptr< MolSanitizeException > > detectChemistryProblems(const ROMol &mol, unsigned int sanitizeOps=SanitizeFlags::SANITIZE_ALL)
Identifies chemistry problems (things that don't make chemical sense) in a molecule.
RDKIT_GRAPHMOL_EXPORT void clearDirFlags(ROMol &mol, bool onlyWedgeFlags=false)
RDKIT_GRAPHMOL_EXPORT int symmetrizeSSSR(ROMol &mol, std::vector< std::vector< int > > &res, bool includeDativeBonds=false, bool includeHydrogenBonds=false)
symmetrize the molecule's Smallest Set of Smallest Rings
RDKIT_GRAPHMOL_EXPORT void cleanupChirality(RWMol &mol)
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 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 addHs(RWMol &mol, const AddHsParameters ¶ms, const UINT_VECT *onlyOnAtoms=nullptr)
adds Hs to a molecule as explicit Atoms
RDKIT_GRAPHMOL_EXPORT void setHybridization(ROMol &mol)
calculates and sets the hybridization of all a molecule's Stoms
RDKIT_GRAPHMOL_EXPORT int findSSSR(const ROMol &mol, std::vector< std::vector< int > > &res, bool includeDativeBonds=false, bool includeHydrogenBonds=false)
finds a molecule's Smallest Set of Smallest Rings
RDKIT_GRAPHMOL_EXPORT void collapseAttachmentPoints(RWMol &mol, bool markedOnly=true)
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 double getAvgMolWt(const ROMol &mol, bool onlyHeavy=false)
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.
@ ADJUST_IGNORENONDUMMIES
std::vector< double > INVAR_VECT
INVAR_VECT::iterator INVAR_VECT_I
INVAR_VECT::const_iterator INVAR_VECT_CI
std::vector< UINT > UINT_VECT
Parameters controlling the behavior of MolOps::adjustQueryProperties.
bool adjustSingleBondsBetweenAromaticAtoms
static AdjustQueryParameters noAdjustments()
returns an AdjustQueryParameters object with all adjustments disabled
std::uint32_t makeAtomsGenericFlags
std::uint32_t adjustHeavyDegreeFlags
bool useStereoCareForBonds
std::uint32_t adjustDegreeFlags
bool setMDLFiveRingAromaticity
std::uint32_t adjustRingCountFlags
bool adjustSingleBondsToDegreeOneNeighbors
std::uint32_t adjustRingChainFlags
std::uint32_t makeBondsGenericFlags
bool adjustConjugatedFiveRings
bool removeDefiningBondStereo
bool removeWithWedgedBond
bool removeDummyNeighbors
bool removeNontetrahedralNeighbors
bool removeAndTrackIsotopes
bool removeOnlyHNeighbors