[Molby Document Home] [Contents]

Class: | ParameterRef
Parent: | Object

### Description

#### Overview

The class ParameterRef points to a parameter at a particular index in a Parameter object. ParameterRef does not implement initialize nor new methods; i.e. a ParameterRef object cannot be created explicitly by calling a constructor method. Instead, a ParameterRef object is implicitly created as a return value of ParEnumerable#[], or its equivalent methods of Parameter, namely Parameter#angle(idx), Parameter#bond(idx), Parameter#dihedral(idx), Parameter#element(idx), Parameter#improper(idx), Parameter#vdw(idx), Parameter#vdw_cutoff(idx), and Parameter#vdw_pair(idx). A ParameterRef is also given as a block argument in ParEnumerable#each and ParEnumerable#reverse_each.

#### Parameter types

A parameter has one of the following types:

- bond: Bond stretching parameter, defined by two atom types, a force constant, and an equilibrium length.
- angle: Angle bending parameter, defined by three atom types, a force constant, and an equilibrium angle.
- dihedral: Dihedral angle torsion parameter, defined by four atom types, a force constant, an equilibrium angle, and a periodicity. There is also an attribute called multiplicity, but it is not (yet) actively implemented in Molby.
- improper: Improper torshion parameter, defined by the same attributes as the dihedral angle parameter.
- vdw: van der Waals parameter, defined by an atom type, a potential minimum, and a van der Waals radius. The parameter may also specify the potential minimum and vdw radius values for 1-4 interactions specifically. This type of parameter also defines an atomic number and an atomic weight (although in the MM/MD calculations the atomic weight specified in the AtomRef record is actually used).
- vdw_pair: Pair-specific van der Waals parameter. This type of parameter defines a van der Waals potential between two specific atom types. It is defined by two atom types, a potential minimum, a van der Waals radius, and the latter two for 1-4 interactions.
- vdw_cutoff: Pair-specific van der Waals cutoff parameter. This type of parameter a specific cutoff distance for the van der Waals potential between two specific atom types.
- element: This parameter is not for MM/MD calculations, but for collecting information of chemical elements. It contains a name (chemical symbol), a full name (element name), an atomic weight, an atomic radius (for screen display), and a color (also for screen display).

#### Parameter attributes

A parameter consists of a number of attributes. Some of them are common to all kind of parameters, and others are specific to certain types. The common attributes are index, par_type, source, and comment. Type-specific parameters are as follows:

type | attributes
--- | ---
bond | atom_types, k, r0
angle | atom_types, k, a0
dihedral improper | atom_types, mult, k, period, phi0
vdw | atom_type, atomic_number, r_eq, eps, r_eq14, eps14, weight
vdw_pair | atom_types, r_eq, eps, r_eq14, eps14
vdw_cutoff | atom_types, cutoff
element | atomic_number, name, fullname, radius, color, weight

### Public Instance methods

a0 → Float
self.a0 = Float

Get/set the equilibrium bond angle (in degree). This attribute if available for angle parameters.

atom_type → String
atom_types → [str1, str2, ...]
self.atom_type = String
self.atom_types = [str1, str2, ...]

Get/set the atom types to define the parameter. The atom types are represented as a String with the format described in AtomRef#atom_type. For the vdw parameter, only one atom type is required. For other parameters, two or more atom types are required, in which case the argument should be an array of atom type strings.

The methods atom_type and atom_types are actually the same, so a code like `pr.atom_type = ["ca", "c3"]` is accepted. However, this is a lousy coding style, so it is better to avoid it.

This attribute is available for all types except for the element type.

atomic_number → Integer
self.atomic_number = Integer

Get/set the atomic number. This attribute is available for vdw and element parameters. For vdw parameters, changing the atomic number automatically causes change of the weight attribute. (This is not the case for the element parameters.)

color → [red, green, blue]
self.color = [red, green, blue]

Get/set the color for element parameters. This is used only for screen display. The red, green, blue components are given as floats, with 1.0 for saturation.

comment → String
self.comment = String

Get/set the comment for the parameter as a String.

cutoff → Float
self.cutoff = Float

Get/set the cutoff distance (in Å) for the vdw_cutoff parameters.

eps → Float
self.eps = Float

Get/set the minimum potential for the vdw and vdw_pair parameters. The unit is kcal/mol.

eps14 → Float
self.eps14 = Float

Get/set the 1-4 speicific minimum potential for the vdw and vdw_pair parameters. The unit is kcal/mol.

fullname → String
self.fullname = String

Get/set the fullname attribute for the element parameters, like "hydrogen". If you want the element symbol like "H", use name instead.

index → Integer

Returns the index in the parent ParEnumerable object.

k → Float
self.k = Float

Get/set the force constant. This attribute is available for bond, angle, dihedral, and improper parameters. The unit is kcal/mol/Å for bond parameters and kcal/mol/radian for angle, dihedral, and improper parameters.

keys → Array

Returns an array of valid parameter attributes (as Symbols).

mult → Integer
self.mult = Integer

Get/set the multiplicity of the dihedral parameters. This attribute if available for dihedral and improper parameters.

name → String
self.name = String

Get/set the name attribute for the element parameters. The name is actually the element symbol, like "H" and "He". If you want the real element name like "hydrogen", use fullname instead.

par_type → String

Returns the type of the parameter as a String, like "bond", "angle", etc.

period → Integer
self.period = Integer

Get/set the periodicity of the dihedral parameters. This attribute is available for dihedral and improper parameters. A dihedral (improper) parameter record with periodicity p has p energy minima within the range of 0-360 degree.

phi0 → Float
self.phi0 = Float

Get/set the equilibrium dihedral angle (in degree). This attribute is available for dihedral and improper parameters.

r0 → Float
self.r0 = Float

Get/set the equilibrium bond length (in Å). This attribute if available for bond parameters.

radius → Float
self.radius = Float

Get/set the atomic radius for element parameters. This is used only for screen display. To set the van der Waals radius, use r_eq and r_eq14.

r_eq → Float
self.r_eq = Float

Get/set the van der Waals radius for the vdw parameters, or the equilibrium interatomic distance for the vdw_pair parameters. The unit is Å. Note that, for the vdw parameters, the value is half of the interatomic distance at the potential minimum.

r_eq14 → Float
self.r_eq14 = Float

Get/set the 1-4 specific van der Waals radius for the vdw parameters, or the equilibrium interatomic distance for the vdw_pair parameters. The unit is Å. Note that, for the vdw parameters, the value is half of the interatomic distance at the potential minimum.

source → String

Returns the source information of the parameter as a String.

to_hash → Hash

Returns a hash containing valid parameter names and values.

to_s → String

Returns a string representation of the given parameter.

weight → Float
self.weight = Float

Get/set the atomic weight. This attribute is available for vdw (but not vdw_pair) and element parameters. Note that, for vdw parameters, setting the atomic_number attribute also causes changing the weight attribute, but the other way does not work.