18#include <boost/smart_ptr.hpp>
19#include <boost/dynamic_bitset.hpp>
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,
133 std::vector<int> *frags =
nullptr,
156 const std::vector<T> *
whiteList =
nullptr,
194 bool explicitOnly =
false;
195 bool addCoords =
false;
196 bool addResidueInfo =
false;
238 bool addCoords =
false,
240 bool addResidueInfo =
false) {
242 std::unique_ptr<RWMol>
res{
new RWMol(mol)};
244 return static_cast<ROMol *
>(
res.release());
248inline void addHs(
RWMol &mol,
bool explicitOnly =
false,
bool addCoords =
false,
250 bool addResidueInfo =
false) {
300[[deprecated(
"Please use the version with RemoveHsParameters")]]
302 bool updateExplicitCount =
false,
303 bool sanitize =
true);
306[[deprecated(
"Please use the version with RemoveHsParameters")]]
308 bool updateExplicitCount =
false,
309 bool sanitize =
true);
311 bool removeDegreeZero =
false;
312 bool removeHigherDegrees =
false;
313 bool removeOnlyHNeighbors =
315 bool removeIsotopes =
false;
316 bool removeAndTrackIsotopes =
false;
320 bool removeDummyNeighbors =
322 bool removeDefiningBondStereo =
324 bool removeWithWedgedBond =
true;
325 bool removeWithQuery =
false;
326 bool removeMapped =
true;
327 bool removeInSGroups =
true;
331 bool showWarnings =
true;
332 bool removeNonimplicit =
true;
333 bool updateExplicitCount =
335 bool removeHydrides =
true;
336 bool removeNontetrahedralNeighbors =
345 bool sanitize =
true);
350 bool sanitize =
true);
357 bool sanitize =
true);
426 bool adjustDegree =
true;
429 bool adjustRingCount =
false;
430 std::uint32_t adjustRingCountFlags =
433 bool makeDummiesQueries =
true;
436 bool aromatizeIfPossible =
true;
438 bool makeBondsGeneric =
442 bool makeAtomsGeneric =
446 bool adjustHeavyDegree =
false;
448 std::uint32_t adjustHeavyDegreeFlags =
451 bool adjustRingChain =
false;
454 bool useStereoCareForBonds =
458 bool adjustConjugatedFiveRings =
462 bool setMDLFiveRingAromaticity =
466 bool adjustSingleBondsToDegreeOneNeighbors =
470 bool adjustSingleBondsBetweenAromaticAtoms =
520 const ROMol &mol,
const std::vector<unsigned int> &
newOrder);
542 SANITIZE_ALL = 0xFFFFFFF
583 unsigned int sanitizeOps = SanitizeFlags::SANITIZE_ALL);
666 int (*func)(
RWMol &) =
nullptr);
833 std::vector<std::vector<int>> &
res,
834 bool includeDativeBonds =
false);
837 std::vector<std::vector<int>> *
res =
nullptr,
838 bool includeDativeBonds =
false);
878 std::vector<std::vector<int>> &
res,
879 bool includeDativeBonds =
false);
882 bool includeDativeBonds =
false);
910 const boost::dynamic_bitset<> *
bondsToUse =
nullptr);
963 const std::vector<const Bond *> &bonds,
bool useBO =
false,
1039 unsigned int size()
const {
return d_hybridizations.size(); }
1042 std::vector<int> d_hybridizations;
1305 bool addCoords =
true);
1340 bool addCoords =
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 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 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 void findRingFamilies(const ROMol &mol)
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 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 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 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 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
bool rdvalue_is(const RDValue_cast_t)
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.
static AdjustQueryParameters noAdjustments()
returns an AdjustQueryParameters object with all adjustments disabled