GAFF2 Molecule
The GAFF2 Molecule follows similar paradigms as the CGenFF Molecule in terms of parsing. GAFF2 also includes a penalty score which makes this more interesting to capture.

The equation differs slightly in terms of the harmonics and recent additions have been the impropers. The parser was built to handle frcmod files into dataframes and update their values accordingly.
An example of the format can be found here in terms of how the frcmod is defined and what all the numbers mean:
BOND
atom type | force constant | bond length
ca-ns 315.20 1.412 same as ca- n, penalty score= 0.0
ANGLE
atom type | force constant | angle degree
c -ns-ca 65.700 123.710 same as c -n -ca, penalty score= 0.0
DIHE
atom type | idivf1 | force constant | phase | periodicity
o -c -ns-ca 4 10.000 180.000 2.000 same as X -c -n -X , penalty score= 0.0
IMPROPER
atom type | force constant | phase | periodicity
ca-ca-ca-ns 1.1 180.0 2.0 Using the default value
NONBON
atom type | rmin half | epsilon
Import the Package
from global_chem_extensions import GlobalChemExtensions
gce = GlobalChemExtensions()
Read in GAFF2 frcmod File
gaff2_molecule = gce.initialize_gaff2_molecule('file.frcmod')
print (gaff2_molecule)
Access Non-Bonded and Bonded DataFrames
gaff2_molecule = gce.initialize_gaff2_molecule('file.frcmod')
print (gaff2_molecule.nonbonded_dataframe)
print (gaff2_molecule.bonded_dataframe)
Update a value in Bonded DataFrames
Harmonic values refers to anything that is either a bond-length, angle, dihedral or improper angle. Multiplicity only refers to dihedrals or impropers.
gaff2_molecule = gce.initialize_gaff2_molecule('file.frcmod')
gaff2_molecule.update_bonded_dataframe(
'ca-ca-ns-hn',
200,
force_constant=True,
harmonic_value=False,
multiplicity=False,
fluctuation=False,
)
print (gaff2_molecule.new_bonded_dataframe)
Access Manipulated Non-Bonded and Bonded DataFrames
The values to update are the Rmin and the epsilon values.
gaff2_molecule = gce.initialize_gaff2_molecule('file.frcmod')
gaff2_molecule.update_nonbonded_dataframe(
'ca-ca',
3,
rmin=True,
epsilon=False,
)
print (gaff2_molecule.new_nonbonded_dataframe)
Write a new Frcmod GAFF2 File
gaff2_molecule = gce.initialize_gaff2_molecule('file.frcmod')
cgenff_molecule.write_frcmod_file()
Accessing Properties on GAFF2 Molecule
print (gaff2_molecule.bond_parameters)
print (gaff2_molecule.angle_parameters)
print (gaff2_molecule.dihedral_parameters)
print (gaff2_molecule.nonbonded_parameters)
print (gaff2_molecule.improper_parameters)
Last updated