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
463 stars 107 forks source link

Ligands with identical name collapse in single entity #99

Closed jaimergp closed 3 years ago

jaimergp commented 3 years ago

Describe the bug

In multimeric complexes, some structures might have (incorrectly?) annotated copies of the same ligand with the same name, residue id and chain id. The computed ligand instances collapse in a single combined one as a result, but they might be indeed in different subunits of the protein, which should be reported as different.

To Reproduce Steps to reproduce the behavior:

  1. Get attached PDB file: Mpro-x3113_0A_bound.zip

  2. Run

from plip.structure.preparation import PDBComplex
path = "path/to/downloaded/attachment.pdb"
pdbcomplex = PDBComplex()
pdbcomplex.load_pdb(path)
print(*[lig.longname for lig in pdbcomplex.ligands])
# This should print two LIG instances, not one, plus the DMS artifacts

Expected behavior

I would like to see at least a warning that two instances of the same ligand were considered the same one. Ideally, PLIP could detect that although the name is identical, they are different instances given their positions in the complex, and as a result return the interaction profile for both pockets.

Screenshots

See how there are two ligands in two different pockes:

image

Desktop (please complete the following information):

Additional context

conda list ``` # Name Version Build Channel _libgcc_mutex 0.1 conda_forge conda-forge _openmp_mutex 4.5 1_gnu conda-forge appdirs 1.4.4 pyh9f0ad1d_0 conda-forge argon2-cffi 20.1.0 py37h8f50634_2 conda-forge async_generator 1.10 py_0 conda-forge attrs 20.3.0 pyhd3deb0d_0 conda-forge backcall 0.2.0 pyh9f0ad1d_0 conda-forge backports 1.0 py_2 conda-forge backports.functools_lru_cache 1.6.1 py_0 conda-forge biopandas 0.2.7 pyh9f0ad1d_1 conda-forge biopython 1.78 py37h8f50634_1 conda-forge biotite 0.24.0 py37h8f50634_0 conda-forge black 20.8b1 py_1 conda-forge bleach 3.2.1 pyh9f0ad1d_0 conda-forge boost 1.74.0 py37he5a615d_2 conda-forge boost-cpp 1.74.0 h9359b55_0 conda-forge bravado 11.0.2 pyh9f0ad1d_0 conda-forge bravado-core 5.17.0 pyh9f0ad1d_0 conda-forge brotlipy 0.7.0 py37hb5d75c8_1001 conda-forge bzip2 1.0.8 h7f98852_4 conda-forge c-ares 1.17.1 h36c2ea0_0 conda-forge ca-certificates 2020.12.8 h06a4308_0 cairo 1.16.0 h488836b_1006 conda-forge certifi 2020.12.5 py37h89c1867_0 conda-forge cffi 1.14.4 py37hc58025e_1 conda-forge cftime 1.3.0 py37ha21ca33_0 conda-forge chardet 3.0.4 py37he5f6b98_1008 conda-forge click 7.1.2 pyh9f0ad1d_0 conda-forge coverage 5.3 py37h8f50634_1 conda-forge cryptography 3.2.1 py37hc72a4ac_0 conda-forge curl 7.71.1 he644dc0_8 conda-forge cycler 0.10.0 py_2 conda-forge dataclasses 0.7 py37_0 conda-forge decorator 4.4.2 py_0 conda-forge defusedxml 0.6.0 py_0 conda-forge entrypoints 0.3 py37hc8dfbb8_1002 conda-forge fontconfig 2.13.1 h1056068_1002 conda-forge freetype 2.10.4 he06d7ca_0 conda-forge gettext 0.19.8.1 h0b5b191_1005 conda-forge griddataformats 0.5.0 py_0 conda-forge gsd 2.4.0 py37ha21ca33_0 conda-forge hdf4 4.2.13 h10796ff_1004 conda-forge hdf5 1.10.6 nompi_h7c3c948_1111 conda-forge icu 67.1 he1b5a44_0 conda-forge idna 2.10 pyh9f0ad1d_0 conda-forge importlib-metadata 3.1.0 pyhd8ed1ab_0 conda-forge importlib_metadata 3.1.0 hd8ed1ab_0 conda-forge iniconfig 1.1.1 pyh9f0ad1d_0 conda-forge ipykernel 5.3.4 py37hc6149b9_1 conda-forge ipython 7.19.0 py37h888b3d9_0 conda-forge ipython_genutils 0.2.0 py_1 conda-forge ipywidgets 7.5.1 pyh9f0ad1d_1 conda-forge jedi 0.17.2 py37hc8dfbb8_1 conda-forge jinja2 2.11.2 pyh9f0ad1d_0 conda-forge joblib 0.17.0 py_0 conda-forge jpeg 9d h516909a_0 conda-forge json5 0.9.5 pyh9f0ad1d_0 conda-forge jsonref 0.2 py_0 conda-forge jsonschema 3.2.0 py37hc8dfbb8_1 conda-forge jupyter_client 6.1.7 py_0 conda-forge jupyter_core 4.7.0 py37h89c1867_0 conda-forge jupyterlab 2.2.9 py_0 conda-forge jupyterlab_pygments 0.1.2 pyh9f0ad1d_0 conda-forge jupyterlab_server 1.2.0 py_0 conda-forge kiwisolver 1.3.1 py37hc928c03_0 conda-forge krb5 1.17.2 h926e7f8_0 conda-forge lcms2 2.11 hcbb858e_1 conda-forge ld_impl_linux-64 2.35.1 hed1e6ac_0 conda-forge libblas 3.9.0 3_openblas conda-forge libcblas 3.9.0 3_openblas conda-forge libcurl 7.71.1 hcdd3856_8 conda-forge libedit 3.1.20191231 he28a2e2_2 conda-forge libev 4.33 h516909a_1 conda-forge libffi 3.3 h58526e2_1 conda-forge libgcc-ng 9.3.0 h5dbcf3e_17 conda-forge libgfortran-ng 7.5.0 hae1eefd_17 conda-forge libgfortran4 7.5.0 hae1eefd_17 conda-forge libglib 2.66.3 h1f3bc88_1 conda-forge libgomp 9.3.0 h5dbcf3e_17 conda-forge libiconv 1.16 h516909a_0 conda-forge liblapack 3.9.0 3_openblas conda-forge libnetcdf 4.7.4 nompi_hefab0ff_106 conda-forge libnghttp2 1.41.0 h8cfc5f6_2 conda-forge libopenblas 0.3.12 pthreads_hb3c22a3_1 conda-forge libpng 1.6.37 hed695b0_2 conda-forge libsodium 1.0.18 h516909a_1 conda-forge libssh2 1.9.0 hab1572f_5 conda-forge libstdcxx-ng 9.3.0 h2ae2ef3_17 conda-forge libtiff 4.1.0 hc7e4089_6 conda-forge libuuid 2.32.1 h14c3975_1000 conda-forge libwebp-base 1.1.0 h516909a_3 conda-forge libxcb 1.13 h14c3975_1002 conda-forge libxml2 2.9.10 h68273f3_2 conda-forge libxslt 1.1.33 h572872d_1 conda-forge lxml 4.6.2 py37h77fd288_0 conda-forge lz4-c 1.9.2 he1b5a44_3 conda-forge markupsafe 1.1.1 py37hb5d75c8_2 conda-forge matplotlib-base 3.3.3 py37h4f6019d_0 conda-forge mdanalysis 1.0.0 py37h745909e_1 conda-forge mistune 0.8.4 py37h8f50634_1002 conda-forge mmtf-python 1.1.2 py_0 conda-forge monotonic 1.5 py_0 conda-forge more-itertools 8.6.0 pyhd8ed1ab_0 conda-forge msgpack-python 1.0.0 py37hc928c03_2 conda-forge muscle 3.8.1551 hc9558a2_5 bioconda mypy_extensions 0.4.3 py37hc8dfbb8_2 conda-forge nbclient 0.5.1 py_0 conda-forge nbconvert 6.0.7 py37h89c1867_3 conda-forge nbformat 5.0.8 py_0 conda-forge ncurses 6.2 h58526e2_4 conda-forge nest-asyncio 1.4.3 pyhd8ed1ab_0 conda-forge netcdf4 1.5.5 nompi_py37hdbee05a_100 conda-forge networkx 2.5 py_0 conda-forge nglview 2.7.7 pyh5ca1d4c_1 conda-forge notebook 6.1.5 py37h89c1867_0 conda-forge numpy 1.19.4 py37h7e9df27_1 conda-forge olefile 0.46 pyh9f0ad1d_1 conda-forge openbabel 3.1.1 py37h200e996_1 conda-forge opencadd 0+unknown pypi_0 pypi openssl 1.1.1i h27cfd23_0 packaging 20.4 pyh9f0ad1d_0 conda-forge pandas 1.1.4 py37h10a2094_0 conda-forge pandoc 2.11.2 h36c2ea0_0 conda-forge pandocfilters 1.4.2 py_1 conda-forge parso 0.7.1 pyh9f0ad1d_0 conda-forge pathspec 0.8.1 pyhd3deb0d_0 conda-forge patsy 0.5.1 py_0 conda-forge pcre 8.44 he1b5a44_0 conda-forge pexpect 4.8.0 py37hc8dfbb8_1 conda-forge pickleshare 0.7.5 py37hc8dfbb8_1002 conda-forge pillow 8.0.1 py37h718be6c_0 conda-forge pip 20.2.4 py_0 conda-forge pixman 0.38.0 h516909a_1003 conda-forge plip 2.1.6 pyhd8ed1ab_0 conda-forge plotly 4.13.0 pyhd3deb0d_0 conda-forge pluggy 0.13.1 py37he5f6b98_3 conda-forge prometheus_client 0.9.0 pyhd3deb0d_0 conda-forge prompt-toolkit 3.0.8 pyha770c72_0 conda-forge pthread-stubs 0.4 h36c2ea0_1001 conda-forge ptyprocess 0.6.0 py37_1000 conda-forge py 1.9.0 pyh9f0ad1d_0 conda-forge pycairo 1.20.0 py37h01af8b0_1 conda-forge pycparser 2.20 pyh9f0ad1d_2 conda-forge pygments 2.7.2 py_0 conda-forge pyopenssl 20.0.0 pyhd8ed1ab_0 conda-forge pyparsing 2.4.7 pyh9f0ad1d_0 conda-forge pyrsistent 0.17.3 py37h8f50634_1 conda-forge pysocks 1.7.1 py37he5f6b98_2 conda-forge pytest 6.1.2 py37h89c1867_0 conda-forge pytest-cov 2.10.1 pyh9f0ad1d_0 conda-forge python 3.7.8 hffdb5ce_3_cpython conda-forge python-dateutil 2.8.1 py_0 conda-forge python_abi 3.7 1_cp37m conda-forge pytz 2020.4 pyhd8ed1ab_0 conda-forge pyyaml 5.3.1 py37hb5d75c8_1 conda-forge pyzmq 20.0.0 py37h5a562af_1 conda-forge rdkit 2020.09.2 py37h713bca6_0 conda-forge readline 8.0 he28a2e2_2 conda-forge regex 2020.11.13 py37h4abf009_0 conda-forge reportlab 3.5.55 py37hd704e64_0 conda-forge requests 2.25.0 pyhd3deb0d_0 conda-forge retrying 1.3.3 py_2 conda-forge scikit-learn 0.23.2 py37hddcf8d6_3 conda-forge scipy 1.5.3 py37h8911b10_0 conda-forge seaborn 0.11.0 ha770c72_1 conda-forge seaborn-base 0.11.0 pyhd8ed1ab_1 conda-forge send2trash 1.5.0 py_0 conda-forge setuptools 49.6.0 py37he5f6b98_2 conda-forge simplejson 3.17.2 py37h8f50634_1 conda-forge six 1.15.0 pyh9f0ad1d_0 conda-forge sqlalchemy 1.3.20 py37h8f50634_0 conda-forge sqlite 3.33.0 h4cf870e_1 conda-forge statsmodels 0.12.1 py37ha21ca33_1 conda-forge swagger-spec-validator 2.7.3 pyh9f0ad1d_0 conda-forge terminado 0.9.1 py37hc8dfbb8_1 conda-forge testpath 0.4.4 py_0 conda-forge threadpoolctl 2.1.0 pyh5ca1d4c_0 conda-forge tk 8.6.10 hed695b0_1 conda-forge toml 0.10.2 pyhd8ed1ab_0 conda-forge tornado 6.1 py37h4abf009_0 conda-forge tqdm 4.54.0 pyhd8ed1ab_0 conda-forge traitlets 5.0.5 py_0 conda-forge typed-ast 1.4.1 py37h4abf009_1 conda-forge typing-extensions 3.7.4.3 0 conda-forge typing_extensions 3.7.4.3 py_0 conda-forge urllib3 1.25.11 py_0 conda-forge wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge webencodings 0.5.1 py_1 conda-forge wheel 0.35.1 pyh9f0ad1d_0 conda-forge widgetsnbextension 3.5.1 py37hc8dfbb8_4 conda-forge xlrd 1.2.0 py37_0 xorg-kbproto 1.0.7 h14c3975_1002 conda-forge xorg-libice 1.0.10 h516909a_0 conda-forge xorg-libsm 1.2.3 h84519dc_1000 conda-forge xorg-libx11 1.6.12 h516909a_0 conda-forge xorg-libxau 1.0.9 h14c3975_0 conda-forge xorg-libxdmcp 1.1.3 h516909a_0 conda-forge xorg-libxext 1.3.4 h516909a_0 conda-forge xorg-libxrender 0.9.10 h516909a_1002 conda-forge xorg-renderproto 0.11.1 h14c3975_1002 conda-forge xorg-xextproto 7.3.0 h14c3975_1002 conda-forge xorg-xproto 7.0.31 h14c3975_1007 conda-forge xz 5.2.5 h516909a_1 conda-forge yaml 0.2.5 h516909a_0 conda-forge zeromq 4.3.3 h58526e2_3 conda-forge zipp 3.4.0 py_0 conda-forge zlib 1.2.11 h516909a_1010 conda-forge zstd 1.4.5 h6597ccf_2 conda-forge ```
jaimergp commented 3 years ago

Sorry for the noise, it's not Plipify. It turns out that NGLView will show the biological units if available, by default, hence the duplicated ligands in the picture.

import nglview as nv
with open("Mpro-x3113_0A_bound.pdb") as f:
    v = nv.show_file(f, ext="pdb", default_representation=False)
    v.add_cartoon()
    v.add_ball_and_stick("LIG")
display(v)

image

fkaiserbio commented 3 years ago

Still good to know, thank you.