Skip to content
Automatic MARTINI parametrization of small organic molecules
Python Shell
Branch: master
Clone or download

Latest commit

Latest commit 4def3fa Sep 16, 2019


Type Name Latest commit message Commit time
Failed to load latest commit information.
paropt Mapping optimization Dec 2, 2014
.gitignore Initial commit Jul 30, 2014
LICENSE Initial commit Jul 30, 2014 Updated readme Sep 9, 2019
auto_martini Updated to version used in Resolution Limit paper Sep 9, 2019 Added Sep 16, 2019


Author: Tristan Bereau (Max Planck Institute for Polymer Research, Mainz, Germany)
Created: 2014
Modified: 2019 by Kiran H. Kanekal, Mara Jochum, and Tristan Bereau

Automated MARTINI mapping and parametrization of small organic molecules.


For a detailed account of the software, see:

Bereau and Kremer, J Chem Theory Comput, DOI:10.1021/acs.jctc.5b00056 (2015) link

DOI for Citing auto_martini

Please consider citing the paper if you find auto_martini useful in your research.

author = {Bereau, Tristan and Kremer, Kurt},
title = {Automated parametrization of the coarse-grained MARTINI force field 
    for small organic molecules},
journal = {J Chem Theory Comput},
year = {2015},
volume = {11},
number = {6},
pages = {2783--2791},
doi = {10.1021/acs.jctc.5b00056}

The modifications are detailed in the supporting information of the following article: Kanekal, Kiran H., and Tristan Bereau. "Resolution limit of data-driven coarse-grained models spanning chemical space." arXiv preprint arXiv:1907.04082 (2019).


auto-martini is a python script that requires a number of dependencies:

numpy and rdkit can be installed by some package managers. Otherwise you'll have to compile it from source. beautifulsoup and requests can easily be installed using pip or easy_install. In case you do not have root access to your computer to install new software, have a look at virtualenv.

Once all the dependencies are correctly installed, a call to the program should return a usage-information message similar to the following:

usage: auto-martini [-h] (--sdf SDF | --smi SMI) --mol MOLNAME [--xyz XYZ]
                    [--gro GRO] [--verbose] [--fpred]
auto-martini: error: argument --mol is required


To coarse-grain a molecule, simply provide its SMILES code (option --smi SMI) or a .SDF file (option '--sdf file.sdf). You also need to provide a name for the CG molecule (not longer than 5 characters) using the --mol option. For instance, to coarse grain guanazole, you can either obtain/generate (e.g., from Open Babel) an SDF file:

auto-martini --sdf guanazole.sdf --mol GUA

(the name GUA is arbitrary) or use its SMILES code within double quotes

auto-martini --smi "N1=C(N)NN=C1N" --mol GUA

In case no problem arises, it will output the gromacs .itp file:

;;;; GENERATED WITH auto-martini
; Tristan Bereau (2014)

; molname       nrexcl
  GUA           2

; id    type    resnr   residu  atom    cgnr    charge  smiles
  1     SP1     1       GUA     S01     1       0     ; Nc1ncnn1
  2     SP1     1       GUA     S02     2       0     ; Nc1ncnn1

;  i   j     funct   length
   1   2     1       0.21

Optionally, the code can also output a corresponding .gro file for the coarse-grained coordinates

auto-martini --smi "N1=C(N)NN=C1N" --mol GUA --gro gua.gro

Atomistic coordinates can be output in XYZ format using the --xyz option.


Prediction algorithm

Since ALOGPS, the prediction algorithm for octanol/water partitioning, relies on whole fragments rather than individual atoms, the prediction of certain fragments can pose problem, e.g., small inorganic groups. In this case, auto-martini tries to parametrize alternative mappings. If none of them shows successful, the code will return an error.

; ERROR: no successful mapping found.
; Try running with the '--fpred' and/or '--verbose' options.

As mentioned in the error message, an alternative solution consists of relying on an atom-based partitioning coefficient prediction algorithm (Wildman-Crippen), which is less accurate but can predict any fragment. In case the --fpred option is selected, only fragments for which ALOGPS fail will be predicted using Wildman-Crippen.

Boost error

Some versions of Boost will fail to correctly exit at the end of the program, generating such output messages:

python: /usr/include/boost/thread/pthread/mutex.hpp:108: boost::mutex::~mutex(): Assertion `!posix::pthread_mutex_destroy(&m)' failed.
[1]    31433 abort (core dumped)  ./auto_martini --smi "N1=C(N)NN=C1N" --mol GUA

the results provided by the code are unaffected by this error message. Simply ignore it.

RDKit outdated

Older RDKit versions will report the following error:

distBdAt = Chem.rdMolTransforms.GetBondLength(conf,i,beadId)
AttributeError: 'module' object has no attribute 'GetBondLength'

Simply update your version of RDKit. Most package managers will allow you to do this, unless you've installed RDKit from source.

You can’t perform that action at this time.