# CharmmParameterSet Class Reference

Stores a parameter set defined by CHARMM files. More...

List of all members.

## Public Member Functions

def | __init__
def | loadSet
| Instantiates a CharmmParameterSet from a Topology file and a Parameter file (or just a Parameter file if it has all information).
def | readParameterFile
| Reads all of the parameters from a parameter file.
def | readTopologyFile
| Reads _only_ the atom type definitions from a topology file.
def | readStreamFile
| Reads RTF and PAR sections from a stream file and dispatches the sections to readTopologyFile or readParameterFile.
def | condense
| This function goes through each of the parameter type dicts and eliminates duplicate types.

## Public Attributes

| atom_types_str
| atom_types_int
| atom_types_tuple
| bond_types
| angle_types
| urey_bradley_types
| dihedral_types
| improper_types
| cmap_types
| nbfix_types
| parametersets

## Detailed Description

Stores a parameter set defined by CHARMM files.

It stores the equivalent of the information found in the MASS section of the CHARMM topology file (TOP/RTF) and all of the information in the parameter files (PAR)

Parameters:

  filenames

  : List of topology, parameter, and stream files to load into the parameter set. The following file type suffixes are recognized. Unrecognized file types raise a TypeError .rtf, .top -- Residue topology file .par, .prm -- Parameter file .str -- Stream file .inp -- If "par" is in the file name, it is a parameter file. If "top" is in the file name, it is a topology file. Otherwise, raise TypeError

Attributes: All type lists are dictionaries whose keys are tuples (with however many elements are needed to define that type of parameter). The types that can be in any order are SORTED.

Parameters:

  | atom_types_str |
  | atom_types_int |
  | atom_types_tuple |
  | bond_types |
  | angle_types |
  | urey_bradley_types |
  | dihedral_types |
  | improper_types |
  | cmap_types |
  | nbfix_types | The dihedral types can be multiterm, so the values for each dict key is actually a list of DihedralType instances. The atom_types are dicts that match the name (str), number (int), or (name, number) tuple (tuple) to the atom type. The tuple is guaranteed to be the most robust, although when only the integer or string is available the other dictionaries are helpful

Example: >>> params = CharmmParameterSet('charmm22.top', 'charmm22.par', 'file.str')

## Member Function Documentation

def __init__ | ( |  | self,
|  |  | args |
| ) |  |  |

def condense | ( |  | self | ) |

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

After calling this function, every unique bond, angle, dihedral, improper, or cmap type will pair with EVERY key in the type mapping dictionaries that points to the equivalent type

Returns:
  - Returns the instance that is being condensed.

Notes: The return value allows you to condense the types at construction time.

Example: >>> params = CharmmParameterSet('charmm.prm').condense()

def loadSet | ( |  | cls,
|  |  | tfile = `None`,
|  |  | pfile = `None`,
|  |  | sfiles = `[]` |
| ) |  |  |

Instantiates a CharmmParameterSet from a Topology file and a Parameter file (or just a Parameter file if it has all information).

Parameters:

  | tfile | (str) : Name of the Topology (RTF/TOP) file
  | pfile | (str) : Name of the Parameter (PAR) file
  | sfiles | (list of str) : List or tuple of stream (STR) file names.

Returns:
  New CharmmParameterSet populated with the parameters found in the provided files.

Notes: The RTF file is read first (if provided), followed by the PAR file, followed by the list of stream files (in the order they are provided). Parameters in each stream file will overwrite those that came before (or simply append to the existing set if they are different)

def readParameterFile | ( |  | self,
|  |  | pfile |
| ) |  |  |

Reads all of the parameters from a parameter file.

Versions 36 and later of the CHARMM force field files have an ATOMS section defining all of the atom types. Older versions need to load this information from the RTF/TOP files.

Parameters:

  | pfile | (str) : Name of the CHARMM PARameter file to read

Notes: The atom types must all be loaded by the end of this routine. Either supply a PAR file with atom definitions in them or read in a RTF/TOP file first. Failure to do so will result in a raised RuntimeError.

def readStreamFile | ( |  | self,
|  |  | sfile |
| ) |  |  |

Reads RTF and PAR sections from a stream file and dispatches the sections to readTopologyFile or readParameterFile.

Parameters:

  | sfile | (str or CharmmStreamFile) : Stream file to parse

def readTopologyFile | ( |  | self,
|  |  | tfile |
| ) |  |  |

Reads _only_ the atom type definitions from a topology file.

This is unnecessary for versions 36 and later of the CHARMM force field.

Parameters:

  | tfile | (str) : Name of the CHARMM TOPology file to read

Note: The CHARMM TOPology file is also called a Residue Topology File

## Member Data Documentation

angle_types

atom_types_int

atom_types_str

atom_types_tuple

bond_types

cmap_types

dihedral_types

improper_types

nbfix_types

parametersets

urey_bradley_types

The documentation for this class was generated from the following file:

- charmmparameterset.py