Metadata-Version: 2.4
Name: acpype
Version: 2026.9.2
Summary: ACPYPE - AnteChamber PYthon Parser interfacE
Keywords: acpype,amber,gromacs
Author: Alan Silva
Author-email: Alan Silva <alanwilter@gmail.com>
License-Expression: GPL-3.0-or-later
License-File: LICENSE
Classifier: Intended Audience :: Science/Research
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Typing :: Typed
Requires-Dist: openbabel-wheel>=3.1.1.23
Requires-Dist: rich>=14.2.0
Requires-Dist: typer>=0.20.0
Requires-Python: >=3.12
Project-URL: Bug Tracker, https://github.com/alanwilter/acpype/issues
Project-URL: DOI, https://doi.org/10.1186/1756-0500-5-367
Project-URL: Docs, https://acpype.readthedocs.io
Project-URL: Homepage, https://alanwilter.github.io/acpype/
Project-URL: Repository, https://github.com/alanwilter/acpype
Project-URL: Wiki, https://github.com/alanwilter/acpype/wiki
Description-Content-Type: text/markdown

# ACPYPE

[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg?style=plastic)](https://GitHub.com/alanwilter/acpype/graphs/commit-activity)<!-- [![Open Source Love](https://badges.frapsoft.com/os/v2/open-source.svg?v=103&style=plastic)](https://github.com/ellerbrock/open-source-badges/) -->
[![GitHub](https://img.shields.io/github/license/alanwilter/acpype?style=plastic)](https://github.com/alanwilter/acpype)
[![python](https://img.shields.io/badge/python-3.12%2E%2E%2E3.14-blue.svg?style=plastic&logo=python)](https://github.com/alanwilter/acpype)
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/alanwilter/acpype?display_name=tag&logo=github&style=plastic)](https://github.com/alanwilter/acpype)
[![GitHub Release](https://img.shields.io/github/release-date/alanwilter/acpype?style=plastic&logo=github)](https://github.com/alanwilter/acpype)<!-- ![GitHub All Releases](https://img.shields.io/github/downloads/alanwilter/acpype/total?style=plastic) -->
[![Docker Pulls](https://img.shields.io/docker/pulls/acpype/acpype?style=plastic&logo=docker)](https://hub.docker.com/r/acpype/acpype)
[![Docker Image Size (tag)](https://img.shields.io/docker/image-size/acpype/acpype/latest?style=plastic&logo=docker)](https://hub.docker.com/r/acpype/acpype/tags)
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/acpype.svg?style=plastic&logo=conda-forge)](https://anaconda.org/conda-forge/acpype)
[![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/acpype.svg?style=plastic&logo=conda-forge)](https://anaconda.org/conda-forge/acpype/files)<!-- ![Conda](https://img.shields.io/conda/pn/conda-forge/acpype?logo=conda-forge&style=plastic) -->
[![PyPI](https://img.shields.io/pypi/v/acpype?style=plastic&logo=pypi)](https://pypi.org/project/acpype/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/acpype?style=plastic&logo=pypi)](https://pypi.org/project/acpype/#files)
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/alanwilter/acpype/.github%2Fworkflows%2Fcheck_acpype.yml?branch=main&style=plastic)
[![uv](https://img.shields.io/endpoint?style=plastic&url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
[![Ruff](https://img.shields.io/endpoint?style=plastic&url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![ty](https://img.shields.io/endpoint?style=plastic&url=https://raw.githubusercontent.com/astral-sh/ty/main/assets/badge/v0.json)](https://github.com/astral-sh/ty)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=plastic)](https://github.com/pre-commit/pre-commit)
[![Commits since release](https://img.shields.io/github/commits-since/alanwilter/acpype/2026.9.2/main?style=plastic)](https://github.com/alanwilter/acpype/commits/main)
[![Codecov](https://img.shields.io/codecov/c/github/alanwilter/acpype?style=plastic)](https://app.codecov.io/gh/alanwilter/acpype)
[![Documentation Status](https://readthedocs.org/projects/acpype/badge/?version=latest&style=plastic)](https://acpype.readthedocs.io/en/latest/?badge=latest)
[![Citations Badge](https://img.shields.io/endpoint?label=citations&logo=googlescholar&style=plastic&url=https%3A%2F%2Fapi.juleskreuer.eu%2Fcitation-badge.php%3Fshield%26doi%3D10.1186%2F1756-0500-5-367)](https://scholar.google.com/citations?view_op=view_citation&hl=en&user=c68TiIUAAAAJ&citation_for_view=c68TiIUAAAAJ:UeHWp8X0CEIC)

<!-- [![Citations](https://img.shields.io/endpoint?label=citations&logo=googlescholar&style=plastic&url=https%3A%2F%2Fcitations-acpype-1g51xat28cdv.runkit.sh%2F)](https://scholar.google.com/citations?view_op=view_citation&hl=en&user=c68TiIUAAAAJ&citation_for_view=c68TiIUAAAAJ:UeHWp8X0CEIC) -->

<!-- ![Scrutinizer code quality (GitHub/Bitbucket)](https://img.shields.io/scrutinizer/quality/g/alanwilter/acpype) -->
<!-- ![Scrutinizer coverage (GitHub/BitBucket)](https://img.shields.io/scrutinizer/coverage/g/alanwilter/acpype) -->

## 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](http://ffamber.cnsm.csulb.edu/)) as well as to XPLOR/CNS (see [`xplor-nih`](http://ambermd.org/xplor-nih.html)) and [CHARMM](https://www.charmm.org/).

This code is released under **[GNU General Public Licence V3](https://www.gnu.org/licenses/gpl-3.0.en.html)**.

See online [documentation](https://acpype.readthedocs.io/) 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](http://www.yasara.org/autosmiles.htm) (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](https://doi.org/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](https://doi.org/10.1016/j.jmgm.2005.12.005)
>
> 1. 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](https://doi.org/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](https://doi.org/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](https://doi.org/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:

```bash
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:

```bash
acpype -p FFF_AC.prmtop -x FFF_AC.inpcrd
```

Useful options for the first mode: `-c` charge method (`bcc`, `abcg2`, `gas`, `user`
— `abcg2` 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](http://bio2byte.be/acpype/)** (but it **does not** have the `amb2gmx` functionality).

To run `acpype`, locally, with its all functionalities, you need **ANTECHAMBER** from package
[AmberTools](http://ambermd.org/) and
[Open Babel](http://openbabel.org) 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](http://www.python.org)_.

There are several ways of obtaining `acpype`:

1. Via **[CONDA](https://anaconda.org/search?q=acpype)**:

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

   ```bash
   conda install -c conda-forge acpype
   ```

2. Via **[PyPI](https://pypi.org/project/acpype/)**:

   ```bash
   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:

   ```bash
   # 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`:

   ```bash
   # 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`)_

   ```bash
   # 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](https://hub.docker.com/repository/docker/acpype/acpype/)**:

   _(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:

   ```bash
   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:

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

   Commands:

   ```bash
   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](https://github.com/conda-forge/acpype-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](https://github.com/Amber-MD/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`:

  ```bash
  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:

```bash
./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](https://archive.epa.gov/med/med_archive_03/web/html/smiles.html) notation:

```bash
./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:

```bash
./run_acpype.py -h
```

##### To Install

At folder `acpype/`, type:

```bash
  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

```bash
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

```bash
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

```bash
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

```bash
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:

```bash
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:

```bash
cns < FFF_CNS.inp
```

#### To Verify with NAMD

- see [TutorialNAMD](../../wiki/Tutorial-NAMD)
