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;
OEReadMolecule(ifs, mol);
OEConfRMSD crmsd(mol);

double minRMSD = numeric_limits<double>::max();
auto confiIdx = 0u;
auto confjIdx = 0u;

for (OEIter<const OEConfBase> confi = mol.GetConfs(); confi; ++confi)
{
  OEIter<const OEConfBase> confj = confi.Copy();
  ++confj;
  for (; confj; ++confj)
  {
    OETrans trans;
    const double dist = crmsd.MinimizeRMSD(confi, confj, trans);

    if (dist < minRMSD)
    {
      minRMSD = dist;
      confiIdx = confi->GetIdx();
      confjIdx = confj->GetIdx();
    }
  }
}

cout << "The closest conformers are " << confiIdx << " and " << confjIdx;
cout << " with RMSD = " << minRMSD << endl;

See also