[MMTK] Using MMTK

Matias Saavedra matias_saavedra at yahoo.com
Wed Jul 20 17:55:08 CEST 2005


> 
> Here is a simple example that changes everything to
> glycine. It leaves  
> the H atoms undefined when the original residue is
> proline. I guess one  
> can fix that  with a special treatment for the
> peptide group in  
> proline, but I don't have the time at the moment.

Ok. Thanks for the example, i got it!!! Its usefull to
me. But i have little doubts related to the code:
 
 
> from MMTK import *
> from MMTK.Proteins import Protein, Residue
> 
> def mutateResidue(residue, new_residue_type,
> atom_mapping):
>      if hasattr(residue.peptide, 'H_3'):
> 	new_residue_type += '_nt'
>      elif hasattr(residue.peptide, 'O_2'):
> 	new_residue_type += '_ct'
Why do you make those tests?

>      print "Changing %s into %s" %
> (residue.type.name, new_residue_type)
>      new_residue = Residue(new_residue_type,
> residue.model)
>      for g in ['peptide', 'sidechain']:
> 	g_old = getattr(residue, g)
> 	g_new = getattr(new_residue, g)
> 	atoms = map(lambda a: a.name, getattr(g_new,
> 'atoms'))
> 	for a in atoms:
> 	    an = getattr(g_new, a)
> 	    ao = None
> 	    try:
> 		ao = getattr(g_old, a)
> 	    except AttributeError:
> 		if g == 'sidechain':
> 		    try:
> 			a = atom_mapping[a]
> 			ao = getattr(g_old, a)
> 		    except KeyError:
> 			pass
Why do you make the test with atom_mapping?

Thanks a lot Konrad.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the mmtk mailing list