Interface Group

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String SEC_STRUC
      Group property key for secondary structure annotation
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addAltLoc​(Group g)
      Add a group that is an alternate location for this group.
      void addAtom​(Atom atom)
      Add an atom to this group.
      void clearAtoms()
      Remove all atoms from this group.
      java.lang.Object clone()
      returns and identical copy of this Group object .
      Group getAltLocGroup​(java.lang.Character altLoc)
      Gets the alternate location group to this group that has the alt-loc character code passed.
      java.util.List<Group> getAltLocs()
      Get the list of alternate locations.
      Atom getAtom​(int position)
      Get at atom by position.
      Atom getAtom​(java.lang.String name)
      Get an atom given its PDB name.
      java.util.List<Atom> getAtoms()
      Get list of atoms.
      Chain getChain()
      Returns the parent Chain of the Group.
      java.lang.String getChainId()
      Utility method for returning the chainId of the Group or null if no Chain has been set.
      ChemComp getChemComp()
      Get the chemical component that closer describes this group.
      java.lang.String getPDBName()
      Get the PDB 3-letter name for this group.
      java.util.Map<java.lang.String,​java.lang.Object> getProperties()
      return properties.
      java.lang.Object getProperty​(java.lang.String key)
      get a single property .
      ResidueNumber getResidueNumber()
      returns a dynamically created ResidueNumber for the group - this contains the chainId, resNum and insCode of the group.
      GroupType getType()
      boolean has3D()
      Return true or false, depending if this group has 3D coordinates or not.
      boolean hasAltLoc()
      Test if this group has alternate locations.
      boolean hasAminoAtoms()
      Calculate if this group has all atoms required for an amino acid backbone.
      boolean hasAtom​(java.lang.String name)
      Tell whether a particular atom exists within this group.
      boolean isWater()
      Determines if this group is water.
      java.util.Iterator<Atom> iterator()
      get an Atom Iterator.
      void setAtoms​(java.util.List<Atom> atoms)
      Set the atoms of this group.
      void setChain​(Chain chain)
      Sets the back-reference to its parent Chain.
      void setChemComp​(ChemComp cc)
      Set the Chemical Component that closer describes this group.
      void setPDBFlag​(boolean flag)
      Flag if group has 3D data .
      void setPDBName​(java.lang.String s)
      Set the PDB 3-letter name for this group.
      void setProperties​(java.util.Map<java.lang.String,​java.lang.Object> properties)
      Properties of this amino acid.
      void setProperty​(java.lang.String key, java.lang.Object value)
      set a single property .
      void setResidueNumber​(java.lang.String chainId, java.lang.Integer residueNumber, java.lang.Character iCode)
      Utility method to temporarily set a chainID for a group, if a parent chain object does not exist yet.
      void setResidueNumber​(ResidueNumber residueNumber)
      sets the ResidueNumber for this Group
      int size()
      Get number of atoms.
      java.lang.String toSDF()
      Function to get the Group as an MDL molblock
      void trimToSize()
      attempts to reduce the memory imprint of this group by trimming all internal Collection objects to the required size.
    • Field Detail

      • SEC_STRUC

        static final java.lang.String SEC_STRUC
        Group property key for secondary structure annotation
        See Also:
        Constant Field Values
    • Method Detail

      • size

        int size()
        Get number of atoms.
        Returns:
        number of atoms of this Group
      • has3D

        boolean has3D()
        Return true or false, depending if this group has 3D coordinates or not.
        Returns:
        true if Group has 3D coordinates
      • setPDBFlag

        void setPDBFlag​(boolean flag)
        Flag if group has 3D data .
        Parameters:
        flag - true to set flag that this Group has 3D coordinates
      • addAtom

        void addAtom​(Atom atom)
        Add an atom to this group.
        Parameters:
        atom - an Atom object
      • getAtoms

        java.util.List<Atom> getAtoms()
        Get list of atoms.
        Returns:
        a List object representing the atoms
        See Also:
        setAtoms(List)
      • setAtoms

        void setAtoms​(java.util.List<Atom> atoms)
        Set the atoms of this group.
        Parameters:
        atoms - a list of atoms
      • clearAtoms

        void clearAtoms()
        Remove all atoms from this group.
      • getAtom

        Atom getAtom​(java.lang.String name)
        Get an atom given its PDB name. Beware that some PDB atom names are ambiguous (e.g. CA, which means C-alpha or Calcium), ambiguities should not occur within the same group though. To solve these ambiguities one would need to check the atom returned for the required element with Atom.getElement()
        Parameters:
        name - a trimmed String representing the atom's PDB name, e.g. "CA"
        Returns:
        an Atom object or null if no such atom exists within this group
      • getAtom

        Atom getAtom​(int position)
        Get at atom by position.
        Parameters:
        position - an int
        Returns:
        an Atom object or null if no Atom exists for given position
      • hasAtom

        boolean hasAtom​(java.lang.String name)
        Tell whether a particular atom exists within this group. Beware that some PDB atom names are ambiguous (e.g. CA, which means C-alpha or Calcium), ambiguities should not occur within the same group though.
        Parameters:
        name - a trimmed String representing the atom's PDB name, e.g. "CA"
        Returns:
        true if Atom with name exists within this group
      • getPDBName

        java.lang.String getPDBName()
        Get the PDB 3-letter name for this group. (e.g. ALA)
        Returns:
        a String representing the PDBName value
        See Also:
        setPDBName(java.lang.String)
      • setPDBName

        void setPDBName​(java.lang.String s)
        Set the PDB 3-letter name for this group. (e.g. ALA)
        Parameters:
        s - a String specifying the PDBName value
        See Also:
        getPDBName()
      • hasAminoAtoms

        boolean hasAminoAtoms()
        Calculate if this group has all atoms required for an amino acid backbone. This allows to include chemically modified amino acids that are labeled hetatoms into some computations, the usual way to identify if a group is an amino acid is getType()

        amino atoms are : N, CA, C, O

        Example: 1DW9 chain A first group is a Selenomethionine, provided as HETATM, but here returns true.
         HETATM    1  N   MSE A   1      11.720  20.973   1.584  0.00  0.00           N
         HETATM    2  CA  MSE A   1      10.381  20.548   1.139  0.00  0.00           C
         HETATM    3  C   MSE A   1       9.637  20.037   2.398  0.00  0.00           C
         HETATM    4  O   MSE A   1      10.198  19.156   2.985  0.00  0.00           O
         HETATM    5  CB  MSE A   1      10.407  19.441   0.088  0.00  0.00           C
         
        Returns:
        true if all Atoms required for an AminoAcid are available (N, CA, C, O)
        See Also:
        getType()
      • setProperties

        void setProperties​(java.util.Map<java.lang.String,​java.lang.Object> properties)
        Properties of this amino acid. Currently available properties are: phi psi secstruc
        Parameters:
        properties - a Map object specifying the properties value
        See Also:
        getProperties()
      • setProperty

        void setProperty​(java.lang.String key,
                         java.lang.Object value)
        set a single property .
        Parameters:
        key - a String
        value - an Object
        See Also:
        getProperty(java.lang.String)
      • iterator

        java.util.Iterator<Atom> iterator()
        get an Atom Iterator.
        Returns:
        an Iterator object
      • clone

        java.lang.Object clone()
        returns and identical copy of this Group object .
        Returns:
        and identical copy of this Group object
      • setChain

        void setChain​(Chain chain)
        Sets the back-reference to its parent Chain.
        Parameters:
        chain - the parent Chain
        Since:
        3.0
        See Also:
        getChain()
      • getChain

        Chain getChain()
        Returns the parent Chain of the Group.
        Returns:
        Chain the Chain object that contains the Group
        Since:
        3.0
        See Also:
        setChain(Chain)
      • getResidueNumber

        ResidueNumber getResidueNumber()
        returns a dynamically created ResidueNumber for the group - this contains the chainId, resNum and insCode of the group.
        Returns:
        ResidueNumber for the group.
        Since:
        3.0
        See Also:
        ResidueNumber
      • setResidueNumber

        void setResidueNumber​(ResidueNumber residueNumber)
        sets the ResidueNumber for this Group
        Parameters:
        residueNumber - the PDB residueNumber
      • setResidueNumber

        void setResidueNumber​(java.lang.String chainId,
                              java.lang.Integer residueNumber,
                              java.lang.Character iCode)
        Utility method to temporarily set a chainID for a group, if a parent chain object does not exist yet. Not recommended for general use other than parsing.
        Parameters:
        chainId -
        residueNumber -
        iCode -
      • getChainId

        java.lang.String getChainId()
        Utility method for returning the chainId of the Group or null if no Chain has been set. This replaces the need to use the expression group.getChain().getId()
        Returns:
        the ID of the chain
        Since:
        3.0
      • setChemComp

        void setChemComp​(ChemComp cc)
        Set the Chemical Component that closer describes this group.
        Parameters:
        cc - the chemical component
      • getChemComp

        ChemComp getChemComp()
        Get the chemical component that closer describes this group. If the information does not exist yet, fetches the information from PDB web site.
        Returns:
        the Chemical Component definition for this Group.
      • hasAltLoc

        boolean hasAltLoc()
        Test if this group has alternate locations.
        Returns:
        boolean flag if there are alternate locations.
      • getAltLocs

        java.util.List<Group> getAltLocs()
        Get the list of alternate locations.
        Returns:
        List of other groups that are on alternate locations
      • addAltLoc

        void addAltLoc​(Group g)
        Add a group that is an alternate location for this group.
      • isWater

        boolean isWater()
        Determines if this group is water.
        Returns:
        true if it's water, false otherwise.
      • getAltLocGroup

        Group getAltLocGroup​(java.lang.Character altLoc)
        Gets the alternate location group to this group that has the alt-loc character code passed.
        Parameters:
        altLoc - the alternate location code of the group desired
        Returns:
        the alternate location group if found, or null otherwise
      • trimToSize

        void trimToSize()
        attempts to reduce the memory imprint of this group by trimming all internal Collection objects to the required size.
      • toSDF

        java.lang.String toSDF()
        Function to get the Group as an MDL molblock
        Returns:
        the string of the MDL molblock