OpenMM

- Main Page
- Related Pages
- Classes

- Class List
- Class Hierarchy
- Class Members

All Classes Namespaces Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
CharmmParameterSet Class Reference

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

Inheritance diagram for CharmmParameterSet:

## 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) More...
def | readParameterFile
| Reads all of the parameters from a parameter file. More...
def | readTopologyFile
| Reads only the atom type definitions from a topology file. More...
def | readStreamFile
| Reads RTF and PAR sections from a stream file and dispatches the sections to readTopologyFile or readParameterFile. More...
def | condense
| This function goes through each of the parameter type dicts and eliminates duplicate types. More...

## 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')

## Constructor & Destructor Documentation

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

## Member Function Documentation

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()

References CharmmParameterSet._condense_types(), CharmmParameterSet.angle_types, CharmmParameterSet.bond_types, CharmmParameterSet.cmap_types, CharmmParameterSet.dihedral_types, CharmmParameterSet.improper_types, and CharmmParameterSet.urey_bradley_types.

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.

References CharmmParameterSet.angle_types, CharmmParameterSet.atom_types_int, CharmmParameterSet.atom_types_str, CharmmParameterSet.atom_types_tuple, CharmmParameterSet.bond_types, CharmmParameterSet.cmap_types, CharmmParameterSet.dihedral_types, CharmmParameterSet.improper_types, CharmmParameterSet.nbfix_types, and CharmmParameterSet.urey_bradley_types.

Referenced by CharmmParameterSet.readStreamFile().

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

References CharmmParameterSet.readParameterFile(), and CharmmParameterSet.readTopologyFile().

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

References CharmmParameterSet.atom_types_int, CharmmParameterSet.atom_types_str, and CharmmParameterSet.atom_types_tuple.

Referenced by CharmmParameterSet.readStreamFile().

## Member Data Documentation

angle_types

Referenced by CharmmParameterSet.condense(), and CharmmParameterSet.readParameterFile().

atom_types_int

Referenced by CharmmParameterSet.readParameterFile(), and CharmmParameterSet.readTopologyFile().

atom_types_str

Referenced by CharmmParameterSet.readParameterFile(), and CharmmParameterSet.readTopologyFile().

atom_types_tuple

Referenced by CharmmParameterSet.readParameterFile(), and CharmmParameterSet.readTopologyFile().

bond_types

Referenced by CharmmParameterSet.condense(), and CharmmParameterSet.readParameterFile().

cmap_types

Referenced by CharmmParameterSet.condense(), and CharmmParameterSet.readParameterFile().

dihedral_types

Referenced by CharmmParameterSet.condense(), and CharmmParameterSet.readParameterFile().

improper_types

Referenced by CharmmParameterSet.condense(), and CharmmParameterSet.readParameterFile().

nbfix_types

Referenced by CharmmParameterSet.readParameterFile().

parametersets

urey_bradley_types

Referenced by CharmmParameterSet.condense(), and CharmmParameterSet.readParameterFile().

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

- charmmparameterset.py