Package org.biojava.nbio.structure
Interface Group
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
AminoAcid
- All Known Implementing Classes:
AminoAcidImpl,HetatomImpl,NucleotideImpl
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:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a group that is an alternate location for this group.voidAdd an atom to this group.voidRemove all atoms from this group.clone()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 other alternate location groups.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.Get the PDB 3-letter name for this group.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()Return true or false, depending if this group has 3D coordinates or not.booleanCheck if this group has alternate location groups.booleanCalculate if this group has all atoms required for an amino acid backbone.booleanTell whether a particular atom exists within this group.booleanCheck if this group is an aminoacid group, from the definition in Chemical Component DictionarybooleanTells whether the group is annotated as HETATM in the file.booleanCheck if this group is a nucleotide group, from the definition in Chemical Component DictionarybooleanCheck if this group is a polymeric group, from the definition in Chemical Component DictionarybooleanisWater()Determines if this group is water.iterator()Get an Atom Iterator.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.voidsetHetAtomInFile(boolean isHetAtomInFile) Sets the field isHetAtomInFile which is intented only for helping in infering if a polymeric group is in a ligand chain or in a polymeric chain.voidsetPDBFlag(boolean flag) Flag if group has 3D data .voidsetPDBName(String s) Set the PDB 3-letter name for this group.voidsetProperties(Map<String, Object> properties) Properties of this amino acid.voidsetProperty(String key, Object value) Set a single property .voidsetResidueNumber(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.voidsetResidueNumber(ResidueNumber residueNumber) Sets the ResidueNumber for this Groupintsize()Get number of atoms.toSDF()Function to get the Group as an MDL molblockvoidAttempts to reduce the memory imprint of this group by trimming all internal Collection objects to the required size.
-
Field Details
-
SEC_STRUC
Group property key for secondary structure annotation- See Also:
-
-
Method Details
-
size
int size()Get number of atoms.- Returns:
- number of atoms of this Group
-
has3D
boolean has3D()Return true or false, depending if this group has 3D coordinates or not.- Returns:
- true if Group has 3D coordinates
-
setPDBFlag
Flag if group has 3D data .- Parameters:
flag- true to set flag that this Group has 3D coordinates
-
getType
- Returns:
- a String representing the type value
-
addAtom
Add an atom to this group.- Parameters:
atom- an Atom object
-
getAtoms
Get list of atoms.- Returns:
- a List object representing the atoms
- See Also:
-
setAtoms
Set the atoms of this group.- Parameters:
atoms- a list of atoms- See Also:
-
clearAtoms
void clearAtoms()Remove all atoms from 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()Note this method will return only the atom in the default alternative location (be it '.' or a letter).
- Parameters:
name- a trimmed String representing the atom's PDB name, e.g. "CA"- Returns:
- an Atom object or null if no such atom exists within this group
-
getAtom
Get at atom by position.- Parameters:
position- an int- Returns:
- an Atom object or null if no Atom exists for given 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.- Parameters:
name- a trimmed String representing the atom's PDB name, e.g. "CA"- Returns:
- true if Atom with name exists within this group
-
getPDBName
Get the PDB 3-letter name for this group. (e.g. ALA)- Returns:
- a String representing the PDBName value
- See Also:
-
setPDBName
Set the PDB 3-letter name for this group. (e.g. ALA)- Parameters:
s- a String specifying the PDBName value- See Also:
-
hasAminoAtoms
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 isgetType()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
- Returns:
- true if all Atoms required for an AminoAcid are available (N, CA, C, O)
- See Also:
-
isPolymeric
boolean isPolymeric()Check if this group is a polymeric group, from the definition in Chemical Component Dictionary- Returns:
- true if a polymeric group
-
isAminoAcid
boolean isAminoAcid()Check if this group is an aminoacid group, from the definition in Chemical Component Dictionary- Returns:
- true if an amino acid
-
isNucleotide
boolean isNucleotide()Check if this group is a nucleotide group, from the definition in Chemical Component Dictionary- Returns:
- true if a nucleotide
-
setProperties
Properties of this amino acid. Currently available properties are: phi psi secstruc- Parameters:
properties- a Map object specifying the properties value- See Also:
-
getProperties
Return properties.- Returns:
- a HashMap object representing the properties value
- See Also:
-
setProperty
Set a single property .- Parameters:
key- a Stringvalue- an Object- See Also:
-
getProperty
Get a single property .- Parameters:
key- a String- Returns:
- an Object
- See Also:
-
iterator
Get an Atom Iterator.- Returns:
- an Iterator object
-
clone
Returns and identical copy of this Group object .- Returns:
- and identical copy of this Group object
-
setChain
Sets the back-reference to its parent Chain.- Parameters:
chain- the parent Chain- Since:
- 3.0
- See Also:
-
getChain
Returns the parent Chain of the Group.- Returns:
- Chain the Chain object that contains the Group
- Since:
- 3.0
- See Also:
-
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:
-
setResidueNumber
Sets the ResidueNumber for this Group- Parameters:
residueNumber- the PDB residueNumber
-
setResidueNumber
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
Utility method for returning the chainId of the Group or null if no Chain has been set. This is equivalent to calling getChain().getId() Prior to version 5.0 this method returned the chain name.- Returns:
- the ID of the chain
- Since:
- 3.0
-
setChemComp
Set the Chemical Component that closer describes this group.- Parameters:
cc- the chemical component
-
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()Check if this group has alternate location groups.- Returns:
- boolean flag if there are alternate locations.
- See Also:
-
getAltLocs
List<Group> getAltLocs()Get the list of other alternate location groups.The main group (this group) will contain the first altloc (be it the default '.' or 'A' or a mix of '.' and 'A').
This method will return the altloc groups that are not the main group, e.g.:
- if '.' (default), 'A' and 'B' altlocs are present in file, the main group will contain the default '.' and this method will return 2 altloc groups
- if 'A' and 'B' are present in file without a default '.' group, then the main group will contain the 'A' location whilst this method will return only 1 altloc group with the 'B' location
Note that atoms with the default altloc (.) are included in all groups. Atoms with other altlocs (typically A, B, etc) will be sorted into groups by altloc.
Thus it can happen that an altloc group duplicate the contents of the main group.
- Returns:
- List of other groups that are on alternate locations
-
addAltLoc
Add a group that is an alternate location for this group.- Parameters:
g- the altloc group to add
-
isWater
boolean isWater()Determines if this group is water.- Returns:
- true if it's water, false otherwise.
- See Also:
-
getAltLocGroup
Gets the alternate location group to this group that has the alt-loc character code passed.- Parameters:
altLoc- the alternate location code of the group desired- Returns:
- the alternate location group if found, or null otherwise
-
trimToSize
void trimToSize()Attempts to reduce the memory imprint of this group by trimming all internal Collection objects to the required size. -
toSDF
Function to get the Group as an MDL molblock- Returns:
- the string of the MDL molblock
-
isHetAtomInFile
boolean isHetAtomInFile()Tells whether the group is annotated as HETATM in the file. To be used only at parsing time to be able to infer that a polymeric group is in a ligand chain or not.- Returns:
-
setHetAtomInFile
Sets the field isHetAtomInFile which is intented only for helping in infering if a polymeric group is in a ligand chain or in a polymeric chain.- Parameters:
isHetAtomInFile-
-