OEConfRMSD

class OEConfRMSD

The OEConfRMSD class provides fast RMSD calculation of conformers of the same molecule. During the RMSD calculation the automorphisms of the molecule graph is taken into consideration. Automorphisms are the symmetry related transformations of a molecule which can result in anomalously high RMSDs if not properly treated. For instance, t-butyl-benzene has a three-fold automorphism around the t-butyl group and a two-fold automorphism around the benzene ring.

Constructors

OEConfRMSD(mol: Union[OEGraphMol,OEMol,OEQMol],
           opts: OEConfRMSDOptions = OEConfRMSDOptions()) -> OEConfRMSD

Constructs an OEConfRMSD object using a OEMolBase and an optional OEConfRMSDOptions.

See also

CalculateRMSD

CalculateRMSD(refconf: OEConfBase, fitconf: OEConfBase) -> float
CalculateRMSD(refcoords: OEDoubleArray, fitcoords: OEDoubleArray) -> float

Calculates the RMSD between the two conformations. The inputs can be either the OEConfRMSD objects or their coordinates.

For the second overload, the length of the arrays should be 3*MaxAtomIdx and should contain the Cartesian coordinates of the two conformers being assessed.

GetOptions

GetOptions() -> OEConfRMSDOptions

Returns the options used to set up the OEConfRMSD object.

See also

IsValid

IsValid() -> bool

Returns whether the OEConfRMSD object is valid.

MinimizeRMSD

MinimizeRMSD(refconf: OEConfBase, fitconf: OEConfBase,
             trans: OETrans) -> float
MinimizeRMSD(refcoords: OEDoubleArray, fitcoords: OEDoubleArray,
             trans: OETrans) -> float

The function returns the minimum RMSD between the two conformations and reports the translation and rotation, trans, required to give this minimum RMSD.

For the second overload, the length of the arrays should be 3*MaxAtomIdx and should contain the Cartesian coordinates of the two conformers being assessed.

NumAutomorphs

NumAutomorphs() -> int

The function returns the number of automorphisms taken into account during the RMSD calculation.

Example:

The following example finds the two conformers of a molecule that have the smallest RMSD.

mol = oechem.OEMol()
oechem.OEReadMolecule(ifs, mol)
crmsd = oechem.OEConfRMSD(mol)

confiidx = 0
confjidx = 0
minRMSD = float("inf")
confs = list(mol.GetConfs())
for ci in range(len(confs)):
    for cj in range(ci + 1, len(confs)):
        trans = oechem.OETrans()
        dist = crmsd.MinimizeRMSD(confs[ci], confs[cj], trans)
        if dist < minRMSD:
            minRMSD = dist
            confiidx = ci
            confjidx = cj

print('The closest conformers are ', confiidx, ' and ', confjidx, end=" ")
print(' with RMSD = ', minRMSD)

See also