Package org.biojava.nbio.structure
Class HetatomImpl
java.lang.Object
org.biojava.nbio.structure.HetatomImpl
- All Implemented Interfaces:
 Serializable,Group
- Direct Known Subclasses:
 AminoAcidImpl,NucleotideImpl
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:
 
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumBehaviors for how to balance memory vs. - 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ChemCompprotected booleanstores if 3d coordinates are available.protected String3 letter name of amino acid in pdb file.protected ResidueNumberstatic final GroupTypeThe GroupType is HETATM - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a group that is an alternate location for this group.voidAdd an atom to this group.voidremove all atomsclone()returns and identical copy of this Group object .getAltLocGroup(Character altLoc) Gets the alternate location group to this group that has the alt-loc character code passed.Get the list of alternate locations.getAtom(int position) Get at atom by position.Get an atom given its PDB name.getAtoms()Get list of atoms.getChain()Returns the parent Chain of the Group.Utility method for returning the chainId of the Group or null if no Chain has been set.Get the chemical component that closer describes this group.longgetId()the Hibernate database IDReturns the PDBName.return properties.getProperty(String key) get a single property .returns a dynamically created ResidueNumber for the group - this contains the chainId, resNum and insCode of the group.getType()booleanhas3D()returns true or false, depending if this group has 3D coordinates or not.booleanTest if this group has alternate locations.booleanCalculate if this group has all atoms required for an amino acid backbone.booleanTell whether a particular atom exists within this group.booleanisWater()Determines if this group is water.iterator()return an AtomIterator.voidSet the atoms of this group.voidSets the back-reference to its parent Chain.voidsetChemComp(ChemComp cc) Set the Chemical Component that closer describes this group.voidsetId(long id) the Hibernate database IDvoidsetPDBFlag(boolean flag) flag if group has 3D data.voidsetPDBName(String s) Set three character name of Group .voidsetProperties(Map<String, Object> props) Properties of this amino acid.voidsetProperty(String key, Object value) set a single property .voidsetResidueNumber(String chainId, Integer resNum, Character iCode) Utility method to temporarily set a chainID for a group, if a parent chain object does not exist yet.voidsetResidueNumber(ResidueNumber residueNumber) sets the ResidueNumber for this Groupintsize()Get number of atoms.toSDF()Function to get the Group as an MDL molblocktoString()voidattempts to reduce the memory imprint of this group by trimming all internal Collection objects to the required size. 
- 
Field Details
- 
type
The GroupType is HETATM - 
pdb_flag
protected boolean pdb_flagstores if 3d coordinates are available. - 
pdb_name
3 letter name of amino acid in pdb file. - 
residueNumber
 - 
atoms
 - 
performanceBehavior
 - 
chemComp
 
 - 
 - 
Constructor Details
- 
HetatomImpl
public HetatomImpl()Construct a Hetatom instance. 
 - 
 - 
Method Details
- 
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:
 setPDBFlagin interfaceGroup- Parameters:
 flag- true to set flag that this Group has 3D coordinates
 - 
setPDBName
Set three character name of Group .- Specified by:
 setPDBNamein interfaceGroup- Parameters:
 s- a String specifying the PDBName value- See Also:
 
 - 
getPDBName
Returns the PDBName.- Specified by:
 getPDBNamein interfaceGroup- Returns:
 - a String representing the PDBName value
 - See Also:
 
 - 
addAtom
Add an atom to this group. - 
clearAtoms
public void clearAtoms()remove all atoms- Specified by:
 clearAtomsin interfaceGroup
 - 
size
public int size()Get number of atoms. - 
getAtoms
Get list of atoms. - 
setAtoms
Set the atoms of this group. - 
getAtom
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 withAtom.getElement() - 
getAtom
Get at atom by position. - 
hasAtom
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. - 
getType
 - 
toString
 - 
hasAminoAtoms
public 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 isGroup.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
- Specified by:
 hasAminoAtomsin interfaceGroup- Returns:
 - true if all Atoms required for an AminoAcid are available (N, CA, C, O)
 - See Also:
 
 - 
setProperties
Properties of this amino acid. Currently available properties are: phi psi secstruc- Specified by:
 setPropertiesin interfaceGroup- Parameters:
 props- a Map object specifying the properties value- See Also:
 
 - 
getProperties
return properties.- Specified by:
 getPropertiesin interfaceGroup- Returns:
 - a HashMap object representing the properties value
 - See Also:
 
 - 
setProperty
set a single property .- Specified by:
 setPropertyin interfaceGroup- Parameters:
 key- a Stringvalue- an Object- See Also:
 
 - 
getProperty
get a single property .- Specified by:
 getPropertyin interfaceGroup- Parameters:
 key- a String- Returns:
 - an Object
 - See Also:
 
 - 
iterator
return an AtomIterator. - 
clone
returns and identical copy of this Group object . - 
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
 - 
getChemComp
Description copied from interface:GroupGet the chemical component that closer describes this group. If the information does not exist yet, fetches the information from PDB web site.- Specified by:
 getChemCompin interfaceGroup- Returns:
 - the Chemical Component definition for this Group.
 
 - 
setChemComp
Description copied from interface:GroupSet the Chemical Component that closer describes this group.- Specified by:
 setChemCompin interfaceGroup- Parameters:
 cc- the chemical component
 - 
setChain
Sets the back-reference to its parent Chain. - 
getChain
Returns the parent Chain of the Group. - 
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()- Specified by:
 getChainIdin interfaceGroup- Returns:
 - the ID of the chain
 
 - 
getResidueNumber
returns a dynamically created ResidueNumber for the group - this contains the chainId, resNum and insCode of the group.- Specified by:
 getResidueNumberin interfaceGroup- Returns:
 - ResidueNumber for the group.
 - See Also:
 
 - 
setResidueNumber
Description copied from interface:Groupsets the ResidueNumber for this Group- Specified by:
 setResidueNumberin interfaceGroup- Parameters:
 residueNumber- the PDB residueNumber
 - 
setResidueNumber
Description copied from interface:GroupUtility 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.- Specified by:
 setResidueNumberin interfaceGroup
 - 
hasAltLoc
public boolean hasAltLoc()Description copied from interface:GroupTest if this group has alternate locations. - 
getAltLocs
Description copied from interface:GroupGet the list of alternate locations.- Specified by:
 getAltLocsin interfaceGroup- Returns:
 - List of other groups that are on alternate locations
 
 - 
getAltLocGroup
Description copied from interface:GroupGets the alternate location group to this group that has the alt-loc character code passed.- Specified by:
 getAltLocGroupin interfaceGroup- Parameters:
 altLoc- the alternate location code of the group desired- Returns:
 - the alternate location group if found, or null otherwise
 
 - 
addAltLoc
Description copied from interface:GroupAdd a group that is an alternate location for this group. - 
isWater
public boolean isWater()Description copied from interface:GroupDetermines if this group is water. - 
trimToSize
public void trimToSize()attempts to reduce the memory imprint of this group by trimming all internal Collection objects to the required size.- Specified by:
 trimToSizein interfaceGroup
 - 
toSDF
Description copied from interface:GroupFunction to get the Group as an MDL molblock 
 -