Acellera / moleculekit

MoleculeKit: Your favorite molecule manipulation kit
Other
198 stars 37 forks source link

reading ligand cif #83

Closed MaciejMajew closed 2 years ago

MaciejMajew commented 2 years ago

Moleculekit doesn't read ligand cif files from pdb. the error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-f1b239f34473> in <module>
----> 1 mol = Molecule('URF.cif')

/shared/maciej/SOFT/miniconda3/envs/htmd_pymol/lib/python3.7/site-packages/moleculekit/molecule.py in __init__(self, filename, name, **kwargs)
    272 
    273         if filename is not None:
--> 274             self.read(filename, **kwargs)
    275 
    276     @staticmethod

/shared/maciej/SOFT/miniconda3/envs/htmd_pymol/lib/python3.7/site-packages/moleculekit/molecule.py in read(self, filename, type, skip, frames, append, overwrite, keepaltloc, guess, guessNE, _logger, **kwargs)
   1110             for rr in readers:
   1111                 try:
-> 1112                     mol = rr(fname, frame=frame, topoloc=tmppdb, **kwargs)
   1113                 except FormatError:
   1114                     continue

/shared/maciej/SOFT/miniconda3/envs/htmd_pymol/lib/python3.7/site-packages/moleculekit/readers.py in PDBXMMCIFread(filename, frame, topoloc)
   1941     firstmodel = None
   1942     atom_site = dataObj.getObj("atom_site")
-> 1943     for i in range(atom_site.getRowCount()):
   1944         row = atom_site.getRow(i)
   1945         modelid = row[atom_site.getAttributeIndex("pdbx_PDB_model_num")]

AttributeError: 'NoneType' object has no attribute 'getRowCount'

URF.zip

MaciejMajew commented 2 years ago

might be useful to also retrieve the ligand by name from PDB

stefdoerr commented 2 years ago

Fixed the reader. Will also try to add a writer so that I can use that for ligand storage.

MaciejMajew commented 2 years ago

Issue with reading pymol generated cif tmp.zip :

stefdoerr commented 2 years ago

Fixed and fixed