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:

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:

typeattributes
bondatom_types, k, r0
angleatom_types, k, a0
dihedral
improper
atom_types, mult, k, period, phi0
vdwatom_type, atomic_number, r_eq, eps, r_eq14, eps14, weight
vdw_pairatom_types, r_eq, eps, r_eq14, eps14
vdw_cutoffatom_types, cutoff
elementatomic_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/Å2 for bond parameters, and kcal/mol/radian2 for angle parameters as well as dihedral and improper parameters with periodicity == 0. For dihedral and improper parameters with periodicity > 0, the unit is kcal/mol.

For harmonic potentials (i.e. bond, angle, and dihedrals with periodicity == 0), the potential energy is defined as E = k (x - x0)2. That is, the 1/2 factor usually associated with this term is included within the force constant k.

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. Currently only mult = 1 is implemented.

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 phase shift or 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.