Class PdbAtomLine

java.lang.Object
pl.poznan.put.pdb.PdbAtomLine
All Implemented Interfaces:
Serializable, Comparable<ChainNumberICode>, ChainNumberICode
Direct Known Subclasses:
ImmutablePdbAtomLine

@Immutable public abstract class PdbAtomLine extends Object implements ChainNumberICode
Representation of ATOM and HETATM lines in both PDB and mmCIF files.
See Also:
  • Constructor Details

    • PdbAtomLine

      public PdbAtomLine()
  • Method Details

    • parse

      public static PdbAtomLine parse(String line)
      Parses text as ATOM or HETATM line in strict mode (all 80 characters in the line are required).
      Parameters:
      line - A text in PDB format (ATOM or HETATM).
      Returns:
      An instance of this class with fields containing values parsed from the text.
    • parse

      public static PdbAtomLine parse(String line, boolean strictMode)
      Parses text as ATOM or HETATM line in a strict or non-strict mode.
      Parameters:
      line - A text in PDB format (ATOM or HETATM).
      strictMode - If true, then all 80 characters are required, otherwise the "bare minimum" of 54 characters.
      Returns:
      An instance of this class with fields containing values parsed from the text.
    • serialNumber

      @Parameter(order=1) @Auxiliary public abstract int serialNumber()
      Returns:
      The value of the serialNumber attribute
    • atomName

      @Parameter(order=2) public abstract String atomName()
      Returns:
      The value of the atomName attribute
    • alternateLocation

      @Parameter(order=3) @Auxiliary public abstract Optional<String> alternateLocation()
      Returns:
      The value of the alternateLocation attribute
    • residueName

      @Parameter(order=4) public abstract String residueName()
      Returns:
      The value of the residueName attribute
    • chainIdentifier

      @Parameter(order=5) public abstract String chainIdentifier()
      Specified by:
      chainIdentifier in interface ChainNumberICode
      Returns:
      The value of the chainIdentifier attribute
    • residueNumber

      @Parameter(order=6) public abstract int residueNumber()
      Specified by:
      residueNumber in interface ChainNumberICode
      Returns:
      The value of the residueNumber attribute
    • insertionCode

      @Parameter(order=7) public abstract Optional<String> insertionCode()
      Specified by:
      insertionCode in interface ChainNumberICode
      Returns:
      The value of the insertionCode attribute
    • x

      @Parameter(order=8) public abstract double x()
      Returns:
      The value of the x attribute
    • y

      @Parameter(order=9) public abstract double y()
      Returns:
      The value of the y attribute
    • z

      @Parameter(order=10) public abstract double z()
      Returns:
      The value of the z attribute
    • occupancy

      @Parameter(order=11) @Auxiliary public abstract double occupancy()
      Returns:
      The value of the occupancy attribute
    • temperatureFactor

      @Parameter(order=12) @Auxiliary public abstract double temperatureFactor()
      Returns:
      The value of the temperatureFactor attribute
    • elementSymbol

      @Parameter(order=13) @Auxiliary public abstract String elementSymbol()
      Returns:
      The value of the elementSymbol attribute
    • charge

      @Parameter(order=14) @Auxiliary public abstract String charge()
      Returns:
      The value of the charge attribute
    • toString

      public final String toString()
      Overrides:
      toString in class Object
    • detectAtomName

      public final AtomName detectAtomName()
      Returns:
      An instance of AtomName enum that matches this object.
    • distanceTo

      public final double distanceTo(PdbAtomLine other)
      Calculates the euclidean distance to another atom.
      Parameters:
      other - Another instance of this class.
      Returns:
      Euclidean distance in 3D between two atoms.
    • toPdb

      public final String toPdb()
      Creates an ATOM line in PDB format.
      Returns:
      A string representation of the ATOM line in PDB format.
    • toCif

      public final String toCif() throws IOException
      Creates an ATOM line in mmCIF format.
      Returns:
      A string representation of the ATOM line in mmCIF format.
      Throws:
      IOException
    • toVector3D

      public final org.apache.commons.math3.geometry.euclidean.threed.Vector3D toVector3D()
      Returns:
      An instance of Vector3D with (x, y, z) coordinates of this instance.