Open ddcas9 opened 2 years ago
I just tried the line you quoted and it worked correctly. What PDB file are you trying to load? Possibly the problem is specific to that PDB ID.
fixer = PDBFixer(pdbid = '3uo4') Facing the same error. With all PDB ids.
AttributeError Traceback (most recent call last)
<timed exec> in <module>
~/miniconda3/lib/python3.9/site-packages/pdbfixer/pdbfixer.py in __init__(self, filename, pdbfile, pdbxfile, url, pdbid)
263 self._initializeFromPDBx(contents)
264 else:
--> 265 self._initializeFromPDB(StringIO(contents))
266
267 # Check the structure has some atoms in it.
~/miniconda3/lib/python3.9/site-packages/pdbfixer/pdbfixer.py in _initializeFromPDB(self, file)
283
284 structure = PdbStructure(file)
--> 285 pdb = app.PDBFile(structure)
286 self.topology = pdb.topology
287 self.positions = pdb.positions
~/miniconda3/lib/python3.9/site-packages/openmm/app/pdbfile.py in __init__(self, file, extraParticleIdentifier)
~/miniconda3/lib/python3.9/site-packages/openmm/app/internal/pdbstructure.py in __init__(self, input_stream, load_all_models, extraParticleIdentifier)
~/miniconda3/lib/python3.9/site-packages/openmm/app/internal/pdbstructure.py in _load(self, input_stream)
AttributeError: 'Model' object has no attribute 'decode'
That's odd. I was able to get this to run on osx
with openmm 7.7.0, pdbfixer 1.8.1, and python 3.9.9 on the first try:
>>> from pdbfixer import PDBFixer
>>> fixer = PDBFixer(pdbid = '3uo4')
Could you do a complete conda environment dump (conda env export
)?
Attaching the output for conda env export. conda_env.txt
You have very old versions of both PDBFixer and OpenMM. You can update them with
conda update -c conda-forge openmm pdbfixer
In pdbfixer 1.6, 1.7 and 1.8 and openmm 7.5.1 (and 7.6 running pdbfixer 1.8), The following line:
fails with the trace (using pdbfixer 1.7 and openmm 7.5.1):
The relevant line in
_load(self, input_stream)
is discussed in #81, though I don't understand where_load
is called here. On line 285, aPdbStructure
is passed toPDBFile
, but thePdbStructure
constructor isn't then called with thisPdbStructure
instance as an argument. Does the error actually happen on 284?Thank you!