Skip to main content

OCDocker is a Python package for molecular docking automation, virtual screening and AI consensus scoring.

Project description

codecov CI Python PyPI Issues Last commit DOI

OCDocker

OCDocker

OCDocker is a Python toolkit and CLI for molecular docking, virtual screening, pose clustering, rescoring, and OCScore model development. It is designed to run as a command-line tool, Python API, or scheduler-friendly workflow component.

What it provides:

  • Docking workflows for AutoDock Vina, Smina, Gnina, and PLANTS.
  • Pipeline stages for preparation, docking, collection, RMSD clustering, rescoring, and export.
  • Database support for PostgreSQL, MySQL, and SQLite.
  • OCScore training, ablation, cross-validation, SHAP, plotting, and scoring utilities.
  • Reproducibility helpers, environment diagnostics, and Docker/Singularity wrappers.

Documentation

Installation

OCDocker is easiest to run inside a conda or mamba environment.

mamba create -n ocdocker python=3.11 -y
conda activate ocdocker
pip install ocdocker

For development from source:

git clone https://github.com/Arturossi/OCDocker.git
cd OCDocker
mamba create -n ocdocker python=3.11 -y
conda activate ocdocker
./scripts/vendor_oddt.sh
pip install -e ".[all,dev]"

scripts/vendor_oddt.sh pulls in our ODDT fork, which carries fixes on top of upstream ODDT that OCDocker's rescoring depends on. It has to run before pip install -e because the oddt package is bundled as source ([tool.setuptools.packages.find] picks up the local oddt/ directory it creates), not installed as a normal dependency -- PyPI rejects uploads whose metadata references a git dependency, so a plain pip install ocdocker gets the fork the same way, just vendored in at release-build time instead of by hand. Skipping this step leaves import oddt resolving to whatever (if any) vanilla oddt package happens to already be on your PYTHONPATH, which does not have the fixes this project relies on.

Minimal system packages for Ubuntu/Debian:

sudo apt-get install openbabel libopenbabel-dev swig cmake g++

Feature-specific extras:

pip install "ocdocker[docking]"   # docking workflows
pip install "ocdocker[db]"        # PostgreSQL/MySQL storage
pip install "ocdocker[ml]"        # OCScore training and scoring
pip install "ocdocker[analysis]"  # plots, statistics, SHAP helpers
pip install "ocdocker[workflow]"  # Snakemake integration
pip install "ocdocker[all]"       # all runtime stacks

Quick Start

Use SQLite for local tests and quick experiments:

export OCDOCKER_DB_BACKEND=sqlite
ocdocker doctor

Run a single docking engine:

ocdocker vs \
  --engine vina \
  --receptor path/to/receptor.pdb \
  --ligand path/to/ligand.sdf \
  --box path/to/box.pdb \
  --timeout 600

Run the full docking pipeline:

ocdocker pipeline \
  --receptor path/to/receptor.pdb \
  --ligand path/to/ligand.sdf \
  --box path/to/box.pdb \
  --engines vina,smina,plants \
  --outdir runs/example

Run scheduler-friendly pipeline stages:

ocdocker pipeline prepare --help
ocdocker pipeline dock --help
ocdocker pipeline collect --help
ocdocker pipeline cluster --help
ocdocker pipeline rescore --help
ocdocker pipeline export --help

OCScore

OCScore workflows are available under ocdocker ocscore.

ocdocker ocscore reduce --help
ocdocker ocscore train --help
ocdocker ocscore score --help

For the full reproducible protocol, including reduction, training, ablations, statistics, plots, and SHAP analysis, use:

Configuration

Create a starter config:

ocdocker init-config --conf OCDocker.cfg

Common environment variables:

  • OCDOCKER_CONFIG: path to OCDocker.cfg or OCDocker.yml.
  • OCDOCKER_DB_BACKEND: postgresql, mysql, or sqlite.
  • OCDOCKER_SQLITE_PATH: custom SQLite database path.
  • OCDOCKER_TIMEOUT: default external-tool timeout in seconds.
  • OCDOCKER_THREADS: scheduler-provided worker count.
  • OCDOCKER_TMP_DIR: job-local temporary directory.

For server databases, see docs/source/database_setup.md.

Containers

Docker and Singularity helpers live under containers/.

Docker wrapper:

containers/docker/install_docker.sh --install-ocd
export OCDOCKER_DB_PASS='<db_password>'
ocd doctor

Use MySQL instead of the default PostgreSQL service:

export OCDOCKER_DB_BACKEND=mysql
export OCDOCKER_DB_PASS='<db_password>'
export MYSQL_ROOT_PASSWORD='<root_password>'
ocd doctor

More details: docs/source/container_usage.md.

Diagnostics and Reproducibility

Check the environment:

ocdocker doctor --conf OCDocker.cfg

Generate a reproducibility manifest:

ocdocker manifest --conf OCDocker.cfg --output reproducibility_manifest.json

Testing

pytest -q
pytest --cov=OCDocker --cov-report=term-missing

External docking binaries are not required for most unit tests. End-to-end docking runs require the configured tools to be available on the system or in the container.

License

OCDocker is released under the BSD 3-Clause License. Copyright is held by Federal University of Rio de Janeiro (UFRJ), Artur Duque Rossi, and Pedro Henrique Monteiro Torres only (see NOTICE). You may use, modify, and redistribute the software for any purpose, including commercial work, provided you include the BSD license notice. Please credit UFRJ and the copyright holders in publications. Community contributors are acknowledged in COLLABORATORS.md.

Community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ocdocker-0.15.3.tar.gz (825.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ocdocker-0.15.3-py3-none-any.whl (961.0 kB view details)

Uploaded Python 3

File details

Details for the file ocdocker-0.15.3.tar.gz.

File metadata

  • Download URL: ocdocker-0.15.3.tar.gz
  • Upload date:
  • Size: 825.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ocdocker-0.15.3.tar.gz
Algorithm Hash digest
SHA256 343c653decbdd6849426807fff37a13f2ec6e105ec87a2dfc10bb46b8eeb615b
MD5 6944f44a9c91f052983b9a2ca8ce8398
BLAKE2b-256 3d1ce37aa3a08cebb4ff8367c908477c64ad95bffcf20bea3caab7e5525daf61

See more details on using hashes here.

Provenance

The following attestation bundles were made for ocdocker-0.15.3.tar.gz:

Publisher: publish.yml on Arturossi/OCDocker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ocdocker-0.15.3-py3-none-any.whl.

File metadata

  • Download URL: ocdocker-0.15.3-py3-none-any.whl
  • Upload date:
  • Size: 961.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ocdocker-0.15.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bf262358c29e73df67cb5047ea5d0f98f8ae9f1d1ddb80ebcae6818e60ec0d73
MD5 d4226819ebae1cbb66954cbd41e65ac5
BLAKE2b-256 a4afb5af34834cd2de3887ac8f2ae12964578b91632c5dfb888b5dbebe7b5cfb

See more details on using hashes here.

Provenance

The following attestation bundles were made for ocdocker-0.15.3-py3-none-any.whl:

Publisher: publish.yml on Arturossi/OCDocker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page