Chem::Topology
Inherits Chem::ResidueCollection / Chem::ChainCollection / Chem::AtomCollection / Reference / Object
Constants
Class methods
Returns the element of an atom based on its name. Raises Error if
the element could not be determined. Refer to guess_element? for
details.
Returns the element of an atom based on its name if possible, else
nil.
This is a naive approach, where the first letter of atom_name is tested first to get the element, then the name with trailing digits stripped.
Instance methods
Dihedral angles in the topology. See Dihedral for definition.
Determines the angles based on connectivity. See Angle for
definition.
NOTE: It deletes existing angles.
Determines the bonds from connectivity and geometry.
Bonds are added when the pairwise distances are within the
corresponding covalent distances (see
PeriodicTable.covalent_distance). Bonds are added until the atoms'
valences are fulfilled. If extraneous bonds are found (beyond the
maximum number of bonds, see Element#max_bonds), the longest ones
will be removed.
Bonds to atoms that could potential be as cations (K, Na, etc.) are disfavored such that they won't be added if the neighbor is over-valence or the bond can be substituted by increasing the bond order of another bond of the neighbor (e.g., C-O + K is preferred over C-O-K since C-O can be converted to C=O).
Bond orders are assigned based on the following procedure. First,
atom hybridization is guessed from the geometry. Then, the bond
orders are determined such that both atoms must have the same
hybridization to assign a double (sp2) or triple (sp) bond. Bond
order is only changed if the bonded atoms have missing valence. If
multiple bonded atoms fulfill the requirements for increasing the
bond order, the atom with the most missing valence or that is
closest to the current atom is selected first. This procedure is
loosely based on OpenBabel's PerceiveBondOrders function.
Determines the dihedral angles based on connectivity. See Dihedral
for definition.
NOTE: It deletes existing dihedral angles.
Sets the formal charges based on the existing bonds.
For most cases, the formal charge is calculated as
Nele - Tele + V
where Nele is the number of valence electrons, Tele is the
number of electrons in the full valence shell, and V is the
effective valence, which is equivalent to the sum of the bond
orders. Tele is usually 8 following the octet rule, but there are
some exceptions (see Element#target_electrons).
If an atom has no bonds, it is considered as a monoatomic ion, where
the formal charge is set according to the following rule: if the
valence electrons < 4 (cation, e.g., Na+, Mg2+), the formal charge
is equal to the number of valence electrons, else (anions, e.g.,
Cl-) it is equal to Nele - Tele.
WARNING: Elements that have no valence determined such as transition metals are ignored.
Determines the improper dihedral angles based on connectivity. See
Improper for definition.
Improper dihedral angles are often used to constraint the planarity of certain functional groups of molecules in molecular mechanics simulations, and so not every possible improper dihedral angle is required. This method lists every possible improper dihedral angle following the formal definition, which will probably generate extraneous angles.
NOTE: It deletes existing improper dihedral angles.
Detects and assigns topology names from known residue templates based on bond information.
The method creates chains and residues according to the detected fragments and residue matches. The procedure is as follows. First, atoms are split into fragments, where each fragment is scanned for matches to known residue templates. Then, fragments are divided into polymer (e.g., peptide) and non-polymer (e.g., water) fragments based on the number of residues per fragment. Non-polymer residues are grouped together by their type (i.e., ion, solvent, etc.). Finally, every polymer fragment and group of non-polymer fragments are assigned to a unique chain and residues are created for each match.
NOTE: Fragments are assigned to a unique chain unless the chain limit (62) is reached, otherwise all residues are assigned to the same chain.
WARNING: Existing chains and residues are invalid after calling this method so do not cache them.
Improper dihedral angles in the topology. See Improper for
definition.
Renumber residues per chain based on the order by the output value of the block.
NOTE: This won't change the order of the existing chains.
Renumber chain and residues based on bond information.
Residue fragments are assigned to unique chains unless
split_chains is false, which keeps existing chains intact.
Residue ordering is computed based on the link bond if available.
NOTE: existing chains are reused to re-arrang the residues among them, so avoid caching them before calling this.