[MMTK] how to calculate RMS value for residue

Konrad Hinsen hinsen@cnrs-orleans.fr
20 Oct 2002 13:57:10 +0200


Fan Gao <Gao.Fan@mayo.edu> writes:

> Hi, all
> I found MMTK can calculate RMS values between peptide chains (in the
> Examples of MMTK). But I am not sure how to calculate residue based
> RMS value ?

You mean RMS differences for a single residue? Or RMS differences
using a one-point-per-residue model?

> I tried the following:
> configuration1 = PDBConfiguration('1.pdb')
> configuration1 = PDBConfiguration('2.pdb')
> residue_configuration1 = configuration1.residues[0]
> residue_configuration2 = configuration2.residues[0]
> However, I don't know what to do next.  ***1.pdb and 2.pdb are
> different proteins

If they are different proteins, then at least the two residues must be
of the same type.

There are ways to construct models for a fake peptide chain containing
just your residue and then apply the standard RMS routine. However,
that's overkill if all you want is just the RMS difference.
Straightforward Python code is simpler here:

  rms_sq = 0.
  for atom_name in residue_configuration1.atoms.keys():
      r1 = residue_configuration1.atoms[atom_name].position
      r2 = residue_configuration2.atoms[atom_name].position
      dr = r2-r1
      rms_sq = rms_sq + dr*dr
  rms = Numeric.sqrt(rms_sq/len(residue_configuration1.atoms))

Note that you don't even need MMTK for that, the class PDBConfiguration
is nothing but a minimally enhanced version of Scientific.IO.PDB.Structure
from ScientificPython.

Konrad.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                            | E-Mail: hinsen@cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24
Rue Charles Sadron                       | Fax:  +33-2.38.63.15.17
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais
-------------------------------------------------------------------------------