[MMTK] how does removeObject works?

Konrad Hinsen research at khinsen.fastmail.net
Thu Aug 28 07:19:55 UTC 2014

Enrico Guarnera writes:

 > 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:
 > chainB=universe.protein[1]
 > universe.removeObject(chainB)

You can only remove objects from a universe that are in it. Your
chainB is not an object in your universe, it's a subset of an object
in your universe, the object being universe.protein.

There is no way to remove parts of ChemicalObjects in MMTK, because
that might result in undefined leftovers. Consider the case that your
chainB has disulfide bonds to another chain. What should happen to
these bonds when you remove the chain?

There are two ways to handle your situation:

1) Construct the protein without chainB right from the start. This means you
   have to replace the standard Protein constructor by a more low-level
   sequence of actions: read in the PDB file, generating a PDBConfiguration,
   and then construct a protein object containing a subset of the chains.
   There is an example for this approach in the MMTK distribution.

2) Don't make a Protein object at all, but make PeptideChain objects for each
   chain that you place directly into the universe. You can then remove any
   chain as you like.

In the second case, note that MMTK will not check for disulfide bonds at all.
In the first case, it will create disulfide bonds for the chain subset that
you provide, so this is the better approach unless you really need to remove
a chain after having constructed your universe.

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
ORCID: http://orcid.org/0000-0003-0330-9428
Twitter: @khinsen

More information about the mmtk mailing list