11 #ifndef _RD_MOL_OPS_H_ 12 #define _RD_MOL_OPS_H_ 17 #include <boost/smart_ptr.hpp> 18 #include <boost/dynamic_bitset.hpp> 75 unsigned int getMolFrags(
const ROMol &mol, std::vector<std::vector<int> > &frags);
96 bool sanitizeFrags=
true,
97 std::vector<int> *frags=0,
98 std::vector<std::vector<int> > *fragsMolAtomMapping=0,
99 bool copyConformers=
true);
115 template <
typename T>
118 bool sanitizeFrags=
true,
119 const std::vector<T> *whiteList=0,
120 bool negateList=
false);
129 void findSpanningTree(
const ROMol &mol,std::vector<int> &mst);
148 const std::vector<int> *bondPath=0,
170 ROMol *
addHs(
const ROMol &mol,
bool explicitOnly=
false,
bool addCoords=
false);
173 void addHs(
RWMol &mol,
bool explicitOnly=
false,
bool addCoords=
false);
199 bool updateExplicitCount=
false,
bool sanitize=
true);
203 bool updateExplicitCount=
false,
bool sanitize=
true);
386 void Kekulize(
RWMol &mol,
bool markAtomsBonds=
true,
unsigned int maxBackTracks=100);
440 int findSSSR(
const ROMol &mol, std::vector<std::vector<int> > &res);
442 int findSSSR(
const ROMol &mol, std::vector<std::vector<int> > *res=0);
505 const char *propNamePrefix=0,
506 const boost::dynamic_bitset<> *bondsToUse=0
532 bool useAtomWts=
false,
534 const char *propNamePrefix=0);
560 const std::vector<int> &activeAtoms,
561 const std::vector<const Bond *> &bonds,
563 bool useAtomWts=
false);
586 bool useAtomWts=
false,
588 const char *propNamePrefix=0);
634 void rankAtoms(
const ROMol &mol,std::vector<int> &ranks,
636 bool includeChirality=
true,
637 bool includeIsotopes=
true,
638 std::vector<std::vector<int> > *rankHistory=0);
662 void rankAtomsInFragment(
const ROMol &mol,std::vector<int> &ranks,
663 const boost::dynamic_bitset<> &atomsToUse,
664 const boost::dynamic_bitset<> &bondsToUse,
665 const std::vector<std::string> *atomSymbols=0,
666 const std::vector<std::string> *bondSymbols=0,
668 std::vector<std::vector<int> > *rankHistory=0);
706 bool flagPossibleStereoCenters=
false);
ROMol * renumberAtoms(const ROMol &mol, const std::vector< unsigned int > &newOrder)
returns a copy of a molecule with the atoms renumbered
std::list< int > getShortestPath(const ROMol &mol, int aid1, int aid2)
Find the shortest path between two atoms.
void fastFindRings(const ROMol &mol)
use a DFS algorithm to identify ring bonds and atoms in a molecule
unsigned int getMolFrags(const ROMol &mol, std::vector< int > &mapping)
find fragments (disconnected components of the molecular graph)
void Kekulize(RWMol &mol, bool markAtomsBonds=true, unsigned int maxBackTracks=100)
Kekulizes the molecule.
ROMol * removeHs(const ROMol &mol, bool implicitOnly=false, bool updateExplicitCount=false, bool sanitize=true)
returns a copy of a molecule with hydrogens removed
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
void assignChiralTypesFrom3D(ROMol &mol, int confId=-1, bool replaceExistingTags=true)
Uses a conformer to assign ChiralType to a molecule's atoms.
int findSSSR(const ROMol &mol, std::vector< std::vector< int > > &res)
finds a molecule's Smallest Set of Smallest Rings
RWMol is a molecule class that is intended to be edited.
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
int symmetrizeSSSR(ROMol &mol, std::vector< std::vector< int > > &res)
symmetrize the molecule's Smallest Set of Smallest Rings
int setAromaticity(RWMol &mol)
Sets up the aromaticity for a molecule.
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...
int countAtomElec(const Atom *at)
return the number of electrons available on an atom to donate for aromaticity
INVAR_VECT::iterator INVAR_VECT_I
void cleanupChirality(RWMol &mol)
removes bogus chirality markers (those on non-sp3 centers):
ROMol is a molecule class that is intended to have a fixed topology.
bool atomHasConjugatedBond(const Atom *at)
returns whether or not the given Atom is involved in a conjugated bond
int getFormalCharge(const ROMol &mol)
sums up all atomic formal charges and returns the result
unsigned getNumAtomsWithDistinctProperty(const ROMol &mol, std::string prop)
returns the number of atoms which have a particular property set
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.
void assignRadicals(RWMol &mol)
Called by the sanitizer to assign radical counts to atoms.
void setConjugation(ROMol &mol)
flags the molecule's conjugated bonds
INVAR_VECT::const_iterator INVAR_VECT_CI
Includes a bunch of functionality for handling Atom and Bond queries.
ROMol * mergeQueryHs(const ROMol &mol, bool mergeUnmappedOnly=false)
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)
void removeStereochemistry(ROMol &mol)
Removes all stereochemistry information from atoms (i.e. R/S) and bonds (i.e. Z/E) ...
class for representing a bond
void cleanUp(RWMol &mol)
Designed to be called by the sanitizer to handle special cases before anything is done...
void setHybridization(ROMol &mol)
calculates and sets the hybridization of all a molecule's Stoms
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
std::vector< double > INVAR_VECT
ROMol * addHs(const ROMol &mol, bool explicitOnly=false, bool addCoords=false)
returns a copy of a molecule with hydrogens added in as explicit Atoms
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.
void adjustHs(RWMol &mol)
adjust the number of implicit and explicit Hs for special cases
void findPotentialStereoBonds(ROMol &mol, bool cleanIt=false)
finds bonds that could be cis/trans in a molecule and mark them as Bond::STEREONONE ...
The class for representing atoms.