[MMTK] applyto with c_terminus=1 protein structure

Konrad Hinsen research at khinsen.fastmail.net
Fri Mar 25 14:18:08 UTC 2011

On 25 Mar, 2011, at 13:42 , ra.biehl wrote:

> 3231 is the number of hydrogens, that's right.

Do you need those hydrogens for your analysis? Otherwise, the simplest solution would be to build your peptide chains without hydrogens (model='no_hydrogens').

> Is it an option to include a function applyTo in a PeptideChain object?

That should be doable, even for general ChemicalObjects, as long as the two have the same structure. For peptide chains it is even rather simple, because the structure is rigid and simple. Here is the code:

from MMTK import *
from MMTK.Proteins import PeptideChain, Protein

prot1 = Protein('insulin')
prot2 = Protein('insulin')
for atom in prot2.atomList():

def copyPositions(chain1, chain2):
    for res1, res2 in zip(chain1, chain2):
        for subgroup in ['peptide', 'sidechain']:
            copyAtomPositions(getattr(res1, subgroup),
                              getattr(res2, subgroup))

def copyAtomPositions(group1, group2):
    atom_names = [a.name for a in group1.atomList()]
    assert sorted(atom_names) == sorted([a.name for a in group2.atomList()])
    for name in atom_names:
        getattr(group2, name).setPosition(getattr(group1, name).position())

copyPositions(prot1[0], prot2[0])

print prot1[0].centerOfMass()
print prot2[0].centerOfMass()

Konrad Hinsen
Centre de Biophysique Moléculaire, CNRS Orléans
Synchrotron Soleil - Division Expériences
Saint Aubin - BP 48
91192 Gif sur Yvette Cedex, France
Tel. +33-1 69 35 97 15
E-Mail: research AT khinsen DOT fastmail DOT net

More information about the mmtk mailing list