From 246191521fe3c45ce7789550f3c4a5b0c8a8ae86 Mon Sep 17 00:00:00 2001 From: Alex Morehead Date: Mon, 12 Aug 2024 16:30:27 -0500 Subject: [PATCH] Add and document pip installation path --- .github/workflows/publish.yaml | 35 ++++++ README.md | 15 ++- docs/source/acknowledgements.rst | 4 +- docs/source/available_methods.rst | 4 +- docs/source/bonus.rst | 4 +- docs/source/citing_this_work.rst | 4 +- docs/source/comparative_plots.rst | 4 +- docs/source/data_preparation.rst | 4 +- docs/source/ensemble_inference.rst | 4 +- docs/source/for_developers.rst | 4 +- docs/source/index.rst | 6 +- docs/source/installation.rst | 4 +- docs/source/method_inference.rst | 4 +- docs/source/tutorials.rst | 4 +- .../data/neuralplexer_input_preparation.py | 4 +- pyproject.toml | 101 ++++++++++++++++++ setup.py | 14 --- 17 files changed, 178 insertions(+), 41 deletions(-) create mode 100644 .github/workflows/publish.yaml delete mode 100644 setup.py diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..847dd5e --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,35 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Upload Python Package + +on: + release: + types: [published] + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.10 + uses: actions/setup-python@v5 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@v1.9.0 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/README.md b/README.md index 1334a07..860f4c7 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![Paper](http://img.shields.io/badge/arXiv-2405.14108-B31B1B.svg)](https://arxiv.org/abs/2405.14108) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11477766.svg)](https://doi.org/10.5281/zenodo.11477766) +[![PyPI version](https://badge.fury.io/py/posebench.svg)](https://badge.fury.io/py/posebench) [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![Docs](https://assets.readthedocs.org/static/projects/badges/passing-flat.svg)](https://bioinfomachinelearning.github.io/PoseBench/) Config: Hydra @@ -38,7 +39,19 @@ Comprehensive benchmarking of protein-ligand structure generation methods
-Install `mamba` for dependency management (as a fast alternative to Anaconda) +### Portable installation + +To reuse modules and utilities within `PoseBench` in other projects, one can simply use `pip` + +```bash +pip install posebench +``` + +### Full installation + +To reproduce, customize, or extend the `PoseBench` benchmark, we recommend fully installing `PoseBench` using `mamba` as follows: + +First, install `mamba` for dependency management (as a fast alternative to Anaconda) ```bash wget "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh" diff --git a/docs/source/acknowledgements.rst b/docs/source/acknowledgements.rst index 49ed54d..af2b6aa 100644 --- a/docs/source/acknowledgements.rst +++ b/docs/source/acknowledgements.rst @@ -2,5 +2,5 @@ Acknowledgements ================ .. mdinclude:: ../../README.md - :start-line: 862 - :end-line: 879 + :start-line: 875 + :end-line: 892 diff --git a/docs/source/available_methods.rst b/docs/source/available_methods.rst index 60d2f47..0ebb58d 100644 --- a/docs/source/available_methods.rst +++ b/docs/source/available_methods.rst @@ -2,8 +2,8 @@ Available inference methods ================ .. mdinclude:: ../../README.md - :start-line: 273 - :end-line: 310 + :start-line: 286 + :end-line: 323 .. note:: Have a new method to add? Please let us know by creating a pull request. We would be happy to work with you to integrate new methodology into this benchmark! diff --git a/docs/source/bonus.rst b/docs/source/bonus.rst index ee93846..e0896f8 100644 --- a/docs/source/bonus.rst +++ b/docs/source/bonus.rst @@ -2,8 +2,8 @@ Bonus ================ .. mdinclude:: ../../README.md - :start-line: 897 - :end-line: 899 + :start-line: 910 + :end-line: 912 .. image:: ./_static/WorkBench.jpeg :alt: My brain after building PoseBench diff --git a/docs/source/citing_this_work.rst b/docs/source/citing_this_work.rst index 92b6e31..cca6931 100644 --- a/docs/source/citing_this_work.rst +++ b/docs/source/citing_this_work.rst @@ -2,5 +2,5 @@ Citing this work ================ .. mdinclude:: ../../README.md - :start-line: 881 - :end-line: 893 + :start-line: 894 + :end-line: 906 diff --git a/docs/source/comparative_plots.rst b/docs/source/comparative_plots.rst index 9563847..c4cd431 100644 --- a/docs/source/comparative_plots.rst +++ b/docs/source/comparative_plots.rst @@ -2,5 +2,5 @@ How to create comparative plots of inference results ================ .. mdinclude:: ../../README.md - :start-line: 809 - :end-line: 818 + :start-line: 822 + :end-line: 831 diff --git a/docs/source/data_preparation.rst b/docs/source/data_preparation.rst index d4e78a7..10eecd2 100644 --- a/docs/source/data_preparation.rst +++ b/docs/source/data_preparation.rst @@ -2,5 +2,5 @@ How to prepare `PoseBench` data ================ .. mdinclude:: ../../README.md - :start-line: 134 - :end-line: 267 + :start-line: 147 + :end-line: 280 diff --git a/docs/source/ensemble_inference.rst b/docs/source/ensemble_inference.rst index ca9f5e5..11f20e4 100644 --- a/docs/source/ensemble_inference.rst +++ b/docs/source/ensemble_inference.rst @@ -2,8 +2,8 @@ How to run inference with a method ensemble ================ .. mdinclude:: ../../README.md - :start-line: 750 - :end-line: 801 + :start-line: 763 + :end-line: 814 .. note:: In addition to having `consensus` as an available value for `ensemble_ranking_method`, one can also set `ensemble_ranking_method=ff` to have the method ensemble's top-ranked predictions selected using the criterion of "minimum (molecular dynamics) force field energy" (albeit while incurring a very large runtime complexity). diff --git a/docs/source/for_developers.rst b/docs/source/for_developers.rst index e8554cd..ecc12d3 100644 --- a/docs/source/for_developers.rst +++ b/docs/source/for_developers.rst @@ -2,5 +2,5 @@ For developers ================ .. mdinclude:: ../../README.md - :start-line: 824 - :end-line: 858 + :start-line: 837 + :end-line: 871 diff --git a/docs/source/index.rst b/docs/source/index.rst index 1fc5c59..874b012 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -9,7 +9,7 @@ Welcome to PoseBench's documentation! .. mdinclude:: ../../README.md :start-line: 4 - :end-line: 12 + :end-line: 13 .. image:: ./_static/PoseBench.png :alt: Overview of PoseBench @@ -17,8 +17,8 @@ Welcome to PoseBench's documentation! :width: 600 .. mdinclude:: ../../README.md - :start-line: 18 - :end-line: 20 + :start-line: 19 + :end-line: 21 .. toctree:: diff --git a/docs/source/installation.rst b/docs/source/installation.rst index a6c7b78..3c00cf9 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -2,5 +2,5 @@ Installation ================ .. mdinclude:: ../../README.md - :start-line: 40 - :end-line: 116 + :start-line: 41 + :end-line: 129 diff --git a/docs/source/method_inference.rst b/docs/source/method_inference.rst index 16e9015..2bfcb18 100644 --- a/docs/source/method_inference.rst +++ b/docs/source/method_inference.rst @@ -2,5 +2,5 @@ How to run inference with individual methods ================ .. mdinclude:: ../../README.md - :start-line: 318 - :end-line: 744 + :start-line: 331 + :end-line: 757 diff --git a/docs/source/tutorials.rst b/docs/source/tutorials.rst index 3e54b44..cdaab80 100644 --- a/docs/source/tutorials.rst +++ b/docs/source/tutorials.rst @@ -2,5 +2,5 @@ Tutorials ================ .. mdinclude:: ../../README.md - :start-line: 122 - :end-line: 128 + :start-line: 135 + :end-line: 141 diff --git a/posebench/data/neuralplexer_input_preparation.py b/posebench/data/neuralplexer_input_preparation.py index be53a0b..8b855c8 100644 --- a/posebench/data/neuralplexer_input_preparation.py +++ b/posebench/data/neuralplexer_input_preparation.py @@ -14,7 +14,9 @@ rootutils.setup_root(__file__, indicator=".project-root", pythonpath=True) from posebench import register_custom_omegaconf_resolvers -from posebench.models.ensemble_generation import LIGAND_ONLY_RECEPTOR_PLACEHOLDER_SEQUENCE +from posebench.models.ensemble_generation import ( + LIGAND_ONLY_RECEPTOR_PLACEHOLDER_SEQUENCE, +) from posebench.utils.data_utils import parse_inference_inputs_from_dir logging.basicConfig(format="[%(asctime)s] {%(filename)s:%(lineno)d} %(levelname)s - %(message)s") diff --git a/pyproject.toml b/pyproject.toml index 300ebf0..f60b0ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,96 @@ +[project] +name = "posebench" +version = "0.3.0" +description = "Comprehensive benchmarking of protein-ligand structure generation methods" +authors = [ + { name = "Alex Morehead", email = "acmwhb@umsystem.edu" } +] +readme = "README.md" +requires-python = ">= 3.10" +license = { file = "LICENSE" } +keywords = [ + 'artificial intelligence', + 'deep learning', + 'protein-ligand structure generation', + 'benchmarking', + 'molecular docking', + 'protein-ligand docking', + 'protein-ligand interaction', + 'protein-ligand binding', + 'protein-ligand scoring', + 'protein-ligand pose prediction', + 'protein-ligand pose refinement', +] + +classifiers=[ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Topic :: Scientific/Engineering :: Artificial Intelligence', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python :: 3.10', +] + +dependencies = [ + # --------- pytorch --------- # + "lightning>=2.1.3", + "torch==2.3.0", + "torchmetrics>=1.2.0", + "torchvision>=0.18.0", + + # --------- hydra --------- # + "hydra-core==1.3.2", + "hydra-colorlog==1.2.0", + "hydra-optuna-sweeper==1.2.0", + "omegaconf", + "pydantic>=2.18.3", + "pyyaml", + + # --------- others --------- # + "beartype", # runtime type checking + "biopandas", # for biological dataframe parsing + "biopython==1.79", # for biological data parsing + "ipykernel", # for running Jupyter notebooks + "jaxtyping>=0.2.21", # tensor type checking + "joblib", # for parallel processing + "lovely-numpy", # for fancy numpy debugging + "lovely-tensors", # for fancy pytorch debugging + "meeko", # for molecular docking preparation + "numpy", # for numerical operations + "pandas>=1.5.0", # for data parsing and analysis + "plotly", # for plotting + "pre-commit", # hooks for applying linters on commit + "prody", # for protein data parsing + "prolif", # for protein-ligand data parsing + "rdkit>=2023.3.3", # for parsing small molecule data files + "rich", # beautiful text formatting in terminal + "rootutils", # standardizing the project root setup + "scikit-learn>=1.1.2", # for basic machine learning utilities + "seaborn", # for plotting + "setuptools", # for packaging + "spyrmsd", # for RMSD calculations + "timeout_decorator>=0.5.0", # for preventing certain functions from executing indefinitely + "tqdm", # progress bars + "loguru", # for cleaner logging +] + +[project.urls] +Homepage = "https://pypi.org/project/posebench/" +Repository = "https://github.com/BioinfoMachineLearning/PoseBench" + +[project.optional-dependencies] +examples = [] +test = [ + "pytest", +] + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + [tool.pytest.ini_options] +pythonpath = [ + "." +] addopts = [ "--color=yes", "--durations=0", @@ -16,6 +108,15 @@ markers = [ minversion = "6.0" testpaths = "tests/" +# Assuming you're developing for Python 3.10 +target-version = "py310" + +[tool.hatch.metadata] +allow-direct-references = true + +[tool.hatch.build.targets.wheel] +packages = ["posebench"] + [tool.coverage.report] exclude_lines = [ "pragma: nocover", diff --git a/setup.py b/setup.py deleted file mode 100644 index b83811a..0000000 --- a/setup.py +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env python - -from setuptools import find_packages, setup - -setup( - name="PoseBench", - version="0.3.0", - description="Comprehensive benchmarking of protein-ligand structure generation methods", - author="Alex Morehead", - author_email="acmwhb@umsystem.edu", - url="https://github.com/BioinfoMachineLearning/PoseBench", - install_requires=["hydra-core"], - packages=find_packages(), -)