12 #ifndef _RD_MOL_OPS_H_ 13 #define _RD_MOL_OPS_H_ 19 #include <boost/smart_ptr.hpp> 20 #include <boost/dynamic_bitset.hpp> 70 std::vector<int> &mapping);
83 const ROMol &mol, std::vector<std::vector<int>> &frags);
104 const ROMol &mol,
bool sanitizeFrags =
true, std::vector<int> *frags = 0,
105 std::vector<std::vector<int>> *fragsMolAtomMapping = 0,
106 bool copyConformers =
true);
122 template <
typename T>
125 bool sanitizeFrags =
true,
126 const std::vector<T> *whiteList = 0,
127 bool negateList =
false);
152 const ROMol &mol,
bool useBO =
true,
bool force =
false,
153 const std::vector<int> *bondPath = 0,
bool cacheIt =
true);
183 bool addCoords =
false,
185 bool addResidueInfo =
false);
189 bool addCoords =
false,
191 bool addResidueInfo =
false);
224 bool implicitOnly =
false,
225 bool updateExplicitCount =
false,
226 bool sanitize =
true);
230 bool updateExplicitCount =
false,
231 bool sanitize =
true);
258 bool mergeUnmappedOnly =
false);
262 bool mergeUnmappedOnly =
false);
294 : adjustDegree(true),
296 adjustRingCount(false),
298 makeDummiesQueries(true),
299 aromatizeIfPossible(true),
300 makeBondsGeneric(false),
302 makeAtomsGeneric(false),
304 adjustHeavyDegree(false),
306 adjustRingChain(false),
338 const ROMol &mol,
const std::vector<unsigned int> &newOrder);
399 unsigned int &operationThatFailed,
452 int (*func)(
RWMol &) = NULL);
522 unsigned int maxBackTracks = 100);
579 std::vector<std::vector<int>> &res);
582 std::vector<std::vector<int>> *res = 0);
619 std::vector<std::vector<int>> &res);
646 const ROMol &mol,
bool useBO =
false,
int emptyVal = 0,
bool force =
false,
647 const char *propNamePrefix = 0,
648 const boost::dynamic_bitset<> *bondsToUse = 0);
674 bool useAtomWts =
false,
676 const char *propNamePrefix = 0);
702 const ROMol &mol,
const std::vector<int> &activeAtoms,
703 const std::vector<const Bond *> &bonds,
bool useBO =
false,
704 bool useAtomWts =
false);
729 bool useAtomWts =
false,
731 const char *propNamePrefix = 0);
780 bool includeChirality=
true,
781 bool includeIsotopes=
true,
782 std::vector<std::vector<int> > *rankHistory=0);
807 const boost::dynamic_bitset<> &atomsToUse,
808 const boost::dynamic_bitset<> &bondsToUse,
809 const std::vector<std::string> *atomSymbols=0,
810 const std::vector<std::string> *bondSymbols=0,
812 std::vector<std::vector<int> > *rankHistory=0);
832 ROMol &mol,
int confId = -1,
bool replaceExistingTags =
true);
846 ROMol &mol,
int confId = -1,
bool replaceExistingTags =
true);
885 ROMol &mol,
bool cleanIt =
false,
bool force =
false,
886 bool flagPossibleStereoCenters =
false);
918 bool cleanIt =
false);
923 const ROMol &mol, std::string prop);
RDKIT_GRAPHMOL_EXPORT void setHybridization(ROMol &mol)
calculates and sets the hybridization of all a molecule's Stoms
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.
boost::uint32_t adjustDegreeFlags
RDKIT_GRAPHMOL_EXPORT void cleanUp(RWMol &mol)
Designed to be called by the sanitizer to handle special cases before.
RDKIT_GRAPHMOL_EXPORT int countAtomElec(const Atom *at)
return the number of electrons available on an atom to donate for
RDKIT_GRAPHMOL_EXPORT void assignChiralTypesFrom3D(ROMol &mol, int confId=-1, bool replaceExistingTags=true)
Uses a conformer to assign ChiralType to a molecule's atoms.
RWMol is a molecule class that is intended to be edited.
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 void fastFindRings(const ROMol &mol)
use a DFS algorithm to identify ring bonds and atoms in a molecule
RDKIT_GRAPHMOL_EXPORT int setAromaticity(RWMol &mol, AromaticityModel model=AROMATICITY_DEFAULT, int(*func)(RWMol &)=NULL)
Sets up the aromaticity for a molecule.
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
boost::uint32_t makeBondsGenericFlags
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
AromaticityModel
Possible aromaticity models.
boost::uint32_t adjustRingChainFlags
boost::uint32_t adjustRingCountFlags
boost::uint32_t makeAtomsGenericFlags
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 detectBondStereochemistry(ROMol &mol, int confId=-1)
Uses a conformer to assign directionality to the single bonds around double bonds.
INVAR_VECT::iterator INVAR_VECT_I
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 Kekulize(RWMol &mol, bool markAtomsBonds=true, unsigned int maxBackTracks=100)
Kekulizes the molecule.
RDKIT_GRAPHMOL_EXPORT void setDoubleBondNeighborDirections(ROMol &mol, const Conformer *conf=NULL)
RDKIT_GRAPHMOL_EXPORT ROMol * adjustQueryProperties(const ROMol &mol, const AdjustQueryParameters *params=NULL)
returns a copy of a molecule with query properties adjusted
RDKIT_GRAPHMOL_EXPORT void cleanupChirality(RWMol &mol)
removes bogus chirality markers (those on non-sp3 centers):
RDKIT_GRAPHMOL_EXPORT bool atomHasConjugatedBond(const Atom *at)
returns whether or not the given Atom is involved in a conjugated bond
RDKIT_GRAPHMOL_EXPORT const int ci_LOCAL_INF
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.
#define RDKIT_GRAPHMOL_EXPORT
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 adjustHs(RWMol &mol)
adjust the number of implicit and explicit Hs for special cases
boost::uint32_t adjustHeavyDegreeFlags
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_GRAPHMOL_EXPORT ROMol * renumberAtoms(const ROMol &mol, const std::vector< unsigned int > &newOrder)
returns a copy of a molecule with the atoms renumbered
INVAR_VECT::const_iterator INVAR_VECT_CI
RDKIT_GRAPHMOL_EXPORT void setConjugation(ROMol &mol)
flags the molecule's conjugated bonds
RDKIT_GRAPHMOL_EXPORT ROMol * mergeQueryHs(const ROMol &mol, bool mergeUnmappedOnly=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 int findSSSR(const ROMol &mol, std::vector< std::vector< int >> &res)
finds a molecule's Smallest Set of Smallest Rings
RDKIT_GRAPHMOL_EXPORT void assignRadicals(RWMol &mol)
Called by the sanitizer to assign radical counts to atoms.
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 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_GRAPHMOL_EXPORT int getFormalCharge(const ROMol &mol)
sums up all atomic formal charges and returns the result
RDKIT_GRAPHMOL_EXPORT void removeStereochemistry(ROMol &mol)
Removes all stereochemistry information from atoms (i.e. R/S) and bonds.
std::vector< UINT > UINT_VECT
std::vector< double > INVAR_VECT
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_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
The class for representing atoms.
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