org.biojava.bio.structure
Interface Group

All Known Subinterfaces:
AminoAcid
All Known Implementing Classes:
AminoAcidImpl, HetatomImpl, NucleotideImpl, SecStrucGroup

public interface Group

This is the data structure for a single Group of atoms. A protein sequence (Chain in PDB file) is represented as a list of Groups. There are 3 types of Groups:

Since:
1.4
Version:
%I% %G%
Author:
Andreas Prlic, Horvath Tamas
See Also:
HetatomImpl, AminoAcidImpl, NucleotideImpl

Method Summary
 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.
 Object clone()
          returns and identical copy of this Group object .
 List<Group> getAltLocs()
          Get the list of alternate locations.
 Atom getAtom(int position)
          Get at atom by position.
 Atom getAtom(String name)
          Get an atom.
 Atom getAtomByPDBname(String pdbName)
          Get an atom by the full PDB name e.g.
 List<Atom> getAtoms()
          Get list of atoms.
 Chain getChain()
          Returns the parent Chain of the Group.
 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.
 Chain getParent()
          Deprecated. replaced by getChain()
 String getPDBCode()
          Deprecated. replaced by getResidueNumber()
 String getPDBName()
          Get the PDB 3 character name for this group.
 Map<String,Object> getProperties()
          return properties.
 Object getProperty(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.
 String getType()
          get Type of group, e.g.
 boolean has3D()
          returns 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 a groups has all atoms required for an amino acid.
 boolean hasAtom(String name)
          Teturns flag whether a particular atom is existing within this group .
 Iterator<Atom> iterator()
          get an Atom Iterator.
 void setAtoms(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 setParent(Chain parent)
          Deprecated. 
 void setPDBCode(String pdbcode)
          Deprecated. replaced by setResidueNumber(ResidueNumber)
 void setPDBFlag(boolean flag)
          flag if group has 3D data .
 void setPDBName(String s)
          Set the PDB 3 letter name for this group.
 void setProperties(Map<String,Object> properties)
          properties of this amino acid.
 void setProperty(String key, Object value)
          set a single property .
 void setResidueNumber(ResidueNumber residueNumber)
          sets the ResidueNumber for this Group
 void setResidueNumber(String chainId, Integer residueNumber, Character iCode)
          Utility method to temporarily set a chainID for a group, if a parent chain object does not exist yet.
 int size()
          getnumber of atoms.
 

Method Detail

getPDBCode

@Deprecated
String getPDBCode()
Deprecated. replaced by getResidueNumber()

Return the PDBcode (residue number + insertion code ) of this group. The residue number is treated as a String for the following reasons: Every amino acid in a PDB file is identified uniquely by 3 things: The chain ID, the residue number and the insertion code. To make sure one does not forget about the insertion code, in BioJava it is appended to the residue number. To add to this, residue numbers can be negative, non-consecutive and also non-sequential. As such it is often easiest, to treat them as public identifiers and within your own code work with the internal atom or group positions...

Returns:
a String representing the PDBCode value
See Also:
setPDBCode(java.lang.String)

setPDBCode

@Deprecated
void setPDBCode(String pdbcode)
Deprecated. replaced by setResidueNumber(ResidueNumber)

Specifies the PDBCode (residue number + insertion code) value.

Parameters:
pdbcode - a String specifying the PDBCode value
See Also:
getPDBCode()

size

int size()
getnumber of atoms.

Returns:
number of atoms of this Group

has3D

boolean has3D()
returns 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

getType

String getType()
get Type of group, e.g. amino, hetatom, nucleotide.

Returns:
a String representing the type value

addAtom

void addAtom(Atom atom)
add an atom to this group.

Parameters:
atom - an Atom object

getAtoms

List<Atom> getAtoms()
Get list of atoms.

Returns:
an List object representing the atoms
See Also:
setAtoms(List)

setAtoms

void setAtoms(List<Atom> atoms)
Set the atoms of this group.

Parameters:
atoms - a list of atoms
See Also:
Atom

clearAtoms

void clearAtoms()
Remove all atoms from this group.


getAtom

Atom getAtom(String name)
             throws StructureException
Get an atom. Throws StructureException if atom not found.

Parameters:
name - a String
Returns:
an Atom object
Throws:
StructureException - if atom not found.

getAtomByPDBname

Atom getAtomByPDBname(String pdbName)
                      throws StructureException
Get an atom by the full PDB name e.g. " N " for N. Throws StructureException if atom not found.

Parameters:
pdbName - a String
Returns:
an Atom object
Throws:
StructureException - ...

getAtom

Atom getAtom(int position)
             throws StructureException
Get at atom by position.

Parameters:
position - an int
Returns:
an Atom object
Throws:
StructureException - if not atom at this position

hasAtom

boolean hasAtom(String name)
Teturns flag whether a particular atom is existing within this group .

Parameters:
name - a String ...
Returns:
true if Atom with name is existing within this group

getPDBName

String getPDBName()
Get the PDB 3 character name for this group. (e.g. ALA)

Returns:
a String representing the PDBName value
See Also:
setPDBName(java.lang.String)

setPDBName

void setPDBName(String s)
                throws PDBParseException
Set the PDB 3 letter name for this group. (e.g. ALA)

Parameters:
s - a String specifying the PDBName value
Throws:
PDBParseException - ...
See Also:
getPDBName()

hasAminoAtoms

boolean hasAminoAtoms()
calculate if a groups has all atoms required for an amino acid. 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, CB GLY does not have CB (unless we would calculate some artificially

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, CB)
See Also:
getType()

setProperties

void setProperties(Map<String,Object> properties)
properties of this amino acid. currerntly available properties. are: phi psi

Parameters:
properties - a Map object specifying the properties value
See Also:
getProperties()

getProperties

Map<String,Object> getProperties()
return properties.

Returns:
a HashMap object representing the properties value
See Also:
setProperties(java.util.Map)

setProperty

void setProperty(String key,
                 Object value)
set a single property .

Parameters:
key - a String
value - an Object
See Also:
getProperty(java.lang.String)

getProperty

Object getProperty(String key)
get a single property .

Parameters:
key - a String
Returns:
an Object
See Also:
setProperty(java.lang.String, java.lang.Object)

iterator

Iterator<Atom> iterator()
get an Atom Iterator.

Returns:
an Iterator object

clone

Object clone()
returns and identical copy of this Group object .

Returns:
and identical copy of this Group object

setParent

@Deprecated
void setParent(Chain parent)
Deprecated. 

Set the back-reference (to its parent Chain).

Parameters:
parent - the parent Chain
See Also:
setChain(Chain), getChain()

getParent

@Deprecated
Chain getParent()
Deprecated. replaced by getChain()

Returns the parent Chain of the Group.

Returns:
Chain the Chain object that contains the Group
See Also:
setChain(Chain)

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(String chainId,
                      Integer residueNumber,
                      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

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

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.