parmed.amber.parameters module

This module contains classes for parsing and processing Amber parameter files.

Author: Jason M. Swails Contributors: Date: Aug. 11, 2015

class parmed.amber.parameters.AmberParameterSet(*filenames)[source]

Bases: parmed.parameters.ParameterSet

Class storing parameters from an Amber parameter set

Parameters
filenamesstr, list of str, file-like, or list of file-like; optional

Either the name of a file or a list of filenames from which parameters should be parsed.

Notes

Order is important in the list of files provided. The parameters are loaded in the order they are provided, and any parameters that are specified in multiple places are overwritten (that is, the last occurrence is the parameter type that is used)

Attributes
combining_rule

Methods

condense([do_dihedrals])

This function goes through each of the parameter type dicts and eliminates duplicate types.

from_leaprc(fname[, search_oldff])

Load a parameter set from a leaprc file

from_structure(struct)

Extracts known parameters from a Structure instance

id_format(filename)

Identifies the file type as either an Amber-style frcmod or parm.dat file.

load_parameters(fname)

Load a set of parameters from a single parameter file

typeify_templates()

Assign atom types to atom names in templates

write(dest[, title, style])

Writes a parm.dat file with the current parameters

classmethod from_leaprc(fname, search_oldff=False)[source]

Load a parameter set from a leaprc file

Parameters
fnamestr or file-like

Name of the file or open file-object from which a leaprc-style file will be read

search_oldffbool, optional, default=False

If True, search the oldff directories in the main Amber leap folders. Default is False

Notes

This does not read all parts of a leaprc file – only those pertinent to defining force field information. For instance, the following sections and commands are processed:

  • addAtomTypes

  • loadAmberParams

  • loadOFF

  • loadMol2

  • loadMol3

classmethod from_structure(struct)[source]

Extracts known parameters from a Structure instance

Parameters
structparmed.structure.Structure

The parametrized Structure instance from which to extract parameters into a ParameterSet

Returns
paramsParameterSet

The parameter set with all parameters defined in the Structure

static id_format(filename)[source]

Identifies the file type as either an Amber-style frcmod or parm.dat file.

Parameters
filenamestr

Name of the file to check format for

Returns
is_fmtbool

True if it is an Amber-style parameter file. False otherwise.

load_parameters(fname)[source]

Load a set of parameters from a single parameter file

Parameters
fnamestr or file-like

Parameter file to parse

write(dest, title='Created by ParmEd', style='frcmod')[source]

Writes a parm.dat file with the current parameters

Parameters
deststr or file-like

The file name or file-like object to write the parameters to

titlestr, optional

The title of the frcmod to write. Default is ‘Created by ParmEd’

stylestr, optional

If ‘frcmod’, the parameters are written in frcmod-format. If ‘parm’, the parameters are written in parm.dat-format. Default is ‘frcmod’