Question: Module to RMSD two proteins with Python?
gravatar for becko
4.8 years ago by
becko0 wrote:

I have two protein structures in PDB format. The two structures refer to two conformations of the same protein. I want to calculate the RMSD between them.

Is there Python module that will allow me to do this?

protein-structure python • 6.8k views
ADD COMMENTlink modified 3.6 years ago by Eric T.2.6k • written 4.8 years ago by becko0

Hello j.cossio.diaz!

It appears that your post has been cross-posted to another site:

This is typically not recommended as it runs the risk of annoying people in both communities.

ADD REPLYlink written 4.8 years ago by Pierre Lindenbaum131k
You can try pymol or tm align
ADD REPLYlink written 4.8 years ago by Pappu1.9k
You can try pymol or tm align
ADD REPLYlink written 4.8 years ago by Pappu1.9k
gravatar for Poorya Parvizi
4.8 years ago by
The University of Edinburgh
Poorya Parvizi60 wrote:

Hi j.cossio.diaz

I struggled with the same problem and i find two module which can solve structural protein alignment in python.

  1. Please take a look to the link:

    You can explore the algorithm by using examples, which are exist in the zip file. The only think you have to do is extract the "ATOMS" with x,y,z coordinates from PDB files.

  2. There is also a tool call biopython, which have a Bio.PDB module to align PDB files. here is the link:

ADD COMMENTlink modified 10 months ago by RamRS30k • written 4.8 years ago by Poorya Parvizi60
gravatar for crooveck
3.6 years ago by
crooveck10 wrote:

You can use PyMOL to calculate alignment. To do this follow this steps:

  1. run PyMOL
  2. type this command to load your proteins: fetch pdbId1 and fetch pdbId2 *
  3. Use command: rms_cur pdbId1, pdbId2 to calculate RMSD value betweend your structures


*where pdbId1 and pdbId2 is identifier of your protein in PDB database.

ADD COMMENTlink written 3.6 years ago by crooveck10
gravatar for Joe
3.6 years ago by
United Kingdom
Joe18k wrote:

A UCSF Chimera option:

(Taken from a more complicated script I wrote for use with pychimera here: script, pychimera)

NB, pychimera takes a little more involved installation compared to pymol, but I really like it.

The code below should work inside chimera's python interpreter though I believe with no extra configuration.

from MatchMaker import (match,

all_models = chimera.openModels.list(modelTypes=[chimera.Molecule])
mod0 = all_models[0]
mod1 = all_models[1]

for atoms1, atoms2, rmsd, fullRmsd in match(CP_BEST,[mod0, mod1],defaults[MATRIX],

   mol0_name = atoms2[0].molecule
   mol1_name = atoms1[0].molecule + "\t" + + "\t" + str(rmsd))
ADD COMMENTlink modified 3.6 years ago • written 3.6 years ago by Joe18k
gravatar for Eric T.
3.6 years ago by
Eric T.2.6k
San Francisco, CA
Eric T.2.6k wrote:

In Biopython, the Bio.SVDSuperimposer class will quickly align the two PDB structures and compute the RMSD. See this Bio.PDB FAQ, and search the page for "RMSD", or read the PDB section of the Biopython tutorial.

ADD COMMENTlink written 3.6 years ago by Eric T.2.6k

Hi, I know this might be very late to comment to it, but Bio.SVDSuperimposer does not seem to rotate the proteins to get the lowest RMSD: i get RMSD = 0.2 for chains that when aligned in PyMOL give RMSD = 0.06

here is my code:

fixed = Bio.PDB.Selection.unfold_entities(Bio.PDB.Polypeptide.PPBuilder().build_peptides(Bio.PDB.PDBParser(QUIET = True).get_structure('X' , '1A00_B.pdb') , aa_only = True)[0], 'A')
moving = Bio.PDB.Selection.unfold_entities(Bio.PDB.Polypeptide.PPBuilder().build_peptides(Bio.PDB.PDBParser(QUIET = True).get_structure('X' , '1A00_D.pdb') , aa_only = True)[0], 'A')

sup = Bio.PDB.Superimposer()
sup.set_atoms(fixed , moving)


the "sup.apply(moving)" line does not seem to do anything.

Is this the correct way to find the RMSD between two structures in Biopython? is there a better script to write? or a better module to use than Biopython?

ADD REPLYlink modified 2.9 years ago • written 2.9 years ago by ac.research10
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1427 users visited in the last hour