protocaller / ProtoCaller

Full automation of relative protein-ligand binding free energy calculations in GROMACS
http://protocaller.readthedocs.io
GNU General Public License v3.0
43 stars 15 forks source link

How to supply a custom pdb file (without pdb id) for protein? #30

Closed kexul closed 3 years ago

kexul commented 3 years ago

I've followed the example, but an error raised:

/data/miniconda3/envs/uii/lib/python3.7/site-packages/ProtoCaller/__init__.py:31: UserWarning: Cannot find MPI binary for the current operating system.
  _warnings.warn("Cannot find MPI binary for the current operating system.")
INFO:numexpr.utils:NumExpr defaulting to 4 threads.
INFO:root:Running PDB2PQR... 
INFO:root:Running OpenBabel... 
INFO:root:Parametrising original crystal system...
Traceback (most recent call last):
  File "/root/prepare/prepare.py", line 205, in <module>
    test_case()
  File "/root/prepare/prepare.py", line 200, in test_case
    protein.parametrise()
  File "/data/miniconda3/envs/uii/lib/python3.7/site-packages/ProtoCaller/Ensemble/Protein.py", line 585, in parametrise
    hetatm_files, hetatm_types = self._pdb_obj.writeHetatms()
AttributeError: 'NoneType' object has no attribute 'writeHetatms'

Here is the minimum code to reproduce:

lig = Ligand('1h1q_protonated.sdf')
protein = Protein('aaa', pdb_file='CDK2_protein.pdb', ligand_ref=lig)
protein.filter(ligands=None, waters='all')
protein.prepare()
protein.parametrise()

Here is the file I used: mds.zip

msuruzhon commented 3 years ago

The issue was related to a missing FASTA file, since you neither supplied one, nor specified a valid PDB ID so that ProtoCaller could retrieve the FASTA automatically. I relaxed this condition, but it is something to bear in mind when manually feeding data into ProtoCaller, because Modeller works with FASTA files and might silently fail to add residues if there is no FASTA file.

In addition, you have a non-standard residue, which is normally converted to a standard one by ProtoCaller, but it needs to be specified in the MODRES section of the PDB. While I could relax this restriction as well and detect the non-standard residues based on their name, I am going to keep it like that to encourage the user to submit PDB files with valid headers. Many pieces of software don't output fully-functional PDB files, so I want to maximise the chance of the user spotting this if they fail to. The main reason for this is that the SSBOND directive in the PDB header is crucial for specifying disulfide bonds and if it's not specified ProtoCaller will simply not add any disulfide bonds, resulting in silent wrong behaviour.

kexul commented 3 years ago

Thanks for your clarification, I learned a lot from it, thank you!