RDKit
Open-source cheminformatics and machine learning.
RDDepict::EmbeddedFrag Class Reference

Class containing a fragment of a molecule that has already been embedded. More...

#include <EmbeddedFrag.h>

Public Member Functions

 EmbeddedFrag ()
 Default constructor. More...
 
 EmbeddedFrag (unsigned int aid, const RDKit::ROMol *mol)
 Intializer from a single atom id. More...
 
 EmbeddedFrag (const RDKit::ROMol *mol, const RDGeom::INT_POINT2D_MAP &coordMap)
 Constructor when the coordinates have been specified for a set of atoms. More...
 
 EmbeddedFrag (const RDKit::ROMol *mol, const RDKit::VECT_INT_VECT &fusedRings)
 Initializer from a set of fused rings. More...
 
 EmbeddedFrag (const RDKit::Bond *dblBond)
 Initializer for a cis/trans system using the double bond. More...
 
void expandEfrag (RDKit::INT_LIST &nratms, std::list< EmbeddedFrag > &efrags)
 Expand this embedded system by adding negihboring atoms or other embedded. More...
 
void addNonRingAtom (unsigned int aid, unsigned int toAid)
 Add a new non-ring atom to this object. More...
 
void mergeNoCommon (EmbeddedFrag &embObj, unsigned int toAid, unsigned int nbrAid)
 Merge this embedded object with another embedded fragment. More...
 
void mergeWithCommon (EmbeddedFrag &embObj, RDKit::INT_VECT &commAtms)
 Merge this embedded object with another embedded fragment. More...
 
void mergeFragsWithComm (std::list< EmbeddedFrag > &efrags)
 
void markDone ()
 Mark this fragment to be done for final embedding. More...
 
bool isDone ()
 If this fragment done for the final embedding. More...
 
const RDKit::ROMolgetMol () const
 Get the molecule that this embedded fragmetn blongs to. More...
 
RDKit::INT_VECT findCommonAtoms (const EmbeddedFrag &efrag2)
 Find the common atom ids between this fragment and a second one. More...
 
int findNeighbor (unsigned int aid)
 Find a neighbor to a non-ring atom among the already embedded atoms. More...
 
void Transform (const RDGeom::Transform2D &trans)
 Tranform this object to a new coordinates system. More...
 
void Reflect (const RDGeom::Point2D &loc1, const RDGeom::Point2D &loc2)
 
const INT_EATOM_MAPGetEmbeddedAtoms () const
 
void Translate (const RDGeom::Point2D &shift)
 
EmbeddedAtom GetEmbeddedAtom (unsigned int aid) const
 
int Size () const
 the number of atoms in the embedded system More...
 
void computeBox ()
 compute a box that encloses the fragment More...
 
void flipAboutBond (unsigned int bondId, bool flipEnd=true)
 Flip atoms on one side of a bond - used in removing colissions. More...
 
void openAngles (const double *dmat, unsigned int aid1, unsigned int aid2)
 
std::vector< PAIR_I_IfindCollisions (const double *dmat, bool includeBonds=1)
 
void computeDistMat (DOUBLE_SMART_PTR &dmat)
 
double mimicDistMatAndDensityCostFunc (const DOUBLE_SMART_PTR *dmat, double mimicDmatWt)
 
void permuteBonds (unsigned int aid, unsigned int aid1, unsigned int aid2)
 
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 removeCollisionsBondFlip ()
 
void removeCollisionsOpenAngles ()
 Remove collision by opening angles at the offending atoms. More...
 
void removeCollisionsShortenBonds ()
 Remove collisions by shortening bonds along the shortest path between the. More...
 
void setupNewNeighs ()
 helpers funtions to More...
 
void updateNewNeighs (unsigned int aid)
 update the unembedded neighbor atom list for a specified atom More...
 
int findNumNeigh (const RDGeom::Point2D &pt, double radius)
 Find all atoms in this embedded system that are within a specified distant of a point. More...
 
double getBoxPx ()
 
double getBoxNx ()
 
double getBoxPy ()
 
double getBoxNy ()
 
void canonicalizeOrientation ()
 

Detailed Description

Class containing a fragment of a molecule that has already been embedded.

Definition at line 147 of file EmbeddedFrag.h.

Constructor & Destructor Documentation

RDDepict::EmbeddedFrag::EmbeddedFrag ( )
inline

Default constructor.

Definition at line 154 of file EmbeddedFrag.h.

RDDepict::EmbeddedFrag::EmbeddedFrag ( unsigned int  aid,
const RDKit::ROMol mol 
)

Intializer from a single atom id.

A single Embedded Atom with this atom ID is added and placed at the origin

RDDepict::EmbeddedFrag::EmbeddedFrag ( const RDKit::ROMol mol,
const RDGeom::INT_POINT2D_MAP coordMap 
)

Constructor when the coordinates have been specified for a set of atoms.

This simply initialized a set of EmbeddedAtom to have the same coordinates as the one's specified. No testing is done to verify any kind of ocrrectlness. Also this fragment is less ready (to expand and add new neighbors) than when using other constructors. This is because:

  • the user may have specified coords for only a part of the atoms in a fused ring systems in which case we need to find these atoms and merge these ring systems to this fragment
  • The atoms are not yet aware of their neighbor (what is left to add etc.) this again depends on atoms properly so that new neighbors can be added to them
RDDepict::EmbeddedFrag::EmbeddedFrag ( const RDKit::ROMol mol,
const RDKit::VECT_INT_VECT fusedRings 
)

Initializer from a set of fused rings.

ARGUMENTS:

Parameters
molthe molecule of interest
fusedRingsa vector of rings, each ring is a list of atom ids
RDDepict::EmbeddedFrag::EmbeddedFrag ( const RDKit::Bond dblBond)
explicit

Initializer for a cis/trans system using the double bond.

ARGUMENTS:

Parameters
dblBondthe double bond that is involed in the cis/trans configuration

Member Function Documentation

void RDDepict::EmbeddedFrag::addNonRingAtom ( unsigned int  aid,
unsigned int  toAid 
)

Add a new non-ring atom to this object.

void RDDepict::EmbeddedFrag::canonicalizeOrientation ( )
void RDDepict::EmbeddedFrag::computeBox ( )

compute a box that encloses the fragment

void RDDepict::EmbeddedFrag::computeDistMat ( DOUBLE_SMART_PTR dmat)
void RDDepict::EmbeddedFrag::expandEfrag ( RDKit::INT_LIST nratms,
std::list< EmbeddedFrag > &  efrags 
)

Expand this embedded system by adding negihboring atoms or other embedded.

Note that both nratms and efrags are modified in this function as we start merging them with the current fragment

std::vector<PAIR_I_I> RDDepict::EmbeddedFrag::findCollisions ( const double *  dmat,
bool  includeBonds = 1 
)
RDKit::INT_VECT RDDepict::EmbeddedFrag::findCommonAtoms ( const EmbeddedFrag efrag2)

Find the common atom ids between this fragment and a second one.

int RDDepict::EmbeddedFrag::findNeighbor ( unsigned int  aid)

Find a neighbor to a non-ring atom among the already embedded atoms.

ARGUMENTS:

Parameters
aidthe atom id of interest

RETURNS:

Returns
the id of the atom if we found a neighbor -1 otherwise

NOTE: by definition we can have only one neighbor in the embdded system.

int RDDepict::EmbeddedFrag::findNumNeigh ( const RDGeom::Point2D pt,
double  radius 
)

Find all atoms in this embedded system that are within a specified distant of a point.

void RDDepict::EmbeddedFrag::flipAboutBond ( unsigned int  bondId,
bool  flipEnd = true 
)

Flip atoms on one side of a bond - used in removing colissions.

ARGUMENTS:

Parameters
bondId- the bond used as the mirror to flip
flipEnd- flip the atoms at the end of the bond
double RDDepict::EmbeddedFrag::getBoxNx ( )
inline

Definition at line 368 of file EmbeddedFrag.h.

double RDDepict::EmbeddedFrag::getBoxNy ( )
inline

Definition at line 370 of file EmbeddedFrag.h.

double RDDepict::EmbeddedFrag::getBoxPx ( )
inline

Definition at line 367 of file EmbeddedFrag.h.

double RDDepict::EmbeddedFrag::getBoxPy ( )
inline

Definition at line 369 of file EmbeddedFrag.h.

EmbeddedAtom RDDepict::EmbeddedFrag::GetEmbeddedAtom ( unsigned int  aid) const
inline

Definition at line 301 of file EmbeddedFrag.h.

References PRECONDITION.

const INT_EATOM_MAP& RDDepict::EmbeddedFrag::GetEmbeddedAtoms ( ) const
inline

Definition at line 292 of file EmbeddedFrag.h.

const RDKit::ROMol* RDDepict::EmbeddedFrag::getMol ( ) const
inline

Get the molecule that this embedded fragmetn blongs to.

Definition at line 264 of file EmbeddedFrag.h.

bool RDDepict::EmbeddedFrag::isDone ( )
inline

If this fragment done for the final embedding.

Definition at line 261 of file EmbeddedFrag.h.

void RDDepict::EmbeddedFrag::markDone ( )
inline

Mark this fragment to be done for final embedding.

Definition at line 258 of file EmbeddedFrag.h.

void RDDepict::EmbeddedFrag::mergeFragsWithComm ( std::list< EmbeddedFrag > &  efrags)
void RDDepict::EmbeddedFrag::mergeNoCommon ( EmbeddedFrag embObj,
unsigned int  toAid,
unsigned int  nbrAid 
)

Merge this embedded object with another embedded fragment.

The transformation (rotation + translation required to attached the passed in object will be computed and applied. The coordinates of the atoms in this object will remain fixed We will assume that there are no common atoms between the two fragments to start with

ARGUMENTS:

Parameters
embObjanother EmbeddedFrag object to be merged with this object
toAidthe atom in this embedded fragment to which the new object will be attached
nbrAidthe atom in the other fragment to attach to
void RDDepict::EmbeddedFrag::mergeWithCommon ( EmbeddedFrag embObj,
RDKit::INT_VECT commAtms 
)

Merge this embedded object with another embedded fragment.

The transformation (rotation + translation required to attached the passed in object will be computed and applied. The coordinates of the atoms in this object will remain fixed This already know there are a atoms in common and we will use them to merge things

ARGUMENTS:

Parameters
embObjanother EmbeddedFrag object to be merged with this object
commAtmsa vector of ids of the common atoms
double RDDepict::EmbeddedFrag::mimicDistMatAndDensityCostFunc ( const DOUBLE_SMART_PTR dmat,
double  mimicDmatWt 
)
void RDDepict::EmbeddedFrag::openAngles ( const double *  dmat,
unsigned int  aid1,
unsigned int  aid2 
)
void RDDepict::EmbeddedFrag::permuteBonds ( unsigned int  aid,
unsigned int  aid1,
unsigned int  aid2 
)
void RDDepict::EmbeddedFrag::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 RDDepict::EmbeddedFrag::Reflect ( const RDGeom::Point2D loc1,
const RDGeom::Point2D loc2 
)
void RDDepict::EmbeddedFrag::removeCollisionsBondFlip ( )

Remove collisions in a structure by flipping rotable bonds along the shortest path between two colliding atoms

void RDDepict::EmbeddedFrag::removeCollisionsOpenAngles ( )

Remove collision by opening angles at the offending atoms.

void RDDepict::EmbeddedFrag::removeCollisionsShortenBonds ( )

Remove collisions by shortening bonds along the shortest path between the.

void RDDepict::EmbeddedFrag::setupNewNeighs ( )

helpers funtions to

make list of neighbors for each atom in the embedded system that still need to be embedded

int RDDepict::EmbeddedFrag::Size ( ) const
inline

the number of atoms in the embedded system

Definition at line 310 of file EmbeddedFrag.h.

void RDDepict::EmbeddedFrag::Transform ( const RDGeom::Transform2D trans)

Tranform this object to a new coordinates system.

ARGUMENTS:

Parameters
trans: the transformation that need to be applied to the atoms in this object
void RDDepict::EmbeddedFrag::Translate ( const RDGeom::Point2D shift)
inline

Definition at line 294 of file EmbeddedFrag.h.

void RDDepict::EmbeddedFrag::updateNewNeighs ( unsigned int  aid)

update the unembedded neighbor atom list for a specified atom


The documentation for this class was generated from the following file: