6. Force field selection

The mdpow.forcefields module contains settings for selecting different force fields and the corresponding solvent topologies.

The OPLS-AA, CHARMM/CGENFF and the AMBER/GAFF force field are directly supported. In the principle it is possible to switch to a different force field by supplying alternative template files.

mdpow.forcefields.DEFAULT_FORCEFIELD = 'OPLS-AA'

Default force field. At the moment, only OPLS-AA is directly supported.

mdpow.forcefields.DEFAULT_WATER_MODEL = 'tip4p'

Use the default water model unless another water model is chosen in the runinput file (setup.watermodel).

6.1. Solvent models

Different water models are already supported

mdpow.forcefields.GROMACS_WATER_MODELS = {'m24': <M24 water: identifier=m24, ff=OPLS-AA>, 'spc': <SPC water: identifier=spc, ff=OPLS-AA>, 'spce': <SPC/E water: identifier=spce, ff=OPLS-AA>, 'tip3p': <TIP3P water: identifier=tip3p, ff=OPLS-AA>, 'tip4p': <TIP4P water: identifier=tip4p, ff=OPLS-AA>, 'tip4pd': <TIP4P-D water: identifier=tip4pd, ff=OPLS-AA>, 'tip4pew': <TIP4PEW water: identifier=tip4pew, ff=OPLS-AA>, 'tip5p': <TIP5P water: identifier=tip5p, ff=OPLS-AA>}

Dictionary of GromacsSolventModel instances, one for each Gromacs water model available under the force field directory. The keys are the water model identifiers. For OPLS-AA the following ones are available.

as well as different general solvent models

mdpow.forcefields.GROMACS_SOLVENT_MODELS = {'AMBER': {'cyclohexane': <CYCLOHEXANE water: identifier=cyclohexane, ff=OPLS-AA>, 'octanol': <OCTANOL water: identifier=octanol, ff=OPLS-AA>, 'wetoctanol': <WETOCTANOL water: identifier=wetoctanol, ff=OPLS-AA>}, 'CHARMM': {'cyclohexane': <CYCLOHEXANE water: identifier=cyclohexane, ff=OPLS-AA>, 'octanol': <OCTANOL water: identifier=octanol, ff=OPLS-AA>, 'wetoctanol': <WETOCTANOL water: identifier=wetoctanol, ff=OPLS-AA>}, 'OPLS-AA': {'cyclohexane': <CYCLOHEXANE water: identifier=cyclohexane, ff=OPLS-AA>, 'octanol': <OCTANOL water: identifier=octanol, ff=OPLS-AA>, 'octanolnew': <OCTANOL water: identifier=octanol, ff=OPLS-AA>, 'wetoctanol': <WETOCTANOL water: identifier=wetoctanol, ff=OPLS-AA>, 'wetoctanolnew': <WETOCTANOL water: identifier=wetoctanol, ff=OPLS-AA>}}

Solvents available in GROMACS; the keys of the dictionary are the forcefields.

6.2. Internal data

mdpow.forcefields.SPECIAL_WATER_COORDINATE_FILES = {'m24': 'spc216.gro', 'spc': 'spc216.gro', 'spce': 'spc216.gro', 'tip3p': 'spc216.gro', 'tip4p': None, 'tip4pd': 'tip4p.gro', 'tip4pew': 'tip4p.gro', 'tip5p': None}

For some water models we cannot derive the filename for the equilibrated box so we supply them explicitly.

mdpow.forcefields.GROMACS_WATER_MODELS = {'m24': <M24 water: identifier=m24, ff=OPLS-AA>, 'spc': <SPC water: identifier=spc, ff=OPLS-AA>, 'spce': <SPC/E water: identifier=spce, ff=OPLS-AA>, 'tip3p': <TIP3P water: identifier=tip3p, ff=OPLS-AA>, 'tip4p': <TIP4P water: identifier=tip4p, ff=OPLS-AA>, 'tip4pd': <TIP4P-D water: identifier=tip4pd, ff=OPLS-AA>, 'tip4pew': <TIP4PEW water: identifier=tip4pew, ff=OPLS-AA>, 'tip5p': <TIP5P water: identifier=tip5p, ff=OPLS-AA>}

Dictionary of GromacsSolventModel instances, one for each Gromacs water model available under the force field directory. The keys are the water model identifiers. For OPLS-AA the following ones are available.

mdpow.forcefields.GROMACS_SOLVENT_MODELS = {'AMBER': {'cyclohexane': <CYCLOHEXANE water: identifier=cyclohexane, ff=OPLS-AA>, 'octanol': <OCTANOL water: identifier=octanol, ff=OPLS-AA>, 'wetoctanol': <WETOCTANOL water: identifier=wetoctanol, ff=OPLS-AA>}, 'CHARMM': {'cyclohexane': <CYCLOHEXANE water: identifier=cyclohexane, ff=OPLS-AA>, 'octanol': <OCTANOL water: identifier=octanol, ff=OPLS-AA>, 'wetoctanol': <WETOCTANOL water: identifier=wetoctanol, ff=OPLS-AA>}, 'OPLS-AA': {'cyclohexane': <CYCLOHEXANE water: identifier=cyclohexane, ff=OPLS-AA>, 'octanol': <OCTANOL water: identifier=octanol, ff=OPLS-AA>, 'octanolnew': <OCTANOL water: identifier=octanol, ff=OPLS-AA>, 'wetoctanol': <WETOCTANOL water: identifier=wetoctanol, ff=OPLS-AA>, 'wetoctanolnew': <WETOCTANOL water: identifier=wetoctanol, ff=OPLS-AA>}}

Solvents available in GROMACS; the keys of the dictionary are the forcefields.

6.3. Internal classes and functions

class mdpow.forcefields.GromacsSolventModel(identifier, name=None, itp=None, coordinates=None, description=None, forcefield='OPLS-AA')[source]

Data for a solvent model in Gromacs.

guess_filename(extension)[source]

Guess the filename for the model and add extension

mdpow.forcefields.get_water_model(watermodel='tip4p')[source]

Return a GromacsSolventModel corresponding to identifier watermodel

mdpow.forcefields.get_solvent_identifier(solvent_type, model=None, forcefield='OPLS-AA')[source]

Get the identifier for a solvent model.

The identifier is needed to access a water model (i.e., a GromacsSolventModel) through get_solvent_model(). Because we have multiple water models but only limited other solvents, the organization of these models is a bit convoluted and it is best to obtain the desired water model in these two steps:

identifier = get_solvent_identifier("water", model="tip3p")
model = get_solvent_model(identifier)

For solvent_type water: either provide None or “water” for the specific model (and the default DEFAULT_WATER_MODEL will be selected, or a specific water model such as “tip3p” or “spce” (see GROMACS_WATER_MODELS). For other “octanol” or “wetoctanol” of OPLS-AA forcefield, the model is used to select a specific model. For other solvents and forcefields, “model” is not required.

Returns:Either an identifier or None
mdpow.forcefields.get_solvent_model(identifier, forcefield='OPLS-AA')[source]

Return a GromacsSolventModel corresponding to identifier identifier.

If identifier is “water” then the DEFAULT_WATER_MODEL is assumed.