openmm / pdbfixer

PDBFixer fixes problems in PDB files
Other
461 stars 115 forks source link

PDBX/mmCIF reading error : asymIdCol = modData.getAttributeIndex('label_asym_id') #188

Closed MauriceKarrenbrock closed 4 years ago

MauriceKarrenbrock commented 4 years ago

Hello, I searched for a similar issue but could not find it. I would like to use pdbfixer on a pdbx/mmcif file. But when I try to read it i get this error message:

Traceback (most recent call last):
  File "path/to/my/executable.py", line 119, in <module>
    fixer = pdbfixer.PDBFixer(pdbxfile= f)
  File "path/to/my/conda/env/lib/python3.6/site-packages/pdbfixer/pdbfixer.py", line 254, in __init__
    self._initializeFromPDBx(pdbxfile)
  File "path/to/my/conda/env/lib/python3.6/site-packages/pdbfixer/pdbfixer.py", line 335, in _initializeFromPDBx
    asymIdCol = modData.getAttributeIndex('label_asym_id')
AttributeError: 'NoneType' object has no attribute 'getAttributeIndex'

The code I wrote is incredibly simple (1fkb.cif is in my working dir, downloaded from the wwPDB database):

import pdbfixer
with open('1fkb.cif', 'r') as f:
    fixer = pdbfixer.PDBFixer(pdbxfile= f)

I am using pdbfixer version 1.6 and openmm version 7.4.0 both installed through conda

Any tips on what I got wrong or on how to avoid the problem?

LSB Version:    n/a
Distributor ID: openSUSE project
Description:    openSUSE Leap 42.3
Release:        42.3
Codename:       n/a
peastman commented 4 years ago

Thanks! The fix is in #189.

MauriceKarrenbrock commented 4 years ago

Thank you very much!