As Tsjerk pointed out, there was a mistake in the code. Just for the record this is the right function:
pdb2entry = { "1ONE": "1ONE_A", "2ONE": "2ONE_A" } # a function to measure Ca distances of oposite pairs of superimpossed chains (the proteins must have the same aa composition) def check_for_symmetry(tstruct, qstruct): # align the pair cmd.fetch(tstruct) cmd.extract(pdb2entry[tstruct]+"1", tstruct + " and chain "+ pdb2entry[tstruct][-1:] + " and not hetatm") cmd.fetch(qstruct) cmd.extract(pdb2entry[qstruct]+"1", qstruct +" and chain "+ pdb2entry[qstruct][-1:] + " and not hetatm") cmd.delete(tstruct) cmd.delete(qstruct) print "Aligning "+pdb2entry[tstruct]+"1"+" with "+pdb2entry[qstruct]+"1" cmd.align(pdb2entry[tstruct]+"1", pdb2entry[qstruct]+"1") #cmd.do("cealign "+pdb2entry[qstruct]+"1, "+pdb2entry[tstruct]+"1") # align the symmetric pair cmd.fetch(tstruct) cmd.extract(pdb2entry[tstruct]+"2", tstruct + " and chain "+ pdb2entry[tstruct][-1:] + " and not hetatm") cmd.fetch(qstruct) cmd.extract(pdb2entry[qstruct]+"2", qstruct +" and chain "+ pdb2entry[qstruct][-1:] + " and not hetatm") print "Aligning "+pdb2entry[qstruct]+"1"+" with "+pdb2entry[tstruct]+"1" cmd.align(pdb2entry[qstruct]+"2", pdb2entry[tstruct]+"2") #cmd.do("cealign "+pdb2entry[qstruct]+"2, "+pdb2entry[tstruct]+"2") # measure distances pymol.stored.protein_dict = {} cmd.iterate(pdb2entry[tstruct]+"1", "stored.protein_dict[(chain,resi)]=1") Residues = pymol.stored.protein_dict.keys() Residues.sort() RMSD = 0 for res in Residues: chain = res[0] resi = res[1] dist1 = cmd.distance('tmp',pdb2entry[tstruct]+"1 and chain "+chain+" and resi "+resi+" and name ca",pdb2entry[qstruct]+"1 and chain "+chain+" and resi "+resi+" and name ca") dist2 = cmd.distance('tmp',pdb2entry[tstruct]+"2 and chain "+chain+" and resi "+resi+" and name ca",pdb2entry[qstruct]+"2 and chain "+chain+" and resi "+resi+" and name ca") print "The difference in distance betweem residue IDs ", resi," is : ",dist1, "-",dist2," = ",dist1-dist2 RMSD += (dist1-dist2)**2 RMSD = sqrt(RMSD/len(Residues)) print "RMSD of distances between identical residues in 1ONE x 2ONE and this in 2ONE x 1ONE: ", RMSD check_for_symmetry("1ONE", "2ONE") After this correction the RMSD falls to 2.06853295972e-06, which a reasonably good number. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net