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, --ion-charges, --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, ion_charges=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.
With ccd=True, the common cofactors (ms_adtools.templates.COFACTORS: ATP, NAD, FAD, HEM, SAM, ...)
use built-in templates at pH 7, with no download; other non-standard residues are fetched from
the CCD once. ion_charges=True gives bare Mg, Mn, Ca, Fe and Cu ions their formal charge (zinc stays 0).
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.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ms_adtools-0.2.0.tar.gz | 216.5 kB | With provenance | Details for ms_adtools-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ms_adtools-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for ms_adtools-0.2.0-py3-none-any.whl |
Total release size: 287.8 kB
Release files / ms_adtools-0.2.0.tar.gz
| Download URL | ms_adtools-0.2.0.tar.gz |
|---|---|
| Size | 216.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cb803bd4f590cfd697cb2b9d4f653487767a17b8ca23c46ae19c5766f05eafe6
|
|
BLAKE2b-256 checksum How to use checksums |
8944a6682f75adc62adbd75d9788c9692e8f72cc2b75afc9f517aa52212377d3
|
| 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 18, 2026.
Transparency logRelease files / ms_adtools-0.2.0-py3-none-any.whl
| Download URL | ms_adtools-0.2.0-py3-none-any.whl |
|---|---|
| Size | 71.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b93bcb5e518a6935f9589fa990e1482e3a274c1d5bbf466261ce289f3790565d
|
|
BLAKE2b-256 checksum How to use checksums |
d8991879908d6b81377a412e44265a464a3f796667b3e4273eb6c69a8fbff325
|
| 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 18, 2026.
Transparency logSecurity for ms-adtools 0.2.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.
Attestation for ms_adtools-0.2.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 18, 2026.
Transparency logA 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.