[MMTK] how does removeObject works?

Enrico Guarnera enrico.guarnera at gmail.com
Thu Aug 28 03:38:55 UTC 2014


It is not clear to me how the removeObject function works… If I load a
multi chain pdb such as

universe = InfiniteUniverse(CalphaForceField(2.5))
universe.protein = Protein('pdbname, model='calpha')

Suppose this has 6 chains in it, say now that I want to delete the 2nd
chain from the universe, how do I do that?

This did not work to me:


ValueError Traceback (most recent call last)
<ipython-input-48-fbb49aaaad9a> in <module>() 2
 2 chainB=universe.protein[1]
----> 4 universe.removeObject(chainB)
/Users/guarnera/env/lib/python2.7/site-packages/MMTK/Universe.pyc in
removeObject(self, object) 225 if
 225 if ChemicalObjects.isChemicalObject(object):
226 if object.parent != self:
--> 227 raise ValueError(`object` + ' is not in this universe.')
228 object.parent = None
229 self._objects.removeObject(object)
ValueError: PeptideChain .P2 is not in this universe.

Any hint?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://starship.python.net/pipermail/mmtk/attachments/20140828/12bc8468/attachment.html>

More information about the mmtk mailing list