Skip to main content

ms_adtools

AutoDock preparation on RDKit and gemmi: ligand PDBQT, receptor PDBQT (PDB, mmCIF, PQR, PDBQT, mol2), the rigid/flexible pair for flexible-residue docking as AutoDockTools writes it, and docked poses (PDBQT, DLG) back to RDKit. Requires only numpy, gemmi and rdkit.

pip install ms_adtools

Why

Performance. A virtual screen prepares molecules in many parallel workers, so what each worker loads matters as much as how fast it runs. meeko, the reference preparation tool for AutoDock, brings heavy dependencies (scipy, pandas, prody): importing it alone takes about 240 MB, and preparing a receptor peaks above 350 MB. ms_adtools follows its ligand conventions (typing, torsion tree, REMARK SMILES / IDX / H PARENT), so its ligand PDBQT reads the same, with numpy, gemmi and RDKit as the only requirements: a worker that prepares a receptor peaks at about 80 MB.

Command line

ms_adtools ligand lig.sdf -o lig.pdbqt              # SDF, MOL, mol2, or .smi (embedded in 3D)
ms_adtools ligand library.smi -o library/           # several molecules: one PDBQT each
ms_adtools receptor 1iep.pdb -o 1iep.pdbqt          # --repairs hydrogens, --zinc, --ccd, --charges
ms_adtools flexreceptor 1iep.pdbqt -r "A:239,315"   # writes 1iep_rigid.pdbqt + 1iep_flex.pdbqt
ms_adtools poses docked.pdbqt -o poses.sdf          # or a .dlg; one record per pose, with its score

ms_adtools <command> -h lists every option. A molecule that fails is reported on stderr and the rest of the library goes on (exit code 1 if any failed).

Selecting residues

-r / residues= takes chains and residue numbers, comma- or space-separated:

selection means
A:2-10,B:20 residues 2 to 10 of chain A, 20 of chain B
A:2,4,6 three residues of chain A (a chain holds until the next one)
A:ARG239,THR315 with names, which must then match
100 / 100A any chain; 100 takes its insertion codes, 100A only that one

Residues with nothing to rotate (Gly, Ala) and Pro stay rigid, with a warning.

Python API

from rdkit import Chem
from rdkit.Chem import AllChem
from ms_adtools import prepare_ligand, prepare_receptor, prepare_flexreceptor, pdbqt_to_rdkit

mol = Chem.AddHs(Chem.MolFromSmiles("CC(=O)Nc1ccc(O)cc1"))
AllChem.EmbedMolecule(mol)
pdbqt = prepare_ligand(mol)                         # str, with REMARK SMILES / IDX / H PARENT
receptor = prepare_receptor("1iep.pdb")             # str
rigid, flex = prepare_flexreceptor("1iep.pdbqt", "A:239,315")
poses = pdbqt_to_rdkit(docked_text)                 # one conformer per MODEL, `score` on each
function returns
prepare_ligand(mol, open_macrocycles=False, hydrate=False, flexible_amides=False, ...) ligand PDBQT text
prepare_reactive_ligand(mol, smarts, idx=0, ...) ligand PDBQT with the reactive atom typed
prepare_receptor(path, repairs="", charges=None, cleanup=..., zinc=False, ccd=False) receptor PDBQT text
prepare_flexreceptor(path, residues, reactive=()) (rigid, flex) PDBQT texts
pdbqt_to_rdkit(text) RDKit molecule, one conformer per pose
dlg_to_pdbqt(text, cluster_leads=True) PDBQT poses of an AutoDock4/AutoDock-GPU DLG
flexres_models(text, rigid=None) docked flexible residues as a multi-model PDB
add_zinc_pseudo_atoms(pdbqt) receptor PDBQT with AutoDock4Zn TZ atoms

ms_adtools.reactive.reactive_config writes the config of reactive docking; ms_adtools.zinc.PARAMETERS is the AD4Zn.dat that autogrid4 needs for AutoDock4Zn maps. Each function's docstring has the details.

Speed and memory

One CPU, Python 3.12, RDKit 2026.09; each row is a fresh process.

wall peak RSS
import 0.12 s 71 MB
200 ligands (Enamine, 3D) 0.29 s (1.5 ms each) 72 MB
receptor (4uwh, 4905 atoms) 0.16 s 83 MB

On 1iep_receptorH.pdb the receptor has AutoDockTools' atoms and types (charges within 0.02 on average), and prepare_flexreceptor writes its rigid file byte for byte. benchmarks/ has the script and the full measurements.

License

MIT (LICENSE). The PDBQT conventions are AutoDockTools' (MGLTools, M. Sanner, TSRI) and the Forli lab's; cite them with AutoDock. src/ms_adtools/zinc/ carries AutoDock Vina's zinc_pseudo.py (Apache-2.0) and the unmodified AD4Zn.dat parameter file (GPL-2.0-or-later data), each with its own license (see its NOTICE).

Metadata

Release files for ms-adtools 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ms-adtools 0.1.0
File Size Uploaded Provenance Actions
ms_adtools-0.1.0.tar.gz 211.8 kB With provenance Details for ms_adtools-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ms-adtools 0.1.0
File Interpreter ABI Platform Actions
ms_adtools-0.1.0-py3-none-any.whl Python 3 none any Details for ms_adtools-0.1.0-py3-none-any.whl

Total release size: 280.5 kB

Release files / ms_adtools-0.1.0.tar.gz

Download URL ms_adtools-0.1.0.tar.gz
Size 211.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3289fa96f2a15e02ebb10a098e3b9223d3480605443188fe0e3783d5326cd583
BLAKE2b-256 checksum
How to use checksums
700edefec4ae4c99e96d38f3466c90c107c658bf210d157351750f27cd9ac8ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / ms_adtools-0.1.0-py3-none-any.whl

Download URL ms_adtools-0.1.0-py3-none-any.whl
Size 68.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e377edf27a1753ff15f163b856a50afc32c29ba6596227e31e56acd41b926797
BLAKE2b-256 checksum
How to use checksums
32b229426230cead883bed99c77a4b4c7abf03b8ccbf0c6e4ade9e1ae209f3ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for ms-adtools 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ms_adtools-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page