pharmai / plip

Protein-Ligand Interaction Profiler - Analyze and visualize non-covalent protein-ligand interactions in PDB files according to 📝 Adasme et al. (2021), https://doi.org/10.1093/nar/gkab294
http://plip.biotec.tu-dresden.de
GNU General Public License v2.0
449 stars 103 forks source link

PyMol visualizations not generated #109

Open MiloszGrabski opened 3 years ago

MiloszGrabski commented 3 years ago

Describe the bug PyMol visualisations are not being generated in some cases. I have tried to generate visualization for my complex, but it did not provide them. I have checked two examples mentioned in documentation. example: plip -i 1osn -pyx result: does not provide .pse files example: plip -i 5b2m --intra A -yv result: does create .pse files

I am using "pymol-open-source" version, pymol version 2.4.0

fkaiserbio commented 3 years ago

I can't reproduce this. Both commands generate visualizations as expected when running with Docker. Please check your PyMol installation and whether Python bindings are correctly linked.

$ docker run --rm \
    -v ${PWD}:/results \
    -w /results \
    -u $(id -u ${USER}):$(id -g ${USER}) \
    pharmai/plip:latest -i 1s3v -pyv

produces *.pse and *.png

$ docker run --rm \
    -v ${PWD}:/results \
    -w /results \
    -u $(id -u ${USER}):$(id -g ${USER}) \
    pharmai/plip:latest -i 5b2m --intra A -pyv

produces *.pse and *.png

1OSN_BVP_A_500 5B2M_IntraChainA

dtriand commented 3 years ago

I am experiencing the same issue with the pip installed version of PLIP. In my case, I can generate .png and .pse files only for PDB entry 1vsn, but not for any other entry I have tried (either from PDB or from local file).

The command I am using is: python plipcmd.py -i 6tc2 -ptyv

And the output is:

2021-09-02 23:51:32,422 [INFO] [plipcmd.py:49] plip.plipcmd: starting analysis of 6tc2.pdb
2021-09-02 23:51:34,194 [INFO] [plipcmd.py:73] plip.plipcmd: generating visualizations in parallel on 7 cores
2021-09-02 23:51:35,665 [INFO] [plipcmd.py:163] plip.plipcmd: finished analysis, find the result files in the working directory

This generates only the report and the two .pdb files.

In contrast, when I run the same command on entry 1vsn the output is:

2021-09-02 23:52:42,947 [INFO] [plipcmd.py:49] plip.plipcmd: starting analysis of 1vsn.pdb
 Executive: object "1vsnCartoon" created.
 Executive: object 1vsnCartoon created.
PyMOL>viewport 1200,800
Imagemagick not available. Images will not be resized or cropped.2021-09-02 23:52:44,337 [INFO] [plipcmd.py:163] plip.plipcmd: finished analysis, find the result files in the working directory

This generates the report, two .pdb files, .png and .pse files.

I am also using pymol-open-source version 2.5.0 and PLIP version 2.2.2 on Windows.

fkaiserbio commented 3 years ago

This is very strange. Does PLIP output debug log records? You are using the -v flag, so it should. Could you please paste a full log output here?

Also it would be interesting to see the same command if you run it in Docker. And what happens if you try to import the PyMOL module via a command line call?

$ python3 -c 'from pymol import cmd' python3

dtriand commented 3 years ago

PLIP doesn't output any additional debug logs even with the -v flag. The full log is the one I posted on my previous comment. Also, importing the cmd module works without any issues.

However, I run the the script on the debugger and I believe the issue arrises from the parallelization of the visualization process. This would also explain why it worked with entry 1vsn, since it contains only a single ligand and doesn't invoke the parallelization route. Entry 6tc2 (and every other entry I previously tried) contained multiple ligands, thus it always tried to parallelize the process.

I tried other single-ligand structures (eg. 5rty, 5rvm) and had no issues. For multi-ligand structures (eg. 6tc2), the command works only if I add --maxthreads=1. It seems like a very peculiar quirk and unfortunately it fails completely silently.

fkaiserbio commented 3 years ago

Thanks for the very detailed report. We will investigate this further and reopen the issue.