This repository provides support for the General Amber Force Field (GAFF) in foyer. Foyer is a part of the Molecular Simulation Design Framework (MoSDeF). A few relevant links are provided below:
There are two primary components to this repository:
- Foyer-compatible XML file for GAFF
- Antechamber wrapper to integrate antechamber atomtyping and AM1-BCC charge assignment directly into MoSDeF workflows.
The following instructions assume you already have foyer installed. If you do not please install foyer before proceeding with these instructions.
git clone https://github.com/rsdefever/antefoyer
cd antefoyer/.
pip install .
The pip install
command should be issued from within the same conda
environment as foyer
is installed.
- foyer > 0.7.3
- ambertools (for the
antefoyer.ante_atomtyping
andantefoyer.ante_charges
functions)
Foyer must be installed from source:
git clone https://github.com/mosdef-hub/foyer.git
cd foyer/
conda install -c omnia -c conda-forge -c mosdef --file requirements.txt
pip install .
Ambertools can be installed via conda:
conda install -c conda-forge ambertools
There are two primary workflows for atomtyping with antefoyer
. The first uses the traditional foyer
approach with SMARTS strings defined in antefoyer/xml/gaff.xml
.
# Assuming we also have mbuild installed for this example
import foyer
import mbuild as mb
# Build/import a molecule
molecule = mb.load('CCC',smiles=True)
# Load GAFF
GAFF = foyer.forcefields.load_GAFF()
# Use foyer to parameterize
parameterized_molecule = GAFF.apply(molecule.to_parmed())
# Save to whatever file format you desire
Note that antefoyer
was never imported. If antefoyer
is properly installed, the GAFF forcefield will become available under foyer.forcefields.load_GAFF()
via entrypoints
.
The second workflow uses the antechamber wrapper. This requires antechamber
to be installed an accesible in your PATH
. Antechamber
can be installed from conda: conda install -c conda-forge ambertools
.
# Assuming we also have mbuild installed for this example
import foyer
import mbuild as mb
# For this we need to import antefoyer
import antefoyer
# Build/import a molecule
molecule = mb.load('CCC', smiles=True)
# Load GAFF
gaff = foyer.forcefields.load_GAFF()
# Identify GAFF atomtypes with antechamber
typed_molecule = antefoyer.ante_atomtyping(molecule, 'gaff')
# Use foyer to parameterize
parameterized_molecule = gaff.parametrize_system(typed_molecule)
# We can also apply AM1-BCC charges from antechamber
molecule_with_charges = antefoyer.ante_charges(parameterized_molecule,'bcc')
# Save to whatever file format you desire
Further details of the SMARTS strings development and testing are provided in a separate repository, GAFF-Foyer.
Project based on the Computational Molecular Science Python Cookiecutter version 1.1.
This material is based upon work supported by the National Science Foundation under Grant #1835874