12 #ifndef _RD_MOL_OPS_H_
13 #define _RD_MOL_OPS_H_
19 #include <boost/smart_ptr.hpp>
20 #include <boost/dynamic_bitset.hpp>
71 std::vector<int> &mapping);
84 const ROMol &mol, std::vector<std::vector<int>> &frags);
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);
124 template <
typename T>
127 bool sanitizeFrags =
true,
128 const std::vector<T> *whiteList =
nullptr,
129 bool negateList =
false);
166 bool addCoords =
false,
168 bool addResidueInfo =
false);
172 bool addCoords =
false,
174 bool addResidueInfo =
false);
187 unsigned int otherIdx);
223 bool implicitOnly =
false,
224 bool updateExplicitCount =
false,
225 bool sanitize =
true);
229 bool updateExplicitCount =
false,
230 bool sanitize =
true);
232 bool removeDegreeZero =
false;
233 bool removeHigherDegrees =
false;
234 bool removeOnlyHNeighbors =
236 bool removeIsotopes =
false;
237 bool removeAndTrackIsotopes =
false;
241 bool removeDummyNeighbors =
243 bool removeDefiningBondStereo =
245 bool removeWithWedgedBond =
true;
246 bool removeWithQuery =
false;
247 bool removeMapped =
true;
248 bool removeInSGroups =
true;
252 bool showWarnings =
true;
253 bool removeNonimplicit =
true;
254 bool updateExplicitCount =
256 bool removeHydrides =
true;
257 bool removeNontetrahedralNeighbors =
264 bool sanitize =
true);
269 bool sanitize =
true);
276 bool sanitize =
true);
304 bool mergeUnmappedOnly =
false,
305 bool mergeIsotopes =
false);
309 bool mergeUnmappedOnly =
false,
310 bool mergeIsotopes =
false);
332 bool adjustDegree =
true;
335 bool adjustRingCount =
false;
336 std::uint32_t adjustRingCountFlags =
339 bool makeDummiesQueries =
true;
342 bool aromatizeIfPossible =
true;
344 bool makeBondsGeneric =
348 bool makeAtomsGeneric =
352 bool adjustHeavyDegree =
false;
354 std::uint32_t adjustHeavyDegreeFlags =
357 bool adjustRingChain =
false;
360 bool useStereoCareForBonds =
364 bool adjustConjugatedFiveRings =
368 bool setMDLFiveRingAromaticity =
372 bool adjustSingleBondsToDegreeOneNeighbors =
376 bool adjustSingleBondsBetweenAromaticAtoms =
425 const ROMol &mol,
const std::vector<unsigned int> &newOrder);
483 unsigned int &operationThatFailed,
562 int (*func)(
RWMol &) =
nullptr);
628 unsigned int maxBackTracks = 100);
652 bool markAtomsBonds =
true,
653 unsigned int maxBackTracks = 100);
710 std::vector<std::vector<int>> &res);
713 const ROMol &mol, std::vector<std::vector<int>> *res =
nullptr);
751 std::vector<std::vector<int>> &res);
778 const ROMol &mol,
bool useBO =
false,
int emptyVal = 0,
bool force =
false,
779 const char *propNamePrefix =
nullptr,
780 const boost::dynamic_bitset<> *bondsToUse =
nullptr);
805 const ROMol &mol,
bool useBO =
false,
bool useAtomWts =
false,
806 bool force =
false,
const char *propNamePrefix =
nullptr);
832 const ROMol &mol,
const std::vector<int> &activeAtoms,
833 const std::vector<const Bond *> &bonds,
bool useBO =
false,
834 bool useAtomWts =
false);
858 const ROMol &mol,
int confId = -1,
bool useAtomWts =
false,
859 bool force =
false,
const char *propNamePrefix =
nullptr);
903 ROMol &mol,
int confId = -1,
bool replaceExistingTags =
true);
917 ROMol &mol,
int confId = -1,
bool replaceExistingTags =
true);
929 ROMol &mol,
int confId = -1,
bool replaceExistingTags =
true);
972 ROMol &mol,
bool cleanIt =
false,
bool force =
false,
973 bool flagPossibleStereoCenters =
false);
1005 bool cleanIt =
false);
1014 ROMol &mol,
bool replaceExistingTags =
true);
1020 const ROMol &mol, std::string prop);
1028 RWMol &mol,
const boost::dynamic_bitset<> &atomsToUse,
1029 boost::dynamic_bitset<> bondsToUse,
bool markAtomsBonds =
true,
1030 unsigned int maxBackTracks = 100);
RDKIT_GRAPHMOL_EXPORT const int ci_LOCAL_INF
The class for representing atoms.
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 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 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 (i.e. R/S) and bonds (i.e. Z/E)
RDKIT_GRAPHMOL_EXPORT bool KekulizeIfPossible(RWMol &mol, bool markAtomsBonds=true, unsigned int maxBackTracks=100)
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 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 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 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 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 setTerminalAtomCoords(ROMol &mol, unsigned int idx, unsigned int otherIdx)
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 void removeStereochemistry(ROMol &mol)
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
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 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 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
@ SANITIZE_SETCONJUGATION
@ SANITIZE_CLEANUPCHIRALITY
@ SANITIZE_SETHYBRIDIZATION
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 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 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 ROMol * adjustQueryProperties(const ROMol &mol, const AdjustQueryParameters *params=nullptr)
returns a copy of a molecule with query properties adjusted
RDKIT_GRAPHMOL_EXPORT void setBondStereoFromDirections(ROMol &mol)
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 int findSSSR(const ROMol &mol, std::vector< std::vector< int >> &res)
finds a molecule's Smallest Set of Smallest Rings
RDKIT_GRAPHMOL_EXPORT bool atomHasConjugatedBond(const Atom *at)
returns whether or not the given Atom is involved in a conjugated bond
RDKIT_GRAPHMOL_EXPORT void cleanupChirality(RWMol &mol)
removes bogus chirality markers (those on non-sp3 centers):
RDKIT_GRAPHMOL_EXPORT ROMol * mergeQueryHs(const ROMol &mol, bool mergeUnmappedOnly=false, bool mergeIsotopes=false)
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 setHybridization(ROMol &mol)
calculates and sets the hybridization of all a molecule's Stoms
RDKIT_GRAPHMOL_EXPORT std::list< int > getShortestPath(const ROMol &mol, int aid1, int aid2)
Find the shortest path between two atoms.
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 int symmetrizeSSSR(ROMol &mol, std::vector< std::vector< int >> &res)
symmetrize the molecule's Smallest Set of Smallest Rings
RDKIT_GRAPHMOL_EXPORT void clearSingleBondDirFlags(ROMol &mol)
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.
static AdjustQueryParameters noAdjustments()
returns an AdjustQueryParameters object with all adjustments disabled