Package org.biojava.bio.structure
Class HetatomImpl
- java.lang.Object
-
- org.biojava.bio.structure.HetatomImpl
-
- All Implemented Interfaces:
Group
- Direct Known Subclasses:
AminoAcidImpl
,NucleotideImpl
public class HetatomImpl extends java.lang.Object implements Group
Generic Implementation of a Group interface. AminoAcidImpl and NucleotideImpl are closely related classes.- Since:
- 1.4
- Version:
- %I% %G%
- Author:
- Andreas Prlic, Horvath Tamas
- See Also:
AminoAcidImpl
,NucleotideImpl
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
type
this is a "hetatm".
-
Constructor Summary
Constructors Constructor Description HetatomImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAtom(Atom atom)
add an atom to this group.void
clearAtoms()
remove all atomsjava.lang.Object
clone()
returns and identical copy of this Group object .Atom
getAtom(int position)
return an atom by its position in the internal List.Atom
getAtom(java.lang.String name)
get an atom throws StructureException if atom not found.java.util.List<Atom>
getAtoms()
get all atoms of this group .long
getId()
the Hibernate database IDChain
getParent()
Returns the parent Chain of the Groupjava.lang.String
getPDBCode()
Returns the PDBCode.java.lang.String
getPDBName()
Returns the PDBName.java.util.Map<java.lang.String,java.lang.Object>
getProperties()
return properties.java.lang.Object
getProperty(java.lang.String key)
get a single property .java.lang.String
getType()
Returns the type value.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(java.lang.String name)
test is an Atom with name is existing.java.util.Iterator<Atom>
iterator()
return an AtomIterator.void
setAtoms(java.util.List<Atom> atoms)
set the atoms of this groupvoid
setId(long id)
the Hibernate database IDvoid
setParent(Chain parent)
Set the back-reference (to its parent Chain)void
setPDBCode(java.lang.String pdb)
set the PDB code.void
setPDBFlag(boolean flag)
flag if group has 3D data.void
setPDBName(java.lang.String s)
set three character name of Group .void
setProperties(java.util.Map<java.lang.String,java.lang.Object> props)
properties of this amino acid.void
setProperty(java.lang.String key, java.lang.Object value)
set a single property .int
size()
getnumber of atoms.java.lang.String
toString()
-
-
-
Field Detail
-
type
public static final java.lang.String type
this is a "hetatm".- See Also:
- Constant Field Values
-
-
Method Detail
-
has3D
public boolean has3D()
returns true or false, depending if this group has 3D coordinates or not.
-
setPDBFlag
public void setPDBFlag(boolean flag)
flag if group has 3D data.- Specified by:
setPDBFlag
in interfaceGroup
- Parameters:
flag
- true to set flag that this Group has 3D coordinates
-
getPDBCode
public java.lang.String getPDBCode()
Returns the PDBCode.- Specified by:
getPDBCode
in interfaceGroup
- Returns:
- a String representing the PDBCode value
- See Also:
setPDBCode(java.lang.String)
-
setPDBCode
public void setPDBCode(java.lang.String pdb)
set the PDB code.- Specified by:
setPDBCode
in interfaceGroup
- Parameters:
pdb
- a String specifying the PDBCode value- See Also:
getPDBCode()
-
setPDBName
public void setPDBName(java.lang.String s) throws PDBParseException
set three character name of Group .- Specified by:
setPDBName
in interfaceGroup
- Parameters:
s
- a String specifying the PDBName value- Throws:
PDBParseException
- ...- See Also:
getPDBName()
-
getPDBName
public java.lang.String getPDBName()
Returns the PDBName.- Specified by:
getPDBName
in interfaceGroup
- Returns:
- a String representing the PDBName value
- See Also:
setPDBName(java.lang.String)
-
addAtom
public void addAtom(Atom atom)
add an atom to this group.
-
clearAtoms
public void clearAtoms()
remove all atoms- Specified by:
clearAtoms
in interfaceGroup
-
size
public int size()
getnumber of atoms.
-
getAtoms
public java.util.List<Atom> getAtoms()
get all atoms of this group . returns a List of all atoms in this Group- Specified by:
getAtoms
in interfaceGroup
- Returns:
- an List object representing the atoms value
- See Also:
Group.setAtoms(List)
-
setAtoms
public void setAtoms(java.util.List<Atom> atoms)
set the atoms of this group
-
getAtom
public Atom getAtom(java.lang.String name) throws StructureException
get an atom throws StructureException if atom not found.- Specified by:
getAtom
in interfaceGroup
- Parameters:
name
- a String- Returns:
- an Atom object
- Throws:
StructureException
- ...
-
getAtom
public Atom getAtom(int position) throws StructureException
return an atom by its position in the internal List.- Specified by:
getAtom
in interfaceGroup
- Parameters:
position
- an int- Returns:
- an Atom object
- Throws:
StructureException
- ...
-
hasAtom
public boolean hasAtom(java.lang.String name)
test is an Atom with name is existing.
-
getType
public java.lang.String getType()
Returns the type value.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
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() !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
- Specified by:
hasAminoAtoms
in interfaceGroup
- Returns:
- true if all Atoms required for an AminoAcid are available (N, CA, C, O, CB)
- See Also:
getType()
-
setProperties
public void setProperties(java.util.Map<java.lang.String,java.lang.Object> props)
properties of this amino acid. currerntly available properties. are: phi psi- Specified by:
setProperties
in interfaceGroup
- Parameters:
props
- a Map object specifying the properties value- See Also:
getProperties()
-
getProperties
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
return properties.- Specified by:
getProperties
in interfaceGroup
- Returns:
- a HashMap object representing the properties value
- See Also:
setProperties(java.util.Map<java.lang.String, java.lang.Object>)
-
setProperty
public void setProperty(java.lang.String key, java.lang.Object value)
set a single property .- Specified by:
setProperty
in interfaceGroup
- Parameters:
key
- a Stringvalue
- an Object- See Also:
getProperties()
,getProperty(java.lang.String)
-
getProperty
public java.lang.Object getProperty(java.lang.String key)
get a single property .- Specified by:
getProperty
in interfaceGroup
- Parameters:
key
- a String- Returns:
- an Object
- See Also:
setProperty(java.lang.String, java.lang.Object)
,setProperties(java.util.Map<java.lang.String, java.lang.Object>)
-
iterator
public java.util.Iterator<Atom> iterator()
return an AtomIterator.
-
clone
public java.lang.Object clone()
returns and identical copy of this Group object .
-
setParent
public void setParent(Chain parent)
Set the back-reference (to its parent Chain)- Specified by:
setParent
in interfaceGroup
- Parameters:
parent
- the parent Chain- See Also:
Group.getParent()
-
getParent
public Chain getParent()
Returns the parent Chain of the Group- Specified by:
getParent
in interfaceGroup
- Returns:
- Chain the Chain object that contains the Group
- See Also:
Group.setParent(Chain)
-
getId
public long getId()
the Hibernate database ID- Returns:
- the id
-
setId
public void setId(long id)
the Hibernate database ID- Parameters:
id
- the hibernate id
-
-