 |
RDKit
Open-source cheminformatics and machine learning.
|
Go to the documentation of this file.
11 #ifndef _RD_EMBEDDED_FRAG_H_
12 #define _RD_EMBEDDED_FRAG_H_
18 #include <boost/smart_ptr.hpp>
31 typedef enum { UNSPECIFIED = 0, CISTRANS,
RING } EAtomType;
245 unsigned int nbrAid);
304 for (eari = d_eatoms.begin(); eari != d_eatoms.end(); eari++) {
305 eari->second.loc += shift;
311 if (posi == d_eatoms.end()) {
312 PRECONDITION(0,
"Embedded atom does not contain embedded atom specified");
318 int Size()
const {
return d_eatoms.size(); }
332 void openAngles(
const double *dmat,
unsigned int aid1,
unsigned int aid2);
335 bool includeBonds = 1);
342 void permuteBonds(
unsigned int aid,
unsigned int aid1,
unsigned int aid2);
345 unsigned int nSamples = 100,
348 double mimicDmatWt = 0.0,
349 bool permuteDeg4Nodes =
false);
383 double totalDensity();
417 unsigned int aid1,
unsigned int aid2,
426 void mergeRing(
const EmbeddedFrag &embRing,
unsigned int nCommon,
439 void reflectIfNecessaryDensity(
EmbeddedFrag &embFrag,
unsigned int aid1,
457 void reflectIfNecessaryCisTrans(
EmbeddedFrag &embFrag,
unsigned int ctCase,
458 unsigned int aid1,
unsigned int aid2);
469 void reflectIfNecessaryThirdPt(
EmbeddedFrag &embFrag,
unsigned int aid1,
470 unsigned int aid2,
unsigned int aid3);
495 void addAtomToAtomWithAng(
unsigned int aid,
unsigned int toAid);
511 void addAtomToAtomWithNoAng(
539 void computeNbrsAndAng(
unsigned int aid,
const RDKit::INT_VECT &doneNbrs);
544 double d_px=0.0, d_nx=0.0, d_py=0.0, d_ny=0.0;
int findNeighbor(unsigned int aid)
Find a neighbor to a non-ring atom among the already embedded atoms.
#define RDKIT_DEPICTOR_EXPORT
EmbeddedFrag(unsigned int aid, const RDKit::ROMol *mol)
Initializer from a single atom id.
std::vector< INT_VECT > VECT_INT_VECT
const INT_EATOM_MAP & GetEmbeddedAtoms() const
void randomSampleFlipsAndPermutations(unsigned int nBondsPerSample=3, unsigned int nSamples=100, int seed=100, const DOUBLE_SMART_PTR *dmat=0, double mimicDmatWt=0.0, bool permuteDeg4Nodes=false)
std::map< unsigned int, EmbeddedAtom > INT_EATOM_MAP
std::vector< int > INT_VECT
void Transform(const RDGeom::Transform2D &trans)
int nbr2
the second neighbor of atom that from the 'angle'
void canonicalizeOrientation()
EmbeddedAtom GetEmbeddedAtom(unsigned int aid) const
class for representing a bond
void addNonRingAtom(unsigned int aid, unsigned int toAid)
Add a new non-ring atom to this object.
int findNumNeigh(const RDGeom::Point2D &pt, double radius)
Find all atoms in this embedded system that are within a specified distant of a point.
EmbeddedAtom(unsigned int aid, const RDGeom::Point2D &pos)
void removeCollisionsBondFlip()
void expandEfrag(RDKit::INT_LIST &nratms, std::list< EmbeddedFrag > &efrags)
Expand this embedded system by adding neighboring atoms or other embedded.
void updateNewNeighs(unsigned int aid)
update the unembedded neighbor atom list for a specified atom
EmbeddedFrag(const RDKit::ROMol *mol, const RDGeom::INT_POINT2D_MAP &coordMap)
Constructor when the coordinates have been specified for a set of atoms.
double mimicDistMatAndDensityCostFunc(const DOUBLE_SMART_PTR *dmat, double mimicDmatWt)
void Transform(const RDGeom::Transform2D &trans)
Transform this object to a new coordinates system.
void Reflect(const RDGeom::Point2D &loc1, const RDGeom::Point2D &loc2)
bool isDone()
If this fragment done for the final embedding.
void mergeNoCommon(EmbeddedFrag &embObj, unsigned int toAid, unsigned int nbrAid)
Merge this embedded object with another embedded fragment.
EmbeddedFrag(const RDKit::Bond *dblBond)
Initializer for a cis/trans system using the double bond.
int CisTransNbr
is this is a cis/trans atom the neighbor of this atom that is involved in
int rotDir
useful only on atoms that are degree >= 4
std::vector< PAIR_I_I > findCollisions(const double *dmat, bool includeBonds=1)
void removeCollisionsOpenAngles()
Remove collision by opening angles at the offending atoms.
INT_EATOM_MAP::iterator INT_EATOM_MAP_I
void removeCollisionsShortenBonds()
Remove collisions by shortening bonds along the shortest path between the.
std::map< int, Point2D > INT_POINT2D_MAP
INT_EATOM_MAP::const_iterator INT_EATOM_MAP_CI
void markDone()
Mark this fragment to be done for final embedding.
void setupNewNeighs()
helpers functions to
RDKit::INT_VECT neighs
and these are the atom IDs of the neighbors that still need to be embedded
void Reflect(const RDGeom::Point2D &loc1, const RDGeom::Point2D &loc2)
EmbeddedAtom & operator=(const EmbeddedAtom &other)
void computeBox()
compute a box that encloses the fragment
Class containing a fragment of a molecule that has already been embedded.
int nbr1
the first neighbor of this atom that form the 'angle'
RDKIT_DEPICTOR_EXPORT RDGeom::Point2D reflectPoint(const RDGeom::Point2D &point, const RDGeom::Point2D &loc1, const RDGeom::Point2D &loc2)
void permuteBonds(unsigned int aid, unsigned int aid1, unsigned int aid2)
double angle
the angle that is already takes at this atom, so any new atom attaching to
EmbeddedFrag(const RDKit::ROMol *mol, const RDKit::VECT_INT_VECT &fusedRings)
Initializer from a set of fused rings.
RDKit::INT_VECT findCommonAtoms(const EmbeddedFrag &efrag2)
Find the common atom ids between this fragment and a second one.
void Translate(const RDGeom::Point2D &shift)
std::list< int > INT_LIST
boost::shared_array< double > DOUBLE_SMART_PTR
#define PRECONDITION(expr, mess)
void mergeFragsWithComm(std::list< EmbeddedFrag > &efrags)
Class that contains the data for an atoms that has already been embedded.
void flipAboutBond(unsigned int bondId, bool flipEnd=true)
Flip atoms on one side of a bond - used in removing collisions.
void openAngles(const double *dmat, unsigned int aid1, unsigned int aid2)
int Size() const
the number of atoms in the embedded system
void computeDistMat(DOUBLE_SMART_PTR &dmat)
RDGeom::Point2D normal
a zig-zag manner
const RDKit::ROMol * getMol() const
Get the molecule that this embedded fragment belongs to.
EmbeddedFrag()
Default constructor.
void mergeWithCommon(EmbeddedFrag &embObj, RDKit::INT_VECT &commAtms)
Merge this embedded object with another embedded fragment.