diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml new file mode 100644 index 0000000..84ca294 --- /dev/null +++ b/.github/workflows/pypi-publish.yml @@ -0,0 +1,31 @@ +name: publish to PyPI + +on: + release: + types: [published] + +jobs: + pypi_release: + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v4 + with: + python-version: "3.11" + + - uses: snok/install-poetry@v1 + with: + version: 1.3.2 + virtualenvs-create: true + virtualenvs-in-project: true + + - run: poetry install + + - run: poetry run pytest + + - run: poetry config pypi-token.pypi "${{ secrets.PYPI_API_KEY }}" + + - name: Publish package + run: poetry publish --build diff --git a/README.md b/README.md index 3af7462..68e0108 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # PRODIGY-cryst +![PyPI - License](https://img.shields.io/pypi/l/prodigy-cryst) +![PyPI - Status](https://img.shields.io/pypi/status/prodigy-cryst) +![PyPI - Python Version](https://img.shields.io/pypi/pyversions/prodigy-cryst) [![ci](https://github.com/haddocking/prodigy-cryst/actions/workflows/ci.yml/badge.svg)](https://github.com/haddocking/prodigy-cryst/actions/workflows/ci.yml) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/4f129d451ec04c4e9529a6eb28457619)](https://www.codacy.com/gh/haddocking/prodigy-cryst/dashboard?utm_source=github.com&utm_medium=referral&utm_content=haddocking/prodigy-cryst&utm_campaign=Badge_Grade) [![Codacy Badge](https://app.codacy.com/project/badge/Coverage/4f129d451ec04c4e9529a6eb28457619)](https://www.codacy.com/gh/haddocking/prodigy-cryst/dashboard?utm_source=github.com&utm_medium=referral&utm_content=haddocking/prodigy-cryst&utm_campaign=Badge_Coverage) @@ -10,14 +13,69 @@ Collection of scripts to predict whether an interface in a protein-protein compl ## Installation ```bash -> git clone http://github.com/haddocking/prodigy-cryst -> python setup.py install +pip install prodigy-cryst ``` ## Usage +Type --help to get a list of all the possible options. + +```bash +$ prodigy_cryst --help +usage: prodigy_cryst [-h] [--contact_list] [-q] [--selection A B [A,B C ...]] structf + +Biological/crystallographic interface classifier based on Intermolecular Contacts (ICs). + +positional arguments: + structf Structure to analyse in PDB or mmCIF format + +optional arguments: + -h, --help show this help message and exit + --contact_list Output a list of contacts + -q, --quiet Outputs only the predicted interface class + +Selection Options: + + By default, all intermolecular contacts are taken into consideration, + a molecule being defined as an isolated group of amino acids sharing + a common chain identifier. In specific cases, for example + antibody-antigen complexes, some chains should be considered as a + single molecule. + + Use the --selection option to provide collections of chains that should + be considered for the calculation. Separate by a space the chains that + are to be considered _different_ molecules. Use commas to include multiple + chains as part of a single group: + + --selection A B => Contacts calculated (only) between chains A and B. + --selection A,B C => Contacts calculated (only) between chains A and C; and B and C. + --selection A B C => Contacts calculated (only) between chains A and B; B and C; and A and C. + + + --selection A B [A,B C ...] +``` + +## Examples + +Download PDB file 1ppe from the PDB and run the script on it. + ```bash -prodigy_cryst [--selection ] +wget https://files.rcsb.org/download/1PPE.pdb ``` -Type --help to get a list of all the possible options. +Check how PRODIGY-cryst works on the 1PPE.pdb file. The script will output the number of intermolecular contacts, the number of contacts of each type, the link density, and the predicted interface class. + +```bash +$ prodigy_cryst 1PPE.pdb +[+] Reading structure file: /home/rodrigo/1PPE.pdb +[+] Selection: E, I +[+] No. of intermolecular contacts: 71 +[+] No. of charged-charged contacts: 4 +[+] No. of charged-polar contacts: 8 +[+] No. of charged-apolar contacts: 24 +[+] No. of polar-polar contacts: 0 +[+] No. of apolar-polar contacts: 15 +[+] No. of apolar-apolar contacts: 20 +[+] Link density: 0.14 +[+] Class: BIO 0.804 0.196 +``` diff --git a/poetry.lock b/poetry.lock index 9b755ca..e957bd5 100644 --- a/poetry.lock +++ b/poetry.lock @@ -344,41 +344,41 @@ alldeps = ["numpy (>=1.11.0)", "scipy (>=0.17.0)"] [[package]] name = "scipy" -version = "1.9.3" +version = "1.10.1" description = "Fundamental algorithms for scientific computing in Python" optional = false -python-versions = ">=3.8" +python-versions = "<3.12,>=3.8" files = [ - {file = "scipy-1.9.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1884b66a54887e21addf9c16fb588720a8309a57b2e258ae1c7986d4444d3bc0"}, - {file = "scipy-1.9.3-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:83b89e9586c62e787f5012e8475fbb12185bafb996a03257e9675cd73d3736dd"}, - {file = "scipy-1.9.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1a72d885fa44247f92743fc20732ae55564ff2a519e8302fb7e18717c5355a8b"}, - {file = "scipy-1.9.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d01e1dd7b15bd2449c8bfc6b7cc67d630700ed655654f0dfcf121600bad205c9"}, - {file = "scipy-1.9.3-cp310-cp310-win_amd64.whl", hash = "sha256:68239b6aa6f9c593da8be1509a05cb7f9efe98b80f43a5861cd24c7557e98523"}, - {file = "scipy-1.9.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b41bc822679ad1c9a5f023bc93f6d0543129ca0f37c1ce294dd9d386f0a21096"}, - {file = "scipy-1.9.3-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:90453d2b93ea82a9f434e4e1cba043e779ff67b92f7a0e85d05d286a3625df3c"}, - {file = "scipy-1.9.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:83c06e62a390a9167da60bedd4575a14c1f58ca9dfde59830fc42e5197283dab"}, - {file = "scipy-1.9.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:abaf921531b5aeaafced90157db505e10345e45038c39e5d9b6c7922d68085cb"}, - {file = "scipy-1.9.3-cp311-cp311-win_amd64.whl", hash = "sha256:06d2e1b4c491dc7d8eacea139a1b0b295f74e1a1a0f704c375028f8320d16e31"}, - {file = "scipy-1.9.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:5a04cd7d0d3eff6ea4719371cbc44df31411862b9646db617c99718ff68d4840"}, - {file = "scipy-1.9.3-cp38-cp38-macosx_12_0_arm64.whl", hash = "sha256:545c83ffb518094d8c9d83cce216c0c32f8c04aaf28b92cc8283eda0685162d5"}, - {file = "scipy-1.9.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0d54222d7a3ba6022fdf5773931b5d7c56efe41ede7f7128c7b1637700409108"}, - {file = "scipy-1.9.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cff3a5295234037e39500d35316a4c5794739433528310e117b8a9a0c76d20fc"}, - {file = "scipy-1.9.3-cp38-cp38-win_amd64.whl", hash = "sha256:2318bef588acc7a574f5bfdff9c172d0b1bf2c8143d9582e05f878e580a3781e"}, - {file = "scipy-1.9.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d644a64e174c16cb4b2e41dfea6af722053e83d066da7343f333a54dae9bc31c"}, - {file = "scipy-1.9.3-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:da8245491d73ed0a994ed9c2e380fd058ce2fa8a18da204681f2fe1f57f98f95"}, - {file = "scipy-1.9.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4db5b30849606a95dcf519763dd3ab6fe9bd91df49eba517359e450a7d80ce2e"}, - {file = "scipy-1.9.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c68db6b290cbd4049012990d7fe71a2abd9ffbe82c0056ebe0f01df8be5436b0"}, - {file = "scipy-1.9.3-cp39-cp39-win_amd64.whl", hash = "sha256:5b88e6d91ad9d59478fafe92a7c757d00c59e3bdc3331be8ada76a4f8d683f58"}, - {file = "scipy-1.9.3.tar.gz", hash = "sha256:fbc5c05c85c1a02be77b1ff591087c83bc44579c6d2bd9fb798bb64ea5e1a027"}, + {file = "scipy-1.10.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e7354fd7527a4b0377ce55f286805b34e8c54b91be865bac273f527e1b839019"}, + {file = "scipy-1.10.1-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:4b3f429188c66603a1a5c549fb414e4d3bdc2a24792e061ffbd607d3d75fd84e"}, + {file = "scipy-1.10.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1553b5dcddd64ba9a0d95355e63fe6c3fc303a8fd77c7bc91e77d61363f7433f"}, + {file = "scipy-1.10.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c0ff64b06b10e35215abce517252b375e580a6125fd5fdf6421b98efbefb2d2"}, + {file = "scipy-1.10.1-cp310-cp310-win_amd64.whl", hash = "sha256:fae8a7b898c42dffe3f7361c40d5952b6bf32d10c4569098d276b4c547905ee1"}, + {file = "scipy-1.10.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:0f1564ea217e82c1bbe75ddf7285ba0709ecd503f048cb1236ae9995f64217bd"}, + {file = "scipy-1.10.1-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:d925fa1c81b772882aa55bcc10bf88324dadb66ff85d548c71515f6689c6dac5"}, + {file = "scipy-1.10.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aaea0a6be54462ec027de54fca511540980d1e9eea68b2d5c1dbfe084797be35"}, + {file = "scipy-1.10.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15a35c4242ec5f292c3dd364a7c71a61be87a3d4ddcc693372813c0b73c9af1d"}, + {file = "scipy-1.10.1-cp311-cp311-win_amd64.whl", hash = "sha256:43b8e0bcb877faf0abfb613d51026cd5cc78918e9530e375727bf0625c82788f"}, + {file = "scipy-1.10.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:5678f88c68ea866ed9ebe3a989091088553ba12c6090244fdae3e467b1139c35"}, + {file = "scipy-1.10.1-cp38-cp38-macosx_12_0_arm64.whl", hash = "sha256:39becb03541f9e58243f4197584286e339029e8908c46f7221abeea4b749fa88"}, + {file = "scipy-1.10.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bce5869c8d68cf383ce240e44c1d9ae7c06078a9396df68ce88a1230f93a30c1"}, + {file = "scipy-1.10.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:07c3457ce0b3ad5124f98a86533106b643dd811dd61b548e78cf4c8786652f6f"}, + {file = "scipy-1.10.1-cp38-cp38-win_amd64.whl", hash = "sha256:049a8bbf0ad95277ffba9b3b7d23e5369cc39e66406d60422c8cfef40ccc8415"}, + {file = "scipy-1.10.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:cd9f1027ff30d90618914a64ca9b1a77a431159df0e2a195d8a9e8a04c78abf9"}, + {file = "scipy-1.10.1-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:79c8e5a6c6ffaf3a2262ef1be1e108a035cf4f05c14df56057b64acc5bebffb6"}, + {file = "scipy-1.10.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:51af417a000d2dbe1ec6c372dfe688e041a7084da4fdd350aeb139bd3fb55353"}, + {file = "scipy-1.10.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1b4735d6c28aad3cdcf52117e0e91d6b39acd4272f3f5cd9907c24ee931ad601"}, + {file = "scipy-1.10.1-cp39-cp39-win_amd64.whl", hash = "sha256:7ff7f37b1bf4417baca958d254e8e2875d0cc23aaadbe65b3d5b3077b0eb23ea"}, + {file = "scipy-1.10.1.tar.gz", hash = "sha256:2cf9dfb80a7b4589ba4c40ce7588986d6d5cebc5457cad2c2880f6bc2d42f3a5"}, ] [package.dependencies] -numpy = ">=1.18.5,<1.26.0" +numpy = ">=1.19.5,<1.27.0" [package.extras] -dev = ["flake8", "mypy", "pycodestyle", "typing_extensions"] -doc = ["matplotlib (>2)", "numpydoc", "pydata-sphinx-theme (==0.9.0)", "sphinx (!=4.1.0)", "sphinx-panels (>=0.5.2)", "sphinx-tabs"] -test = ["asv", "gmpy2", "mpmath", "pytest", "pytest-cov", "pytest-xdist", "scikit-umfpack", "threadpoolctl"] +dev = ["click", "doit (>=0.36.0)", "flake8", "mypy", "pycodestyle", "pydevtool", "rich-click", "typing_extensions"] +doc = ["matplotlib (>2)", "numpydoc", "pydata-sphinx-theme (==0.9.0)", "sphinx (!=4.1.0)", "sphinx-design (>=0.2.0)"] +test = ["asv", "gmpy2", "mpmath", "pooch", "pytest", "pytest-cov", "pytest-timeout", "pytest-xdist", "scikit-umfpack", "threadpoolctl"] [[package]] name = "sortedcontainers" @@ -404,5 +404,5 @@ files = [ [metadata] lock-version = "2.0" -python-versions = "^3.8" -content-hash = "ab257a81666cbba520b48dd8da846fe0267e29177f70cf1e4ec91ab17733235e" +python-versions = "~3.8,<3.9" +content-hash = "811c773f73bfc8dda34ee3bb804c9fa4f35b9cea6e2a08cd029061596c0aec29" diff --git a/pyproject.toml b/pyproject.toml index 6bed3ae..a6b2dde 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "prodigy-cryst" -version = "1.0.1" +version = "1.0.0" description = "Predicts if a protein complex interface is biological or crystallographic." authors = ["BonvinLab "] readme = "README.md" @@ -15,7 +15,7 @@ classifiers = [ ] [tool.poetry.dependencies] -python = "^3.8" +python = ">=3.8,<3.9" scikit-learn = "0.22" biopython = "^1.79" numpy = "~1.20"