Skip to main content

Command-line molecular docking powered by AutoDock Vina, pKaNET, and RDKit

Project description

anyone can dock — CLI

Molecular docking from the command line, powered by AutoDock Vina 1.2.7, pKaNET Cloud+, and RDKit.

Installation

System dependencies (Ubuntu / Debian)

sudo apt-get install -y openbabel libopenbabel-dev \
  libcairo2-dev libpango1.0-dev libpangocairo-1.0-0

pip (recommended)

# 1. clone the repository
git clone https://github.com/nyelidl/anyone-docking.git
cd anyone-docking

# 2. install in editable mode  (add [all] for ADMET-AI + PNG export)
pip install -e .
pip install -e ".[all]"

conda

conda create -n acd python=3.11 -y
conda activate acd

# system libs via conda-forge
conda install -c conda-forge openbabel cairosvg rdkit prody -y

# package itself
pip install -e .

After installation the acd command is available in your shell.


Commands

acd --help
acd dock     --help
acd batch    --help
acd receptor --help
acd ligand   --help
acd diagram  --help

Quick examples

1. Full single-ligand docking (PDB ID + SMILES)

acd dock \
  --receptor 1M17 \
  --smiles "COCCOC1=C(C=C2C(=C1)C(=NC=N2)NC3=CC=CC(=C3)C#C)OCCOC" \
  --name erlotinib \
  --ph 7.4 \
  --exhaustiveness 16 \
  --output ./erlotinib_dock

Output in ./erlotinib_dock/:

receptor/rec.pdb
receptor/rec.pdbqt
receptor/receptor_summary.json
ligand/erlotinib.pdbqt
erlotinib_out.pdbqt      ← all poses
erlotinib_out.sdf
erlotinib_pv_ready.sdf   ← bond-order corrected
erlotinib_scores.csv

2. Add 2D interaction diagram and save per-pose files

acd dock \
  --receptor 1M17 \
  --smiles "COCCOC1=C(C=C2C(=C1)C(=NC=N2)NC3=CC=CC(=C3)C#C)OCCOC" \
  --name erlotinib \
  --diagram \
  --save-poses \
  --output ./erlotinib_full

3. Use a local PDB/CIF file

acd dock \
  --receptor my_homology_model.pdb \
  --smiles "CCc1nn(C)c2cc(-c3cncnc3Nc3cccc(S(N)(=O)=O)c3)ccc12" \
  --name compound_1 \
  --center manual --cx 14.2 --cy -3.8 --cz 22.1 \
  --bx 22 --by 22 --bz 22

4. Batch docking from a .smi file

# compounds.smi: one "SMILES name" per line
cat > compounds.smi << 'EOF'
O=c1cc(-c2ccc(O)cc2)oc2cc(O)cc(O)c12 Apigenin
O=c1cc(-c2ccccc2)oc2cc(O)c(O)c(O)c12 Baicalein
COCCOC1=C(C=C2C(=C1)C(=NC=N2)NC3=CC=CC(=C3)C#C)OCCOC Erlotinib
EOF

acd batch \
  --receptor 1M17 \
  --ligands compounds.smi \
  --ph 7.4 \
  --exhaustiveness 8 \
  --redock-smiles "COCCOC1=C(C=C2C(=C1)C(=NC=N2)NC3=CC=CC(=C3)C#C)OCCOC Erlotinib" \
  --output ./batch_egfr

Output ./batch_egfr/batch_scores.csv:

Name,SMILES,Prepared SMILES,Top Score,Charge,Status,...
Erlotinib,...,-9.12,0,OK,...
Apigenin,...,-8.44,0,OK,...
Baicalein,...,-8.01,0,OK,...

5. Prepare receptor once, re-use for many batch runs

# Step A — prepare receptor (saved as JSON)
acd receptor --pdb 1M17 --output ./rec_1m17

# Step B — batch with saved receptor (no re-download or re-prep)
acd batch \
  --receptor-json ./rec_1m17/receptor_summary.json \
  --ligands library.smi \
  --output ./screen_run_1

6. Stand-alone 2D diagram for an existing docking result

acd diagram \
  --receptor ./rec_1m17/receptor/rec.pdb \
  --pose-sdf  ./erlotinib_dock/erlotinib_pv_ready.sdf \
  --smiles "COCCOC1=C(C=C2C(=C1)C(=NC=N2)NC3=CC=CC(=C3)C#C)OCCOC" \
  --name erlotinib \
  --pose 1 \
  --score -9.4 \
  --output ./diagrams

Programmatic use (Python API)

from anyonecandock import (
    prepare_receptor,
    prepare_ligand,
    run_vina,
    get_vina_binary,
    fix_sdf_bond_orders,
    draw_interaction_diagram,
)
from pathlib import Path

wdir = Path("./my_run")
wdir.mkdir(exist_ok=True)

# 1. Receptor
rec = prepare_receptor(
    raw_pdb="1M17.pdb",
    wdir=wdir,
    center_mode="auto",
    box_size=(18, 18, 18),
)

# 2. Ligand
lig = prepare_ligand(
    smiles="COCCOC1=C(...)OCCOC",
    name="erlotinib",
    ph=7.4,
    wdir=wdir,
    mode="pkanet",
    conformer_seed=None,  # default: random; set a positive integer to reproduce 3D coordinates
)

# 3. Vina
vina, _ = get_vina_binary()
dock = run_vina(
    receptor_pdbqt=rec["rec_pdbqt"],
    ligand_pdbqt=lig["pdbqt"],
    config_txt=rec["config_txt"],
    vina_path=vina,
    exhaustiveness=16,
    n_modes=10,
    energy_range=3,
    wdir=wdir,
    out_name="erlotinib",
)
print(f"Best score: {dock['top_score']:.2f} kcal/mol")

# 4. 2D diagram
svg = draw_interaction_diagram(
    receptor_pdb=rec["rec_fh"],
    pose_sdf=dock["out_sdf"],
    smiles=lig["prot_smiles"],
    title="Erlotinib · 1M17",
)
Path("diagram.svg").write_bytes(svg)

Environment variables

Variable Default Effect
VINA_PATH auto-downloaded Point to a custom Vina binary
ACD_WORKDIR temp dir per run Persistent working directory

Optional extras

Feature Install
PNG export for diagrams pip install cairosvg
ADMET predictions pip install admet-ai
Pretty terminal tables pip install rich
ML pKa backend pip install pkasolver

Citation

If you use Anyone Can Dock in your research, please cite:

Hengphasatporn et al. J. Chem. Inf. Model. 2026 — DFDD
Eberhardt et al. J. Chem. Inf. Model. 2021, 61, 3891–3898 — AutoDock Vina 1.2.7

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

anyonecandock-1.2.6.tar.gz (116.4 kB view details)

Uploaded Source

Built Distribution

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

anyonecandock-1.2.6-py3-none-any.whl (116.2 kB view details)

Uploaded Python 3

File details

Details for the file anyonecandock-1.2.6.tar.gz.

File metadata

  • Download URL: anyonecandock-1.2.6.tar.gz
  • Upload date:
  • Size: 116.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.13

File hashes

Hashes for anyonecandock-1.2.6.tar.gz
Algorithm Hash digest
SHA256 8c5e629d5e0fa02d42d32f71ab49a9f70f31f565e63c9ac353e1d9fd2178281c
MD5 a26f528f91788b8630a799b3b8d38a7e
BLAKE2b-256 12aa3716a9933b5877a2d13db312e4f3b98d97e99d2ee56bb2f8abc064103c97

See more details on using hashes here.

File details

Details for the file anyonecandock-1.2.6-py3-none-any.whl.

File metadata

  • Download URL: anyonecandock-1.2.6-py3-none-any.whl
  • Upload date:
  • Size: 116.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.13

File hashes

Hashes for anyonecandock-1.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8e6bc95998cdbab8058f942ec54da16fa3f1e6de5de65a330e6dfb12e6ecc6f8
MD5 4e99471ec7b2f0cf4ba187ff15a0da36
BLAKE2b-256 d5f9d1d523cbcc6a0d6611ee831ef28e6f5f615225e75c7a05d20ddd05e066bd

See more details on using hashes here.

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