10 #ifndef _RD_EMBEDDED_FRAG_H_
11 #define _RD_EMBEDDED_FRAG_H_
17 #include <boost/smart_ptr.hpp>
237 unsigned int nbrAid);
295 INT_EATOM_MAP_I eari;
296 for (eari = d_eatoms.begin(); eari != d_eatoms.end(); eari++) {
297 eari->second.loc += shift;
302 INT_EATOM_MAP_CI posi = d_eatoms.find(aid);
303 if (posi == d_eatoms.end()) {
304 PRECONDITION(0,
"Embedded atom does not contain embedded atom specified");
310 int Size()
const {
return d_eatoms.size(); }
322 void flipAboutBond(
unsigned int bondId,
bool flipEnd =
true);
324 void openAngles(
const double *dmat,
unsigned int aid1,
unsigned int aid2);
327 bool includeBonds = 1);
334 void permuteBonds(
unsigned int aid,
unsigned int aid1,
unsigned int aid2);
337 unsigned int nSamples = 100,
339 const DOUBLE_SMART_PTR *dmat = 0,
340 double mimicDmatWt = 0.0,
341 bool permuteDeg4Nodes =
false);
375 double totalDensity();
409 unsigned int aid1,
unsigned int aid2,
418 void mergeRing(
const EmbeddedFrag &embRing,
unsigned int nCommon,
431 void reflectIfNecessaryDensity(
EmbeddedFrag &embFrag,
unsigned int aid1,
449 void reflectIfNecessaryCisTrans(
EmbeddedFrag &embFrag,
unsigned int ctCase,
450 unsigned int aid1,
unsigned int aid2);
461 void reflectIfNecessaryThirdPt(
EmbeddedFrag &embFrag,
unsigned int aid1,
462 unsigned int aid2,
unsigned int aid3);
487 void addAtomToAtomWithAng(
unsigned int aid,
unsigned int toAid);
503 void addAtomToAtomWithNoAng(
531 void computeNbrsAndAng(
unsigned int aid,
const RDKit::INT_VECT &doneNbrs);
536 double d_px, d_nx, d_py, d_ny;
540 INT_EATOM_MAP d_eatoms;
void computeDistMat(DOUBLE_SMART_PTR &dmat)
std::list< int > INT_LIST
boost::shared_array< double > DOUBLE_SMART_PTR
EmbeddedAtom & operator=(const EmbeddedAtom &other)
std::vector< PAIR_I_I > findCollisions(const double *dmat, bool includeBonds=1)
const RDKit::ROMol * getMol() const
Get the molecule that this embedded fragmetn blongs to.
EmbeddedAtom(unsigned int aid, const RDGeom::Point2D &pos)
void Reflect(const RDGeom::Point2D &loc1, const RDGeom::Point2D &loc2)
void computeBox()
compute a box that encloses the fragment
void Transform(const RDGeom::Transform2D &trans)
Tranform this object to a new coordinates system.
void removeCollisionsShortenBonds()
Remove collisions by shortening bonds along the shortest path between the.
RDGeom::Point2D normal
a zig-zag manner
double angle
the angle that is already takes at this atom, so any new atom attaching to
void Transform(const RDGeom::Transform2D &trans)
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)
void flipAboutBond(unsigned int bondId, bool flipEnd=true)
Flip atoms on one side of a bond - used in removing colissions.
int findNumNeigh(const RDGeom::Point2D &pt, double radius)
Find all atoms in this embedded system that are within a specified distant of a point.
void openAngles(const double *dmat, unsigned int aid1, unsigned int aid2)
ROMol is a molecule class that is intended to have a fixed topology.
std::vector< INT_VECT > VECT_INT_VECT
void setupNewNeighs()
helpers funtions to
void mergeFragsWithComm(std::list< EmbeddedFrag > &efrags)
void expandEfrag(RDKit::INT_LIST &nratms, std::list< EmbeddedFrag > &efrags)
Expand this embedded system by adding negihboring atoms or other embedded.
std::map< int, Point2D > INT_POINT2D_MAP
double mimicDistMatAndDensityCostFunc(const DOUBLE_SMART_PTR *dmat, double mimicDmatWt)
const INT_EATOM_MAP & GetEmbeddedAtoms() const
void updateNewNeighs(unsigned int aid)
update the unembedded neighbor atom list for a specified atom
std::vector< int > INT_VECT
void permuteBonds(unsigned int aid, unsigned int aid1, unsigned int aid2)
int findNeighbor(unsigned int aid)
Find a neighbor to a non-ring atom among the already embedded atoms.
Class containing a fragment of a molecule that has already been embedded.
Includes a bunch of functionality for handling Atom and Bond queries.
void mergeNoCommon(EmbeddedFrag &embObj, unsigned int toAid, unsigned int nbrAid)
Merge this embedded object with another embedded fragment.
Class that contains the data for an atoms that has alredy been embedded.
int Size() const
the number of atoms in the embedded system
int rotDir
useful only on atoms that are degree >= 4
int nbr2
the second neighbor of atom that from the 'angle'
class for representing a bond
std::map< unsigned int, EmbeddedAtom > INT_EATOM_MAP
RDGeom::Point2D reflectPoint(const RDGeom::Point2D &point, const RDGeom::Point2D &loc1, const RDGeom::Point2D &loc2)
EmbeddedFrag()
Default constructor.
INT_EATOM_MAP::const_iterator INT_EATOM_MAP_CI
void Reflect(const RDGeom::Point2D &loc1, const RDGeom::Point2D &loc2)
void markDone()
Mark this fragment to be done for final embedding.
bool isDone()
If this fragment done for the final embedding.
#define PRECONDITION(expr, mess)
void removeCollisionsBondFlip()
EmbeddedAtom GetEmbeddedAtom(unsigned int aid) const
INT_EATOM_MAP::iterator INT_EATOM_MAP_I
RDKit::INT_VECT neighs
and these are the atom IDs of the neighbors that still need to be embedded
void mergeWithCommon(EmbeddedFrag &embObj, RDKit::INT_VECT &commAtms)
Merge this embedded object with another embedded fragment.
int CisTransNbr
is this is a cis/trans atom the neighbor of this atom that is involved in
void addNonRingAtom(unsigned int aid, unsigned int toAid)
Add a new non-ring atom to this object.
int nbr1
the first neighbor of this atom that form the 'angle'
void removeCollisionsOpenAngles()
Remove collision by opening angles at the offending atoms.
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)
void canonicalizeOrientation()