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(const OEMolBase& mol,
           const OEConfRMSDOptions &opts=OEConfRMSDOptions())

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

See also

CalculateRMSD

double CalculateRMSD(const OEConfBase *refconf, const OEConfBase *fitconf) const
double CalculateRMSD(const double* refcoords, const double* fitcoords) const

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

OEConfRMSDOptions GetOptions() const

Returns the options used to set up the OEConfRMSD object.

See also

IsValid

bool IsValid() const

Returns whether the OEConfRMSD object is valid.

MinimizeRMSD

double MinimizeRMSD(const OEConfBase *refconf, const OEConfBase *fitconf,
                    OETrans &trans) const
double MinimizeRMSD(const double* refcoords, const double* fitcoords,
                    OETrans& trans) const

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

unsigned int NumAutomorphs() const

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.

OEMol mol = new OEMol();
OEChem.OEReadMolecule(ifs, mol);
OEConfRMSD crmsd = new OEConfRMSD(mol);

List<OEConfBase> conflist = new List<OEConfBase>();
foreach (OEConfBase conf in mol.GetConfs())
  conflist.Add(conf);

int length = conflist.Count;
double minRMSD = double.MaxValue;
uint confiIdx = 0;
uint confjIdx = 0;
for (int i = 0; i < length - 1; i++)
{
  for(int j = i + 1; j < length; j++)
  {
    OETrans trans = new OETrans();
    double dist = crmsd.MinimizeRMSD(conflist[i], conflist[j], trans);
    if (dist < minRMSD)
    {
      minRMSD = dist;
      confiIdx = conflist[i].GetIdx();
      confjIdx = conflist[j].GetIdx();
    }
  }
}

System.Console.WriteLine("The closest conformers are " + confiIdx + " and " + confjIdx +
      " with RMSD = " + minRMSD);

See also