[MMTK] PDB file
Shirley Hui
shirleyhui at alumni.uwaterloo.ca
Tue May 11 01:51:48 CEST 2004
I am trying to read in a PDB fille.
My code looks like this:
from MMTK import *
from MMTK.PDB import PDBConfiguration
from MMTK.ForceFields import Amber94ForceField
import sys
conf = PDBConfiguration('alanin.pdb')
chains = conf.createPeptideChains()
universe = InfiniteUniverse(Amber94ForceField())
universe.addObject(chains)
print universe.energy()
print universe.energyTerms()['electrostatic']
When I try and specify the PDB file to be something that was not included in the source distribution (i.e. a configuration that is not 2YCC.pdb, insulin.pdb etc), I get errors. For example, I got alanin.pdb from the protein databank. I put this file in C:\Python23\Lib\site-packages\MMTK\Database\PDB. When I run the code as above, I get the following error:
Traceback (most recent call last):
File "C:\PYTHON23\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript
exec codeObject in __main__.__dict__
File "C:\Python23\Scripts\shirl.py", line 6, in ?
File "c:\python23\Lib\site-packages\MMTK\PDB.py", line 147, in __init__
Scientific.IO.PDB.Structure.__init__(self, filename)
File "C:\PYTHON23\Lib\site-packages\Scientific\IO\PDB.py", line 890, in __init__
self.parseFile(PDBFile(filename))
File "C:\PYTHON23\Lib\site-packages\Scientific\IO\PDB.py", line 1041, in parseFile
type, data = file.readLine()
File "C:\PYTHON23\Lib\site-packages\Scientific\IO\PDB.py", line 152, in readLine
data = {'serial_number': line[1],
File "C:\PYTHON23\Lib\site-packages\Scientific\IO\FortranFormat.py", line 122, in __getitem__
return self.data[i]
IndexError: list index out of range
If instead I have insulin.pdb instead of alanin.pdb, it works.
Is there something I am doing wrong? I even created an evironment variable in my PATH called MMTKPATH according to this link: http://starship.python.net/crew/hinsen/mmtk_manual/database.html
I tried setting this env variable to be: C:\Python23\Lib\site-packages\MMTK\Database\PDB and C:\Python23\Lib\site-packages\MMTK\Database, but neither work??
Thanks in advance,
shirley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://starship.python.net/pipermail/mmtk/attachments/20040510/c746615f/attachment.htm
More information about the mmtk
mailing list