org.biojava.bio.structure
Interface Group

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

public interface Group

This is the datastructure for a single Group of atoms. A protein sequence (Chain in PDB file) is represented as a list of this kind of objects. Groups can be of type "amino","hetatm","nucleotide". There are corresponding classes for each of this type which implement interface Group.

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

Method Summary
 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 .
 Atom getAtom(int position)
          get at atom by position.
 Atom getAtom(java.lang.String name)
          get an atom throws StructureException if atom not found.
 java.util.List getAtoms()
          get list of atoms.
 Chain getParent()
          Returns the parent Chain of the Group
 java.lang.String getPDBCode()
          return the PDBcode (residue number) of this group.
 java.lang.String getPDBName()
          set the PDB 3 character name for this group.
 java.util.Map getProperties()
          return properties.
 java.lang.Object getProperty(java.lang.String key)
          get a single property .
 java.lang.String getType()
          get Type of group, e.g.
 boolean has3D()
          returns true or false, depending if this group has 3D coordinates or not.
 boolean hasAminoAtoms()
          calculate if a groups has all atoms required for an amino acid.
 boolean hasAtom(java.lang.String name)
          returns flag whether a particular atom is existing within this group .
 java.util.Iterator iterator()
          get an Atom Iterator.
 void setParent(Chain parent)
          Set the back-reference (to its parent Chain)
 void setPDBCode(java.lang.String pdbcode)
          Specifies the PDBCode value.
 void setPDBFlag(boolean flag)
          flag if group has 3D data .
 void setPDBName(java.lang.String s)
          get the PDB 3 character name for this group.
 void setProperties(java.util.Map properties)
          properties of this amino acid.
 void setProperty(java.lang.String key, java.lang.Object value)
          set a single property .
 int size()
          getnumber of atoms.
 

Method Detail

getPDBCode

java.lang.String getPDBCode()
return the PDBcode (residue number) of this group.

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

setPDBCode

void setPDBCode(java.lang.String pdbcode)
Specifies the PDBCode 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

java.lang.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

java.util.List getAtoms()
get list of atoms.

Returns:
an List object representing the atoms

clearAtoms

void clearAtoms()
remove all atoms from this group


getAtom

Atom getAtom(java.lang.String name)
             throws StructureException
get an atom throws StructureException if atom not found.

Parameters:
name - 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 - ...

hasAtom

boolean hasAtom(java.lang.String name)
returns 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

java.lang.String getPDBName()
set the PDB 3 character name for this group.

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

setPDBName

void setPDBName(java.lang.String s)
                throws PDBParseException
get the PDB 3 character name for this group.

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(java.util.Map 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

java.util.Map getProperties()
return properties.

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

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)

getProperty

java.lang.Object getProperty(java.lang.String key)
get a single property .

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

iterator

java.util.Iterator 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

setParent

void setParent(Chain parent)
Set the back-reference (to its parent Chain)

Parameters:
parent - a WeakReference to the parent Chain

getParent

Chain getParent()
Returns the parent Chain of the Group

Returns:
Chain the Chain object that contains the Group