Skip to main content

ACPYPE

Maintenance GitHub python GitHub release (latest by date) GitHub Release Docker Pulls Docker Image Size (tag) Conda Version Conda Downloads PyPI PyPI - Downloads GitHub Workflow Status (with event) uv Ruff ty pre-commit Commits since release Codecov Documentation Status Citations Badge

AnteChamber PYthon Parser interfacE

A tool based in Python to use Antechamber to generate topologies for chemical compounds and to interface with others python applications like CCPN and ARIA.

acpype is pronounced as ace + pipe

Topologies files to be generated so far: CNS/XPLOR, GROMACS, CHARMM and AMBER.

NB: Topologies generated by acpype/Antechamber are based on General Amber Force Field (GAFF) and should be used only with compatible forcefields like AMBER and its variant.

Several flavours of AMBER FF are ported already for GROMACS (see ffamber) as well as to XPLOR/CNS (see xplor-nih) and CHARMM.

This code is released under GNU General Public Licence V3.

See online documentation for more.

NO WARRANTY AT ALL

It was inspired by:

  • amb2gmx.pl (Eric Sorin, David Mobley and John Chodera) and depends on Antechamber and OpenBabel

  • YASARA Autosmiles (Elmar Krieger)

  • topolbuild (Bruce Ray)

  • xplo2d (G.J. Kleywegt)

For Non-uniform 1-4 scale factor conversion (e.g. if using GLYCAM06), please cite:

BERNARDI, A., FALLER, R., REITH, D., and KIRSCHNER, K. N. ACPYPE update for nonuniform 1–4 scale factors: Conversion of the GLYCAM06 force field from AMBER to GROMACS. SoftwareX 10 (2019), 100241. Doi: 10.1016/j.softx.2019.100241

For Antechamber, please cite:

  1. WANG, J., WANG, W., KOLLMAN, P. A., and CASE, D. A. Automatic atom type and bond type perception in molecular mechanical calculations. Journal of Molecular Graphics and Modelling 25, 2 (2006), 247–260. Doi: 10.1016/j.jmgm.2005.12.005

  2. WANG, J., WOLF, R. M., CALDWELL, J. W., KOLLMAN, P. A., and CASE, D. A. Development and testing of a General Amber Force Field. Journal of Computational Chemistry 25, 9 (2004), 1157–1174. Doi: 10.1002/jcc.20035

If you use this code, I am glad if you cite:

SOUSA DA SILVA, A. W. & VRANKEN, W. F. ACPYPE - AnteChamber PYthon Parser interfacE. BMC Research Notes 5 (2012), 367 Doi: 10.1186/1756-0500-5-367

and (optionally)

BATISTA, P. R.; WILTER, A.; DURHAM, E. H. A. B. & PASCUTTI, P. G. Molecular Dynamics Simulations Applied to the Study of Subtypes of HIV-1 Protease. Cell Biochemistry and Biophysics 44 (2006), 395-404. Doi: 10.1385/CBB:44:3:395

Alan Silva, DSc

alanwilter at gmail dot com

How To Use ACPYPE

What ACPYPE does in one command

acpype has two modes, and both are a single command.

Starting from a small molecule — a .mol2, .pdb, .mdl/.mol file, or even a SMILES string — acpype drives the whole AmberTools pipeline for you:

acpype -i molecule.mol2 -b MOL -c bcc -n 0 -a gaff2

That one line does the work of three separate AmberTools runs:

Step Tool What it does
1 antechamber assigns GAFF/GAFF2 atom types and computes partial charges
2 parmchk2 fills in any missing force field parameters (the frcmod)
3 tleap builds the AMBER topology and coordinates

and then converts the result into GROMACS, CNS/XPLOR and CHARMM formats as well, all into a single MOL.acpype/ folder. There is no need to run antechamber, parmchk2 and tleap yourself, or to convert between formats afterwards.

Starting from existing AMBER files — if you already have a prmtop/inpcrd pair from LEaP, acpype converts them to GROMACS without needing AmberTools at all:

acpype -p FFF_AC.prmtop -x FFF_AC.inpcrd

Useful options for the first mode: -c charge method (bcc, abcg2, gas, userabcg2 is AmberTools' newer method, recommended for GAFF2), -n net charge, -a atom types (gaff2, gaff, amber, amber2), -o which topologies to write (all, gmx, cns, charmm), and -r the antechamber atom/bond type prediction index if the default perception struggles with your molecule. Run acpype -h for the full list and for what every output file is.

Introduction

We now have an up-to-date web service at Bio2Byte (but it does not have the amb2gmx functionality).

To run acpype, locally, with its all functionalities, you need ANTECHAMBER from package AmberTools and Open Babel if your input files are of PDB format.

However, if one wants acpype just to emulate amb2gmx.pl, one needs nothing at all but Python.

There are several ways of obtaining acpype:

  1. Via CONDA:

    (It should be wholesome, fully functional, all batteries included)

    conda install -c conda-forge acpype
    
  2. Via PyPI:

    pip install acpype
    

    acpype ships the AmberTools binaries it needs (currently AmberTools 26) as platform-specific wheels:

    Platform Wheel Batteries included
    Linux x86_64, glibc >= 2.35 (Ubuntu 22.04+, Debian 12+) manylinux_2_35_x86_64 yes
    macOS Apple Silicon, macOS 11+ macosx_11_0_arm64 yes
    anything else (Intel macOS, Linux aarch64, Windows) source distribution no -- supply your own AmberTools

    On a platform with no wheel, pip falls back to the source distribution, which is the same ACPYPE without the bundled binaries. It works fine against an AmberTools you install yourself; if none is found, ACPYPE says so and points you at conda.

    On those two platforms pip install acpype is a complete solution. A handful of common system libraries are deliberately left to the host on Linux:

    # Ubuntu 22.04 / 24.04, Debian 12+ -- needed by the bundled AmberTools
    apt-get install -y libgfortran5 libstdc++6 libgomp1 libblas3 liblapack3 libcurl4
    
    # needed by the openbabel wheel that `pip install acpype` pulls in
    apt-get install -y libxrender1 libxext6 libsm6
    

    Anywhere else, install AmberTools yourself and, optionally but highly recommended, OpenBabel:

    # You can use conda to get the needed 3rd parties for example
    conda create -n acpype --channel conda-forge ambertools openbabel
    
    pip install acpype
    
    # or if you feel daring
    
    pip install git+https://github.com/alanwilter/acpype.git
    

    NB: If using OpenBabel python module, it's really CRITICAL to have it installed in the same Python environment of acpype.

  3. By downloading it via git:

    (Make sure you have AmberTools and, optionally but highly recommended, OpenBabel)

    # You can use conda to get the needed 3rd parties for example
    conda create -n acpype --channel conda-forge ambertools openbabel
    
    # Or for Ubuntu 22.04 / 24.04:
    apt-get install -y openbabel python3-openbabel libgfortran5 libblas3 liblapack3
    
    git clone https://github.com/alanwilter/acpype.git
    

    NB: Using this mode, CHARMM topology files will not be generated.

  4. Via Docker:

    (It should be wholesome, fully functional, all batteries included)

    If you have Docker installed, you can run acpype_docker.sh by:

    NOTE: first time may take some time as it pulls the acpype docker image.

    On Linux / macOS:

    ln -fsv "$PWD/acpype_docker.sh" /usr/local/bin/acpype_docker
    

    On Windows: Using Command Prompt:

    In the directory where the acpype_docker.bat file is found:

    setx /M path "%path%;%cd%"
    

    Commands:

    acpype_docker -i CCCC
    
    acpype_docker -i tests/DDD.pdb -c gas
    

NB: what you get depends on how you install:

  • Via pip and via docker you get a stripped AmberTools 26 embedded -- only the binaries and libraries acpype needs -- so CHARMM topologies work out of the box. That applies to the Linux x86_64 and macOS Apple Silicon wheels (see the table above) and to the docker image. Elsewhere pip installs the source distribution, which carries no binaries and needs an AmberTools of your own.

  • Via conda the build comes from the conda-forge feedstock, which lags this repository and so still carries the older embedded AmberTools. It also pulls ambertools and openbabel as conda packages, and it is that antechamber which ends up on your PATH.

  • OpenBabel is 3.1.1 via conda/docker, and 3.1.0 via pip (from the openbabel-wheel dependency).

  • charmmgen is not part of modern AmberTools, and conda-forge's ambertools does not ship it, so acpype builds its own from the source still maintained in AmberClassic: universal arm64 + x86_64 on macOS, x86_64 on Linux. See scripts/build_charmmgen.sh. If CHARMM output fails because the antechamber on your PATH cannot find it, copy the bundled one next to that antechamber:

    sys=$(python3 -c "import sys; print('macos' if sys.platform == 'darwin' else 'linux')")
    acp=$(python3 -c "import acpype, os; print(os.path.dirname(acpype.__file__))")
    cp "${acp}/amber_${sys}/bin/charmmgen" "$(dirname "$(which antechamber)")"
    
To Test, if doing via git

At folder acpype/, type:

./run_acpype.py -i tests/FFF.pdb

It'll create a folder called FFF.acpype, and inside it one may find topology files for GROMACS and CNS/XPLOR.

Or using a molecule in SMILES notation:

./run_acpype.py -i CCCC # smiles for C4H6 1,3-Butadiene compound

It'll create a folder called smiles_molecule.acpype.

To get help and more information, type:

./run_acpype.py -h
To Install

At folder acpype/, type:

  ln -fsv "$PWD/run_acpype.py" /usr/local/bin/acpype

Then re-login or start another shell session.

If via conda or pip, acpype should be in your $PATH.

To Verify with GMX

GROMACS < v.5.0

cd FFF.acpype/
grompp -c FFF_GMX.gro -p FFF_GMX.top -f em.mdp -o em.tpr
mdrun -v -deffnm em
# And if you have VMD
vmd em.gro em.trr

GROMACS > v.5.0

cd FFF.acpype/
gmx grompp -c FFF_GMX.gro -p FFF_GMX.top -f em.mdp -o em.tpr
gmx mdrun -v -deffnm em
# And if you have VMD
vmd em.gro em.trr
For MD, do

GROMACS < v.5.0

grompp -c em.gro -p FFF_GMX.top -f md.mdp -o md.tpr
mdrun -v -deffnm md
vmd md.gro md.trr

GROMACS > v.5.0

gmx grompp -c em.gro -p FFF_GMX.top -f md.mdp -o md.tpr
gmx mdrun -v -deffnm md
vmd md.gro md.trr

To Emulate amb2gmx.pl

For any given prmtop and inpcrd files (outputs from AMBER LEaP), type:

acpype -p FFF_AC.prmtop -x FFF_AC.inpcrd

The output files FFF_GMX.gro and FFF_GMX.top will be generated inside folder FFF_GMX.amb2gmx

To Verify with CNS/XPLOR

At folder FFF.acpype, type:

cns < FFF_CNS.inp

To Verify with NAMD

Download files

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

Source Distribution

acpype-2026.9.2.tar.gz (74.2 kB view details)

Uploaded Source

Built Distributions

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

acpype-2026.9.2-py3-none-manylinux_2_35_x86_64.whl (48.7 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ x86-64

acpype-2026.9.2-py3-none-macosx_11_0_arm64.whl (69.1 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file acpype-2026.9.2.tar.gz.

File metadata

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

File hashes

Hashes for acpype-2026.9.2.tar.gz
Algorithm Hash digest
SHA256 36cae956f1137a6013eab7131802ce1cfe64fd37da1b12784a7e940ce3b55aea
MD5 a88224c9cbf96dcd592953b9aad8ae29
BLAKE2b-256 20e9369e6ad1cc899ceaf0a7cbfb925b628075965f82490868e0763f8f3ba2b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for acpype-2026.9.2.tar.gz:

Publisher: check_acpype.yml on alanwilter/acpype

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

File details

Details for the file acpype-2026.9.2-py3-none-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for acpype-2026.9.2-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 df2f4c951dedb96f32b674cb12eb54b59b8676afdb7a2cec6faf338e9d1e822c
MD5 0b1d2eb05194ab841579f5a6f36df9df
BLAKE2b-256 17f0615526d2a1db24cdf45fa2313b6d9854da0b8a5a443d46152f0044311506

See more details on using hashes here.

Provenance

The following attestation bundles were made for acpype-2026.9.2-py3-none-manylinux_2_35_x86_64.whl:

Publisher: check_acpype.yml on alanwilter/acpype

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

File details

Details for the file acpype-2026.9.2-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for acpype-2026.9.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5282ce4910a0026baf13ac8a8f710a74e5abaf60f1921007124f1121a15310e1
MD5 f54ba3625e3bc2b5b9fa04a84166a213
BLAKE2b-256 e018bbe73253ca5d1caf0a02107d4dad6a781b09b84a127e712ded291d12c86e

See more details on using hashes here.

Provenance

The following attestation bundles were made for acpype-2026.9.2-py3-none-macosx_11_0_arm64.whl:

Publisher: check_acpype.yml on alanwilter/acpype

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

Release history Release notifications | RSS feed

This release

2026.9.2 This release

3 files

2023.10.27

2 files

2022.7.21

2 files

2022.6.6

2 files

2022.1.3

2 files

2021.12.25

2 files

2021.12.14

2 files

2021.12.3

2 files

2021.11.29

2 files

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