[MMTK] MMTK and missing residues

Sabine Beraud Sabine Beraud <sabine@nmr.clarku.edu>
Wed, 23 Oct 2002 15:21:04 -0400 (EDT)


Hi Konrad,


Thanks again for your precious help. However, as you can guess, I still did not 
resolve my problem since the 2 solutions that you proposed me (and which would 
be perfect for me) give me error messages that I am not able to resolve (yes, 
yes I tried!!).

1. In the first solution:

  for chain in protein:
      for residue in chain:
          chain.setBondAttributes()
          chain.peptide.findHydrogenPositions()
          chain.clearBondAttributes()
          
   If protein = Protein(new_file), the message error is: 
    residue.setBondAttributes()
  File 
"/opt/gnu/lib/python2.0/Python-2.0/lib/python2.0/site-packages/MMTK/ChemicalObje
cts.py", line 52, in __getattr__
    return getattr(self.type, attr)
AttributeError: 'GroupType' instance has no attribute 'setBondAttributes'

   If protein = PeptideChain(configuration.peptide_chains[0]), the message error 
is: 
    for residue in chain:
  File 
"/opt/gnu/lib/python2.0/Python-2.0/lib/python2.0/site-packages/MMTK/ChemicalObje
cts.py", line 50, in __getattr__
    raise AttributeError
AttributeError


2. In the second solution:
   for atom in chain.atomList():
       if atom.position() is None and atom.symbol != 'H':
           atom.setPosition(Vector(42, 99, 113))
           atom.fake_position = 1
       else:
           atom.fake_position = 0
   chain.findHydrogenPositions()
   for atom in chain.atomList():
       if atom.fake_position:
           atom.setPosition(None)
           del atom.fake_position

          
   The message error is: 
    chain.findHydrogenPositions()
  File 
"/opt/gnu/lib/python2.0/Python-2.0/lib/python2.0/site-packages/MMTK/ChemicalObje
cts.py", line 637, in findHydrogenPositions
    self._C4oneH(a, known, list)
  File 
"/opt/gnu/lib/python2.0/Python-2.0/lib/python2.0/site-packages/MMTK/ChemicalObje
cts.py", line 687, in _C4oneH
    n1 = (known[1].position()-r).normal()
  File 
"/opt/gnu/lib/python2.0/Python-2.0/lib/python2.0/site-packages/Scientific/Geomet
ry/VectorModule.py", line 142, in normal
    raise ZeroDivisionError, "Can't normalize a zero-length vector"
ZeroDivisionError: Can't normalize a zero-length vector


As I am still not very familiar with MMTK, could you please help me once again??
Thanks in advance,

Sabine

-----------------------------------------------------
Sabine Beraud
Carlson School of Chemistry                          
Clark University                                     
950 Main Street
Worcester, MA 01610-1477
USA
Tel: +1-508-793-7112            Fax: +1-508-793-8861 
E-mail: sabine@nmr.clarku.edu              
-----------------------------------------------------