In all the subsections below,double *rmat is a rotation matrix
(normally declared as double rmat[9]) and double *trans is a
translation matrix (normally declared as double trans[3]).
To obtain the distance between any two atoms (in Angstroms) use one of the following methods. Note that the methods that take only one parent object (molecule or conformer) only work when the 2 atoms of interest are both in that object. To get the distance between 2 atoms in different molecules, use the second or fourth versions.
double OEGetDistance(const OEMolBase &,
const OEAtomBase *a,
const OEAtomBase *b);
double OEGetDistance(const OEMolBase &ma,
const OEAtomBase *a,
const OEMolBase &mb,
const OEAtomBase *b);
double OEGetDistance(const OEConfBaseT<float,3> &conf,
const OEAtomBase *a,
const OEAtomBase *b);
double OEGetDistance(const OEConfBaseT<float,3> &ca,
const OEAtomBase *a,
const OEConfBaseT<float,3> &cb,
const OEAtomBase *b);
To obtain the squared distance between any to atoms (in Angstroms
),
use one of the following methods. Note that the methods that take only
one parent object (molecule or conformer) only work when the 2 atoms
of interest are both in that object. To get the distance between 2
atoms in different molecules, use the second or fourth versions.
double OEGetDistance2(const OEMolBase &,
const OEAtomBase *a,
const OEAtomBase *b);
double OEGetDistance2(const OEMolBase &ma,
const OEAtomBase *a,
const OEMolBase &mb,
const OEAtomBase *b);
double OEGetDistance2(const OEConfBaseT<float,3> &conf,
const OEAtomBase *a,
const OEAtomBase *b);
double OEGetDistance2(const OEConfBaseT<float,3> &ca,
const OEAtomBase *a,
const OEConfBaseT<float,3> &cb,
const OEAtomBase *b);
These next methods can be used to obtain the angle (in radians) between any three bonds. As before, if the atoms are in difference molecules or conformers, then the parent of each atom must be given along with that atom.
double OEGetAngle(const OEMolBase &,
const OEAtomBase *a,
const OEAtomBase *b,
const OEAtomBase *c);
double OEGetAngle(const OEMolBase &ma, const OEAtomBase *a,
const OEMolBase &mb, const OEAtomBase *b,
const OEMolBase &mc, const OEAtomBase *c);
double OEGetAngle(const OEConfBaseT<float,3> &conf,
const OEAtomBase *a,
const OEAtomBase *b,
const OEAtomBase *c);
double OEGetAngle(const OEConfBaseT<float,3> &ca, const OEAtomBase *a,
const OEConfBaseT<float,3> &cb, const OEAtomBase *b,
const OEConfBaseT<float,3> &cc, const OEAtomBase *c);
The OEGetTorsion function returns a value in radians from +PI to - PI for the torsion formed by atoms a, b, c, and d in a molecule (or confomer).
double OEGetTorsion(const OEMolBase &,
const OEAtomBase *a,
const OEAtomBase *b,
const OEAtomBase *c,
const OEAtomBase *d);
double OEGetTorsion(const OEConfBaseT<float,3> &,
const OEAtomBase *a,
const OEAtomBase *b,
const OEAtomBase *c,
const OEAtomBase *d);
The OEGetAbsTorsion function returns the absolute value (from 0 to +PI) of the torsion formed by atoms a, b, c, and d. This function is more efficient than OEGetTorsion.
double OEGetAbsTorsion(const OEMolBase &,
const OEAtomBase *a,
const OEAtomBase *b,
const OEAtomBase *c,
const OEAtomBase *d);
double OEGetAbsTorsion(const OEConfBaseT<float,3> &,
const OEAtomBase *a,
const OEAtomBase *b,
const OEAtomBase *c,
const OEAtomBase *d);
bool OESetAngle(OEMolBase& mol,
OEAtomBase* a,
OEAtomBase* b,
OEAtomBase* c,
double ang);
The OESetTorsion function sets the torsion angle defined by atoms a, b, c, and d. The c-d side is rotated, along with all atoms attached to it. There must be a bond between atoms b and c and that bond must not be part of a ring.
bool OESetTorsion(OEMolBase &,
OEAtomBase *a,
OEAtomBase *b,
OEAtomBase *c,
OEAtomBase *d,
double ang);
bool OESetTorsion(OEConfBaseT<float,3> &,
OEAtomBase *a,
OEAtomBase *b,
OEAtomBase *c,
OEAtomBase *d,
double ang);
The OETranslate function translates the molecule by the vector v that is passed. It is advisable that the units being used for the translation are consistent with the units that were used to set the coordinates.
OETranslate(mol, trans)
OETranslate(conf, trans)
OETranslate(mcmol, trans)
The OERotate function rotates the molecule by the rotation matrix that is passed. The rotation is done by matrix multiplication, such that xyz' = rmat * xyz, where xyz' are the new coordinates, rmat is the rotation matrix, and xyz are the original coordinates.
OERotate(mol, rmat)
OERotate(conf, rmat)
OERotate(mcmol, rmat)
The OEEulerRotate function rotates the molecule using the angles arrays that is passed, where angles is at least of length 3 and contains the angles of rotation in radians. The first element defines the rotation about the z axis, the second element defines the rotation about the x' axis, and the third element defines the rotationa about the z' axis. The rotations are done in that order.
OEEulerRotate(mol, angles)
OEEulerRotate(conf, angles)
OEEulerRotate(mcmol, angles)
The OECenter moves the molecule so that its center of mass is located at the origin. If an optional array t is passed in, it will be filled with a vector that describes the translation to move the moecule back to its original position, as described in the API manual.
OECenter(mol, t)
OECenter(conf, t)
OECenter(mcmol, t)
The OERMSD function returns the root mean square deviation between ``things.'' The first version in the list is for calculating the RMSD between two molecules. The second version is for calculating the RMSD between two substructures of molecules. The final version in the list is for calculating the RMSD between two sets of Cartesian coordinates, which are passed in via the arrays. The API manual contains the finer details of using these functions.
OERMSD(mol1,mol2,automorphflag=True,heavyOnly=True, overlayflag=False,rmat=None,trans=None)
OERMSD(mol1,mol2,OEMatchBase,overlayflag=False,rmat=None,trans=None)
OERMSD(OEDoubleArray1,OEDoubleArray2,overlayflag=False,rmat=None,trans=None)