org.biojava.bio.structure
Class Hetatom

java.lang.Object
  extended byorg.biojava.bio.structure.Hetatom
All Implemented Interfaces:
Group
Direct Known Subclasses:
AminoAcid, Nucleotide

public class Hetatom
extends Object
implements Group

Generic Implementation of a Group interface. AminoAcid and Nucleotide are closely related classes.

See Also:
AminoAcid, Nucleotide

Field Summary
static String type
           
 
Constructor Summary
Hetatom()
           
 
Method Summary
 void addAtom(Atom atom)
          add an atom to this group
 Atom getAtom(int position)
          return an atom by its position in the internal ArrayList
 Atom getAtom(String name)
          get an Atom or null, if Atom not in this group
 ArrayList getAtoms()
          get all atoms of this group
 String getPDBCode()
          return the PDBcode of this amino acid
 String getPDBName()
          set the PDB 3 character name for this group
 HashMap getProperties()
          return properties.
 Object getProperty(String key)
          get a single property
 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 this allows to include chemically modified amino acids that are labeled hetatoms into some computations ...
 boolean hasAtom(String name)
          test is an Atom with name is existing
 void setPDBCode(String pdb)
           
 void setPDBFlag(boolean flag)
          flag if group has 3D data
 void setPDBName(String s)
          set three character name of Amino acid
 void setProperties(HashMap props)
          properties of this amino acid.
 void setProperty(String key, Object value)
          set a single property
 int size()
          getnumber of atoms
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

type

public static String type
Constructor Detail

Hetatom

public Hetatom()
Method Detail

has3D

public boolean has3D()
Description copied from interface: Group
returns true or false, depending if this group has 3D coordinates or not.

Specified by:
has3D in interface Group

setPDBFlag

public void setPDBFlag(boolean flag)
Description copied from interface: Group
flag if group has 3D data

Specified by:
setPDBFlag in interface Group

getPDBCode

public String getPDBCode()
Description copied from interface: Group
return the PDBcode of this amino acid

Specified by:
getPDBCode in interface Group

setPDBCode

public void setPDBCode(String pdb)
Specified by:
setPDBCode in interface Group

setPDBName

public void setPDBName(String s)
                throws PDBParseException
set three character name of Amino acid

Specified by:
setPDBName in interface Group
Throws:
PDBParseException

getPDBName

public String getPDBName()
Description copied from interface: Group
set the PDB 3 character name for this group

Specified by:
getPDBName in interface Group

addAtom

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

Specified by:
addAtom in interface Group

size

public int size()
Description copied from interface: Group
getnumber of atoms

Specified by:
size in interface Group

getAtoms

public ArrayList getAtoms()
get all atoms of this group

Specified by:
getAtoms in interface Group

getAtom

public Atom getAtom(String name)
             throws StructureException
get an Atom or null, if Atom not in this group

Specified by:
getAtom in interface Group
Throws:
StructureException

getAtom

public Atom getAtom(int position)
             throws StructureException
return an atom by its position in the internal ArrayList

Specified by:
getAtom in interface Group
Throws:
StructureException

hasAtom

public boolean hasAtom(String name)
test is an Atom with name is existing

Specified by:
hasAtom in interface Group

getType

public String getType()
Description copied from interface: Group
get Type of group, e.g. amino, hetatom, nucleotide

Specified by:
getType in interface Group

toString

public String toString()

hasAminoAtoms

public 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() !

Specified by:
hasAminoAtoms in interface Group
See Also:

amino atoms are : N, CA, C, O, CB GLY does not have CB (unless we would calculate some artificially

if this method call is performed too often, it should become a private method and set a flag ...

setProperties

public void setProperties(HashMap props)
properties of this amino acid. currerntly available properties are: phi psi

Specified by:
setProperties in interface Group

getProperties

public HashMap getProperties()
return properties. @see setProperties()

Specified by:
getProperties in interface Group

setProperty

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

Specified by:
setProperty in interface Group

getProperty

public Object getProperty(String key)
get a single property

Specified by:
getProperty in interface Group