Error in Molecule and Smallmol while working with PDBBind dataset
I was trying to voxelize the PDBBind complexes with moleculekit but for most of the complexes, Moleculekit is throwing errors while building the Molecule or SmallMol object. Here is my code:
from moleculekit.molecule import Molecule
from moleculekit.tools.voxeldescriptors import getVoxelDescriptors, viewVoxelFeatures
from moleculekit.tools.atomtyper import prepareProteinForAtomtyping
from moleculekit.smallmol.smallmol import SmallMol
from moleculekit.home import home
import os
data_dir = "../../dataset/refined-set-2016"
protein_files = sorted(glob('../../dataset/refined-set-2016/*/*protein.pdb'))
ligand_files = sorted(glob('../../dataset/refined-set-2016/*/*ligand.mol2'))
for p, l in zip(protein_files, ligand_files):
try:
prot = Molecule(p)
ligand = SmallMol(l)
except Exception as e:
print(str(e))
Here is the error
Failed to read file ../../dataset/refined-set-2016/2cli/2cli_ligand.mol2. Try by setting the force_reading option as True.
Is there any workaround? I want to voxelize all the complexes after building the Molecule and SmallMol object
Did you try setting the option as True as the message suggests?
Yes, I did. I also tried to load both the pdb and mol2 version of the ligand but got the following error
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-25-54d7ea6cf12c> in <module>
----> 1 sm = SmallMol('../Data/train/1tkb/1tkb_ligand.pdb', force_reading=True, fixHs=True)
~/miniconda3/envs/cnnscore/lib/python3.7/site-packages/moleculekit/smallmol/smallmol.py in __init__(self, mol, ignore_errors, force_reading, fixHs, removeHs)
99 self._frame = 0
100
--> 101 _mol = self._initializeMolObj(mol, force_reading, ignore_errors)
102
103 if removeHs:
~/miniconda3/envs/cnnscore/lib/python3.7/site-packages/moleculekit/smallmol/smallmol.py in _initializeMolObj(self, mol, force_reading, ignore_errors)
160 if isinstance(mol, str):
161 frerr = ' Try by setting the force_reading option as True.' if not force_reading else ''
--> 162 raise ValueError('Failed to read file {}.{}'.format(mol, frerr))
163 if isinstance(mol, Molecule):
164 raise ValueError('Failed convering Molecule to SmallMol')
ValueError: Failed to read file ../Data/train/1tkb/1tkb_ligand.pdb.
@cuzzo87 could you take a look?
I know, that I am not part of the team. But I saw this issue, because @hassanmohsin forked my repo. It seems to be the same problem I had in my master thesis. I recommend to have a look to issue #12 #13 and #14. If you have questions by using moleculekit with PDBbind, you can contact me. I had invested 3 months to get this stuff working xD
Aha! I was trying to find your issue because I remembed something about PDBBind but somehow I missed it! Thanks for chiming in :)
@BioFreak95 Thanks! So, I just want to reproduce KDEEP and get the results they reported. Since you have invested a fair amount of time in it, I assume that you have a end-to-end script that does the work. Could you please share that?
You can find it in my Repo "PredBind". There are scripts and classes. See scripts/CNN/. If you have questions, just open a ticket in my PredBind-Repo and I will help.
@BioFreak95 Thanks!