ForceBalance API
1.3
Automated optimization of force fields and empirical potentials
|
Classes | |
class | AbInitio_GMX |
Subclass of AbInitio for force and energy matching using GROMACS. More... | |
class | BindingEnergy_GMX |
Binding energy matching using Gromacs. More... | |
class | GMX |
Derived from Engine object for carrying out general purpose GROMACS calculations. More... | |
class | Interaction_GMX |
Interaction energy matching using GROMACS. More... | |
class | ITP_Reader |
Finite state machine for parsing GROMACS force field files. More... | |
class | Lipid_GMX |
class | Liquid_GMX |
class | Moments_GMX |
Multipole moment matching using GROMACS. More... | |
class | Thermo_GMX |
Thermodynamical property matching using GROMACS. More... | |
class | Vibration_GMX |
Vibrational frequency matching using GROMACS. More... | |
Functions | |
def | edit_mdp (fin=None, fout=None, options={}, defaults={}, verbose=False) |
Read, create or edit a Gromacs MDP file. More... | |
def | write_ndx (fout, grps, fin=None) |
Create or edit a Gromacs ndx file. More... | |
def | parse_atomtype_line (line) |
Parses the 'atomtype' line. More... | |
def | rm_gmx_baks (dir) |
Variables | |
logger = getLogger(__name__) | |
list | nftypes = [None, 'VDW', 'VDW_BHAM'] |
VdW interaction function types. More... | |
list | pftypes = [None, 'VPAIR', 'VPAIR_BHAM'] |
Pairwise interaction function types. More... | |
list | bftypes = [None, 'BONDS', 'G96BONDS', 'MORSE'] |
Bonded interaction function types. More... | |
list | aftypes |
Angle interaction function types. More... | |
list | dftypes = [None, 'PDIHS', 'IDIHS', 'RBDIHS', 'PIMPDIHS', 'FOURDIHS', None, None, 'TABDIHS', 'PDIHMULS'] |
Dihedral interaction function types. More... | |
dictionary | fdict |
Section -> Interaction type dictionary. More... | |
dictionary | pdict |
Interaction type -> Parameter Dictionary. More... | |
def src.gmxio.edit_mdp | ( | fin = None , |
|
fout = None , |
|||
options = {} , |
|||
defaults = {} , |
|||
verbose = False |
|||
) |
Read, create or edit a Gromacs MDP file.
The MDP file contains GROMACS run parameters. If the input file exists, it is parsed and options are replaced where "options" overrides them. If the "options" dictionary contains more options, they are added at the end. If the "defaults" dictionary contains more options, they are added at the end. Keys are standardized to lower-case strings where all dashes are replaced by underscores. The output file contains the same comments and "dressing" as the input. Also returns a dictionary with the final key/value pairs.
fin : str, optional Input .mdp file name containing options that are more important than "defaults", but less important than "options" fout : str, optional Output .mdp file name. options : dict, optional Dictionary containing mdp options. Existing options are replaced, new options are added at the end, None values are deleted from output mdp. defaults : dict, optional defaults Dictionary containing "default" mdp options, added only if they don't already exist. verbose : bool, optional Print out additional information
OrderedDict Key-value pairs combined from the input .mdp and the supplied options/defaults and equivalent to what's printed in the output mdp.
Definition at line 69 of file gmxio.py.
def src.gmxio.parse_atomtype_line | ( | line | ) |
Parses the 'atomtype' line.
Parses lines like this:
opls_135 CT 6 12.0107 0.0000 A 3.5000e-01 2.7614e-01
Look at all the variety!
C 12.0107 0.0000 A 3.7500e-01 4.3932e-01
Na 11 22.9897 0.0000 A 6.068128070229e+03 2.662662556402e+01 0.0000e+00 ; PRM 5 6
[in] | line | Input line. |
Definition at line 268 of file gmxio.py.
def src.gmxio.write_ndx | ( | fout, | |
grps, | |||
fin = None |
|||
) |
list src.gmxio.aftypes |
list src.gmxio.bftypes = [None, 'BONDS', 'G96BONDS', 'MORSE'] |
list src.gmxio.dftypes = [None, 'PDIHS', 'IDIHS', 'RBDIHS', 'PIMPDIHS', 'FOURDIHS', None, None, 'TABDIHS', 'PDIHMULS'] |
dictionary src.gmxio.fdict |
Section -> Interaction type dictionary.
Based on the section you're in and the integer given on the current line, this looks up the 'interaction type' - for example, within bonded interactions there are four interaction types: harmonic, G96, Morse, and quartic interactions.
list src.gmxio.nftypes = [None, 'VDW', 'VDW_BHAM'] |
dictionary src.gmxio.pdict |
Interaction type -> Parameter Dictionary.
A list of supported GROMACS interaction types in force matching. The keys in this dictionary (e.g. 'BONDS','ANGLES') are values in the interaction type dictionary. As the program loops through the force field file, it first looks up the interaction types in 'fdict' and then goes here to do the parameter lookup by field.
This needs to become more flexible because the parameter isn't always in the same field. Still need to figure out how to do this.
How about making the PDIHS less ugly?