Package ffx.potential.bonded
Class BondedUtils
java.lang.Object
ffx.potential.bonded.BondedUtils
Utilities for placing atoms.
- Since:
- 1.0
- Author:
- Michael Schnieders
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
This exception is thrown when an atom type could not be assigned.static class
This exception is thrown when a heavy atom is not found. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
atomAttachedToAtom
(Atom a1, Atom a2) Checks if atom a1 is bonded to atom a2.static Bond
Build a bond between two atoms.static Atom
buildH
(MSGroup residue, AminoAcidUtils.SideChainType atomName, Atom ia, double bond, Atom ib, double angle1, Atom ic, double angle2, int chiral, ForceField forceField, List<Bond> bondList) Build a hydrogen atom.static Atom
buildH
(MSGroup residue, String atomName, Atom ia, double bond, Atom ib, double angle1, Atom ic, double angle2, int chiral, int lookUp, ForceField forceField, List<Bond> bondList) Build a hydrogen atom.static Atom
buildHeavy
(MSGroup residue, AminoAcidUtils.SideChainType atomName, Atom ia, double bond, Atom ib, double angle1, Atom ic, double angle2, int chiral, ForceField forceField, List<Bond> bondList) Build a heavy atom.static Atom
buildHeavy
(MSGroup residue, String atomName, Atom ia, double bond, Atom ib, double angle1, Atom ic, double angle2, int chiral, int lookUp, ForceField forceField) Build a heavy atom.static Atom
buildHeavy
(MSGroup residue, String atomName, Atom ia, double bond, Atom ib, double angle1, Atom ic, double angle2, int chiral, int lookUp, ForceField forceField, List<Bond> bondList) Build a heavy atom.static Atom
buildHeavy
(MSGroup residue, String atomName, Atom bondedTo, int key, ForceField forceField, List<Bond> bondList) Build a heavy atom.static Atom
buildHydrogenAtom
(MSGroup residue, String atomName, Atom ia, double bond, Atom ib, double angle1, Atom ic, double angle2, int chiral, AtomType atomType, ForceField forceField, List<Bond> bondList) Build a hydrogen atom.static double[]
determineIntxyz
(double[] ia, double bond, double[] ib, double angle1, double[] ic, double angle2, int chiral) This routine was derived from a similar routine in TINKER.findAtomsOfElement
(Residue residue, int element) Finds all Atoms belonging to a Residue of a given atomic number.static AtomType
findAtomType
(int key, ForceField forceField) findAtomType.findBondedAtoms
(Atom atom, int element) Finds Atoms bonded to a given Atom that match a certain atomic number.findBondedAtoms
(Atom atom, Atom toExclude, int element) Finds Atoms bonded to a given Atom that match a certain atomic number that do not match an excluded atom.static Atom
findNitrogenAtom
(Residue residue) Finds the backbone nitrogen of a residue.findNucleotideO4s
(Residue residue) Find the O4' of a nucleic acid Residue.static Atom
getAlphaCarbon
(Residue residue, Atom N) Finds the alpha carbon of a residue, and handles any C-terminal ACE caps while at it.static boolean
hasAttachedAtom
(Atom atom, int element) Checks if there is an Atom of a given atomic number bonded to the provided Atom.static void
This routine was derived from a similar routine in TINKER.static void
numberAtoms
(MolecularAssembly molecularAssembly) Re-number atoms, especially if missing atoms were created.static void
sortAtomsByDistance
(Atom reference, Atom[] toCompare) In-place sorts toCompare by distance to the reference Atom.static Atom[]
sortAtomsByDistance
(Atom reference, List<Atom> toCompare) Sorts toCompare by distance to the reference Atom, returning a sorted array.
-
Constructor Details
-
BondedUtils
public BondedUtils()
-
-
Method Details
-
atomAttachedToAtom
Checks if atom a1 is bonded to atom a2.- Parameters:
a1
- An Atom.a2
- Another Atom.- Returns:
- If a1 is bonded to a2.
-
buildBond
Build a bond between two atoms.- Parameters:
a1
- The first atom.a2
- The second atom.forceField
- The force field to use.bondList
- The list of bonds to add to.- Returns:
- The new bond.
-
buildHeavy
public static Atom buildHeavy(MSGroup residue, String atomName, Atom bondedTo, int key, ForceField forceField, List<Bond> bondList) throws BondedUtils.MissingHeavyAtomException, BondedUtils.MissingAtomTypeException Build a heavy atom.- Parameters:
residue
- The residue to add the atom to.atomName
- The name of the atom.bondedTo
- The atom the heavy atom is bonded to.key
- The atom type key.forceField
- The force field to use.bondList
- The list of bonds to add to.- Returns:
- The heavy atom.
- Throws:
BondedUtils.MissingHeavyAtomException
- if any.BondedUtils.MissingAtomTypeException
-
buildHeavy
public static Atom buildHeavy(MSGroup residue, String atomName, Atom ia, double bond, Atom ib, double angle1, Atom ic, double angle2, int chiral, int lookUp, ForceField forceField) Build a heavy atom.- Parameters:
residue
- The residue to add the atom to.atomName
- The name of the atom.ia
- The first atom.bond
- The bond length.ib
- The second atom.angle1
- The angle.ic
- The third atom.angle2
- The second angle (either a bond angle or a dihedral angle).chiral
- The chiral flag.lookUp
- The BioType key.forceField
- The force field to use.- Returns:
- The new atom.
-
buildHeavy
public static Atom buildHeavy(MSGroup residue, String atomName, Atom ia, double bond, Atom ib, double angle1, Atom ic, double angle2, int chiral, int lookUp, ForceField forceField, List<Bond> bondList) Build a heavy atom.- Parameters:
residue
- The residue to add the atom to.atomName
- The name of the atom.ia
- The first atom.bond
- The bond length.ib
- The second atom.angle1
- The angle.ic
- The third atom.angle2
- The second angle (either a bond angle or a dihedral angle).chiral
- The chiral flag.lookUp
- The BioType key.forceField
- The force field to use.bondList
- A list of bonds to add to.- Returns:
- The new heavy atom.
-
buildHeavy
public static Atom buildHeavy(MSGroup residue, AminoAcidUtils.SideChainType atomName, Atom ia, double bond, Atom ib, double angle1, Atom ic, double angle2, int chiral, ForceField forceField, List<Bond> bondList) Build a heavy atom.- Parameters:
residue
- The residue to add the atom to.atomName
- The name of the atom.ia
- The first atom.bond
- The bond length.ib
- The second atom.angle1
- The angle.ic
- The third atom.angle2
- The second angle (either a bond angle or a dihedral angle).chiral
- The chiral flag.forceField
- The force field to use.bondList
- A list of bonds to add to.- Returns:
- The new heavy atom.
-
buildH
public static Atom buildH(MSGroup residue, String atomName, Atom ia, double bond, Atom ib, double angle1, Atom ic, double angle2, int chiral, int lookUp, ForceField forceField, List<Bond> bondList) Build a hydrogen atom.- Parameters:
residue
- The residue to add the atom to.atomName
- The name of the atom.ia
- The first atom.bond
- The bond length.ib
- The second atom.angle1
- The angle.ic
- The third atom.angle2
- The second angle (either a bond angle or a dihedral angle).chiral
- The chiral flag.lookUp
- The BioType key.forceField
- The force field to use.bondList
- A list of bonds to add to.- Returns:
- The new hydrogen atom.
-
buildH
public static Atom buildH(MSGroup residue, AminoAcidUtils.SideChainType atomName, Atom ia, double bond, Atom ib, double angle1, Atom ic, double angle2, int chiral, ForceField forceField, List<Bond> bondList) Build a hydrogen atom.- Parameters:
residue
- The residue to add the atom to.atomName
- The name of the atom.ia
- The first atom.bond
- The bond length.ib
- The second atom.angle1
- The angle.ic
- The third atom.angle2
- The second angle (either a bond angle or a dihedral angle).chiral
- The chiral flag.forceField
- The force field to use.bondList
- A list of bonds to add to.- Returns:
- The new hydrogen atom.
-
buildHydrogenAtom
public static Atom buildHydrogenAtom(MSGroup residue, String atomName, Atom ia, double bond, Atom ib, double angle1, Atom ic, double angle2, int chiral, AtomType atomType, ForceField forceField, List<Bond> bondList) Build a hydrogen atom.- Parameters:
residue
- The residue to add the atom to.atomName
- The name of the atom.ia
- The first atom.bond
- The bond length.ib
- The second atom.angle1
- The angle.ic
- The third atom.angle2
- The second angle (either a bond angle or a dihedral angle).chiral
- The chiral flag.atomType
- The atom type.forceField
- The force field to use.bondList
- A list of bonds to add to.- Returns:
- The new hydrogen atom.
-
findAtomType
findAtomType.- Parameters:
key
- The BioType key.forceField
- aForceField
object.- Returns:
- a
AtomType
object.
-
findAtomsOfElement
Finds all Atoms belonging to a Residue of a given atomic number.- Parameters:
residue
- Residue to search in.element
- Atomic number to search for.- Returns:
- A list of matching Atoms.
-
findBondedAtoms
Finds Atoms bonded to a given Atom that match a certain atomic number.- Parameters:
atom
- Atom to search from.element
- Atomic number to search for.- Returns:
- Bonded atoms of an element.
-
findBondedAtoms
Finds Atoms bonded to a given Atom that match a certain atomic number that do not match an excluded atom.- Parameters:
atom
- Atom to search from.toExclude
- Atom to exclude from search.element
- Atomic number to search for.- Returns:
- Bonded atoms of an element.
-
findNitrogenAtom
Finds the backbone nitrogen of a residue.- Parameters:
residue
- Amino acid residue to search for.- Returns:
- backbone nitrogen.
-
findNucleotideO4s
Find the O4' of a nucleic acid Residue. This is fairly unique in standard nucleotides, as O4' is the only ether oxygen (bonded to two carbons).- Parameters:
residue
- Residue to find O4' of.- Returns:
- O4'.
-
getAlphaCarbon
Finds the alpha carbon of a residue, and handles any C-terminal ACE caps while at it.- Parameters:
residue
- Find the alpha carbon of.N
- The residue's backbone nitrogen.- Returns:
- The alpha carbon.
-
hasAttachedAtom
Checks if there is an Atom of a given atomic number bonded to the provided Atom.- Parameters:
atom
- Atom to search from.element
- Atomic number to search for.- Returns:
- If bonded atoms of given element exist.
-
intxyz
public static void intxyz(Atom atom, Atom ia, double bond, Atom ib, double angle1, Atom ic, double angle2, int chiral) This routine was derived from a similar routine in TINKER.- Parameters:
atom
- The atom to be placed.ia
- The first atom.bond
- The bond length.ib
- The second atom.angle1
- The angle.ic
- The third atom.angle2
- The second angle (either a bond angle or a dihedral angle).chiral
- The chiral flag.
-
numberAtoms
Re-number atoms, especially if missing atoms were created.- Parameters:
molecularAssembly
- The molecular assembly to renumber atoms for.
-
sortAtomsByDistance
Sorts toCompare by distance to the reference Atom, returning a sorted array.- Parameters:
reference
- Atom to compare distances to.toCompare
- Atoms to sort by distance (not modified).- Returns:
- Sorted array of atoms in toCompare.
-
sortAtomsByDistance
In-place sorts toCompare by distance to the reference Atom. Modifies toCompare.- Parameters:
reference
- Atom to compare distances to.toCompare
- Atoms to sort (in-place) by distance.
-
determineIntxyz
public static double[] determineIntxyz(double[] ia, double bond, double[] ib, double angle1, double[] ic, double angle2, int chiral) This routine was derived from a similar routine in TINKER. It determines at what coordinates an atom would be placed without moving or calling any atoms, relying solely upon coordinates. Passed arrays are copied into local arrays to avoid any over-writing of the passed arrays.The chiral argument is 0 if angle2 is a dihedral. Else, if angle2 is the atom-ia-ic angle: -1 indicates left-hand-rule placement. +1 indicates right-hand-rule placement. +3 indicates trigonal planar placement.
Chiral +3 replaces the angle1 and angle2 constraints with a planarity constraint, and minimized, equipartitioned deviation from angle1 and angle2.
- Parameters:
ia
- a double[] of atomic coordinates.bond
- The bond length.ib
- a double[] of atomic coordinates.angle1
- The angle.ic
- a double[] of atomic coordinates.angle2
- The second angle (either a bond angle or a dihedral angle).chiral
- The chiral flag (0, 1, -1, or 3).- Returns:
- A double[] with XYZ coordinates at which an atom would be placed.
-