RDKit: RDDepict::EmbeddedFrag Class Reference

| RDKit Open-source cheminformatics and machine learning.

Loading...
Searching...
No Matches
Public Member Functions | List of all members
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.
| EmbeddedFrag (unsigned int aid, const RDKit::ROMol *mol)
| Initializer from a single atom id.
| EmbeddedFrag (const RDKit::ROMol *mol, const RDGeom::INT_POINT2D_MAP &coordMap)
| Constructor when the coordinates have been specified for a set of atoms.
| EmbeddedFrag (const RDKit::ROMol *mol, const RDKit::VECT_INT_VECT &fusedRings, bool useRingTemplates)
| Initializer from a set of fused rings.
| EmbeddedFrag (const RDKit::Bond *dblBond)
| Initializer for a cis/trans system using the double bond.
void | expandEfrag (RDKit::INT_LIST &nratms, std::list< EmbeddedFrag > &efrags)
void | addNonRingAtom (unsigned int aid, unsigned int toAid)
| Add a new non-ring atom to this object.
void | mergeNoCommon (EmbeddedFrag &embObj, unsigned int toAid, unsigned int nbrAid)
| Merge this embedded object with another embedded fragment.
void | mergeWithCommon (EmbeddedFrag &embObj, RDKit::INT_VECT &commAtms)
| Merge this embedded object with another embedded fragment.
void | mergeFragsWithComm (std::list< EmbeddedFrag > &efrags)
void | markDone ()
| Mark this fragment to be done for final embedding.
bool | isDone ()
| If this fragment done for the final embedding.
const RDKit::ROMol * | getMol () const
| Get the molecule that this embedded fragment belongs to.
RDKit::INT_VECT | findCommonAtoms (const EmbeddedFrag &efrag2)
| Find the common atom ids between this fragment and a second one.
int | findNeighbor (unsigned int aid)
| Find a neighbor to a non-ring atom among the already embedded atoms.
void | Transform (const RDGeom::Transform2D &trans)
| Transform this object to a new coordinates system.
void | Reflect (const RDGeom::Point2D &loc1, const RDGeom::Point2D &loc2)
const INT_EATOM_MAP & | GetEmbeddedAtoms () const
void | Translate (const RDGeom::Point2D &shift)
EmbeddedAtom | GetEmbeddedAtom (unsigned int aid) const
int | Size () const
| the number of atoms in the embedded system
void | computeBox ()
| compute a box that encloses the fragment
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)
std::vector< PAIR_I_I > | findCollisions (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=nullptr, double mimicDmatWt=0.0, bool permuteDeg4Nodes=false)
void | removeCollisionsBondFlip ()
void | removeCollisionsOpenAngles ()
| Remove collision by opening angles at the offending atoms.
void | removeCollisionsShortenBonds ()
void | setupNewNeighs ()
| helpers functions to
void | updateNewNeighs (unsigned int aid)
| update the unembedded neighbor atom list for a specified atom
int | findNumNeigh (const RDGeom::Point2D &pt, double radius)
| Find all atoms in this embedded system that are within a specified distant of a point.
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 146 of file EmbeddedFrag.h.

## Constructor & Destructor Documentation

## ◆ EmbeddedFrag() [1/5]

RDDepict::EmbeddedFrag::EmbeddedFrag | ( |  | ) |
| inline

Default constructor.

Definition at line 153 of file EmbeddedFrag.h.

Referenced by canonicalizeOrientation(), findCommonAtoms(), mergeNoCommon(), and mergeWithCommon().

## ◆ EmbeddedFrag() [2/5]

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

Initializer from a single atom id.

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

## ◆ EmbeddedFrag() [3/5]

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 correctness. 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

## ◆ EmbeddedFrag() [4/5]

RDDepict::EmbeddedFrag::EmbeddedFrag | ( | const RDKit::ROMol * | mol,
|  | const RDKit::VECT_INT_VECT & | fusedRings,
|  | bool | useRingTemplates )

Initializer from a set of fused rings.

ARGUMENTS:

Parameters

  mol | the molecule of interest
  fusedRings | a vector of rings, each ring is a list of atom ids
  useRingTemplates | whether to use ring system templates for generating initial coordinates

## ◆ EmbeddedFrag() [5/5]

RDDepict::EmbeddedFrag::EmbeddedFrag | ( | const RDKit::Bond * | dblBond | ) |
| explicit

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

ARGUMENTS:

Parameters

  dblBond | the double bond that is involved in the cis/trans configuration

## Member Function Documentation

## ◆ addNonRingAtom()

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

Add a new non-ring atom to this object.

## ◆ canonicalizeOrientation()

void RDDepict::EmbeddedFrag::canonicalizeOrientation | ( |  | ) |

References EmbeddedFrag().

## ◆ computeBox()

void RDDepict::EmbeddedFrag::computeBox | ( |  | ) |

compute a box that encloses the fragment

## ◆ computeDistMat()

void RDDepict::EmbeddedFrag::computeDistMat | ( | DOUBLE_SMART_PTR & | dmat | ) |

## ◆ expandEfrag()

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

Expand this embedded system by adding neighboring atoms or other embedded systems

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

## ◆ findCollisions()

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

## ◆ findCommonAtoms()

RDKit::INT_VECT RDDepict::EmbeddedFrag::findCommonAtoms | ( | const EmbeddedFrag & | efrag2 | ) |

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

References EmbeddedFrag().

## ◆ findNeighbor()

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

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

ARGUMENTS:

Parameters

  aid | the 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 embedded system.

## ◆ findNumNeigh()

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.

## ◆ flipAboutBond()

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

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

ARGUMENTS:

Parameters

  bondId | - the bond used as the mirror to flip
  flipEnd | - flip the atoms at the end of the bond

## ◆ getBoxNx()

double RDDepict::EmbeddedFrag::getBoxNx | ( |  | ) |
| inline

Definition at line 365 of file EmbeddedFrag.h.

## ◆ getBoxNy()

double RDDepict::EmbeddedFrag::getBoxNy | ( |  | ) |
| inline

Definition at line 367 of file EmbeddedFrag.h.

## ◆ getBoxPx()

double RDDepict::EmbeddedFrag::getBoxPx | ( |  | ) |
| inline

Definition at line 364 of file EmbeddedFrag.h.

## ◆ getBoxPy()

double RDDepict::EmbeddedFrag::getBoxPy | ( |  | ) |
| inline

Definition at line 366 of file EmbeddedFrag.h.

## ◆ GetEmbeddedAtom()

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

Definition at line 298 of file EmbeddedFrag.h.

References PRECONDITION.

## ◆ GetEmbeddedAtoms()

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

Definition at line 289 of file EmbeddedFrag.h.

## ◆ getMol()

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

Get the molecule that this embedded fragment belongs to.

Definition at line 261 of file EmbeddedFrag.h.

## ◆ isDone()

bool RDDepict::EmbeddedFrag::isDone | ( |  | ) |
| inline

If this fragment done for the final embedding.

Definition at line 258 of file EmbeddedFrag.h.

## ◆ markDone()

void RDDepict::EmbeddedFrag::markDone | ( |  | ) |
| inline

Mark this fragment to be done for final embedding.

Definition at line 255 of file EmbeddedFrag.h.

## ◆ mergeFragsWithComm()

void RDDepict::EmbeddedFrag::mergeFragsWithComm | ( | std::list< EmbeddedFrag > & | efrags | ) |

## ◆ mergeNoCommon()

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

  embObj | another EmbeddedFrag object to be merged with this object
  toAid | the atom in this embedded fragment to which the new object will be attached
  nbrAid | the atom in the other fragment to attach to

References EmbeddedFrag().

## ◆ mergeWithCommon()

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

  embObj | another EmbeddedFrag object to be merged with this object
  commAtms | a vector of ids of the common atoms

References EmbeddedFrag().

## ◆ mimicDistMatAndDensityCostFunc()

double RDDepict::EmbeddedFrag::mimicDistMatAndDensityCostFunc | ( | const DOUBLE_SMART_PTR * | dmat,
|  | double | mimicDmatWt )

## ◆ openAngles()

void RDDepict::EmbeddedFrag::openAngles | ( | const double * | dmat,
|  | unsigned int | aid1,
|  | unsigned int | aid2 )

## ◆ permuteBonds()

void RDDepict::EmbeddedFrag::permuteBonds | ( | unsigned int | aid,
|  | unsigned int | aid1,
|  | unsigned int | aid2 )

## ◆ randomSampleFlipsAndPermutations()

void RDDepict::EmbeddedFrag::randomSampleFlipsAndPermutations | ( | unsigned int | nBondsPerSample = 3,
|  | unsigned int | nSamples = 100,
|  | int | seed = 100,
|  | const DOUBLE_SMART_PTR * | dmat = nullptr,
|  | double | mimicDmatWt = 0.0,
|  | bool | permuteDeg4Nodes = false )

## ◆ Reflect()

void RDDepict::EmbeddedFrag::Reflect | ( | const RDGeom::Point2D & | loc1,
|  | const RDGeom::Point2D & | loc2 )

## ◆ removeCollisionsBondFlip()

void RDDepict::EmbeddedFrag::removeCollisionsBondFlip | ( |  | ) |

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

## ◆ removeCollisionsOpenAngles()

void RDDepict::EmbeddedFrag::removeCollisionsOpenAngles | ( |  | ) |

Remove collision by opening angles at the offending atoms.

## ◆ removeCollisionsShortenBonds()

void RDDepict::EmbeddedFrag::removeCollisionsShortenBonds | ( |  | ) |

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

## ◆ setupNewNeighs()

void RDDepict::EmbeddedFrag::setupNewNeighs | ( |  | ) |

helpers functions to

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

## ◆ Size()

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

the number of atoms in the embedded system

Definition at line 307 of file EmbeddedFrag.h.

## ◆ Transform()

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

Transform this object to a new coordinates system.

ARGUMENTS:

Parameters

  trans | : the transformation that need to be applied to the atoms in this object

## ◆ Translate()

void RDDepict::EmbeddedFrag::Translate | ( | const RDGeom::Point2D & | shift | ) |
| inline

Definition at line 291 of file EmbeddedFrag.h.

## ◆ updateNewNeighs()

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:

- EmbeddedFrag.h