11 #ifndef _RD_MOL_OPS_H_ 12 #define _RD_MOL_OPS_H_ 17 #include <boost/smart_ptr.hpp> 18 #include <boost/dynamic_bitset.hpp> 78 std::vector<std::vector<int> > &frags);
99 const ROMol &mol,
bool sanitizeFrags =
true, std::vector<int> *frags = 0,
100 std::vector<std::vector<int> > *fragsMolAtomMapping = 0,
101 bool copyConformers =
true);
117 template <
typename T>
120 bool sanitizeFrags =
true,
const std::vector<T> *whiteList = 0,
121 bool negateList =
false);
129 void findSpanningTree(
const ROMol &mol,std::vector<int> &mst);
146 const std::vector<int> *bondPath = 0,
147 bool cacheIt =
true);
175 bool addCoords =
false,
const UINT_VECT *onlyOnAtoms = NULL);
178 void addHs(
RWMol &mol,
bool explicitOnly =
false,
bool addCoords =
false,
209 bool updateExplicitCount =
false,
bool sanitize =
true);
213 bool updateExplicitCount =
false,
bool sanitize =
true);
260 : adjustDegree(true),
262 adjustRingCount(false),
264 makeDummiesQueries(true)
297 const std::vector<unsigned int> &newOrder);
457 unsigned int maxBackTracks = 100);
513 int findSSSR(
const ROMol &mol, std::vector<std::vector<int> > &res);
515 int findSSSR(
const ROMol &mol, std::vector<std::vector<int> > *res = 0);
578 int emptyVal = 0,
bool force =
false,
579 const char *propNamePrefix = 0,
580 const boost::dynamic_bitset<> *bondsToUse = 0);
605 bool useAtomWts =
false,
bool force =
false,
606 const char *propNamePrefix = 0);
632 const std::vector<const Bond *> &bonds,
633 bool useBO =
false,
bool useAtomWts =
false);
657 bool useAtomWts =
false,
bool force =
false,
658 const char *propNamePrefix = 0);
704 void rankAtoms(
const ROMol &mol,std::vector<int> &ranks,
706 bool includeChirality=
true,
707 bool includeIsotopes=
true,
708 std::vector<std::vector<int> > *rankHistory=0);
732 void rankAtomsInFragment(
const ROMol &mol,std::vector<int> &ranks,
733 const boost::dynamic_bitset<> &atomsToUse,
734 const boost::dynamic_bitset<> &bondsToUse,
735 const std::vector<std::string> *atomSymbols=0,
736 const std::vector<std::string> *bondSymbols=0,
738 std::vector<std::vector<int> > *rankHistory=0);
758 bool replaceExistingTags =
true);
777 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::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
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.
ROMol * addHs(const ROMol &mol, bool explicitOnly=false, bool addCoords=false, const UINT_VECT *onlyOnAtoms=NULL)
returns a copy of a molecule with hydrogens added in as explicit Atoms
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
ROMol * adjustQueryProperties(const ROMol &mol, const AdjustQueryParameters *params=NULL)
returns a copy of a molecule with query properties adjusted
int countAtomElec(const Atom *at)
return the number of electrons available on an atom to donate for
AdjustQueryWhichFlags adjustDegreeFlags
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
AdjustQueryWhichFlags adjustRingCountFlags
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.
class for representing a bond
void cleanUp(RWMol &mol)
Designed to be called by the sanitizer to handle special cases before.
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< UINT > UINT_VECT
std::vector< double > INVAR_VECT
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.