Class StructureTools


  • public class StructureTools
    extends java.lang.Object
    A class that provides some tool methods.
    Since:
    1.0
    Version:
    %I% %G%
    Author:
    Andreas Prlic
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String[] backboneAtomNames
      The names of the Atoms that form the backbone.
      static java.lang.String caAtomName
      The Atom name of C-alpha atoms.
      static java.util.logging.Logger logger  
      static java.lang.Character UNKNOWN_GROUP_LABEL  
    • Constructor Summary

      Constructors 
      Constructor Description
      StructureTools()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Character convert_3code_1code​(java.lang.String code3)
      convert three character amino acid codes into single character e.g.
      static java.lang.Character get1LetterCode​(java.lang.String groupCode3)
      convert a three letter code into single character.
      static Atom[] getAtomArray​(Structure s, java.lang.String[] atomNames)
      Returns an array of the requested Atoms from the Structure object.
      static Atom[] getAtomCAArray​(Structure s)
      Returns an Atom array of the CA atoms.
      static Atom[] getBackboneAtomArray​(Structure s)
      Returns an Atom array of the MainChain atoms.
      static int getNrAtoms​(Structure s)
      Count how many number of Atoms are contained within a Structure object.
      static int getNrGroups​(Structure s)
      Count how many groups are contained within a structure object.
      static boolean isNucleotide​(java.lang.String groupCode3)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • caAtomName

        public static final java.lang.String caAtomName
        The Atom name of C-alpha atoms.
        See Also:
        Constant Field Values
      • backboneAtomNames

        public static final java.lang.String[] backboneAtomNames
        The names of the Atoms that form the backbone.
      • UNKNOWN_GROUP_LABEL

        public static final java.lang.Character UNKNOWN_GROUP_LABEL
      • logger

        public static java.util.logging.Logger logger
    • Constructor Detail

      • StructureTools

        public StructureTools()
    • Method Detail

      • getNrAtoms

        public static int getNrAtoms​(Structure s)
        Count how many number of Atoms are contained within a Structure object.
        Parameters:
        s - the structure object
        Returns:
        the number of Atoms in this Structure
      • getNrGroups

        public static int getNrGroups​(Structure s)
        Count how many groups are contained within a structure object.
        Parameters:
        s - the structure object
        Returns:
        the number of groups in the structure
      • getAtomArray

        public static Atom[] getAtomArray​(Structure s,
                                          java.lang.String[] atomNames)
        Returns an array of the requested Atoms from the Structure object. Iterates over all groups and checks if the requested atoms are in this group, no matter if this is a AminoAcid or Hetatom group.
        Parameters:
        s - the structure to get the atoms from
        atomNames - contains the atom names to be used.
        Returns:
        an Atom[] array
      • getAtomCAArray

        public static Atom[] getAtomCAArray​(Structure s)
        Returns an Atom array of the CA atoms.
        Parameters:
        s - the structure object
        Returns:
        an Atom[] array
      • getBackboneAtomArray

        public static Atom[] getBackboneAtomArray​(Structure s)
        Returns an Atom array of the MainChain atoms.
        Parameters:
        s - the structure object
        Returns:
        an Atom[] array
      • convert_3code_1code

        public static java.lang.Character convert_3code_1code​(java.lang.String code3)
                                                       throws IllegalSymbolException
        convert three character amino acid codes into single character e.g. convert CYS to C
        Parameters:
        code3 - a three character amino acid representation String
        Returns:
        a character
        Throws:
        IllegalSymbolException
      • get1LetterCode

        public static java.lang.Character get1LetterCode​(java.lang.String groupCode3)
        convert a three letter code into single character. catches for unusual characters
        Parameters:
        groupCode3 - three letter representation
        Returns:
        null if group is a nucleotide code
      • isNucleotide

        public static boolean isNucleotide​(java.lang.String groupCode3)