Interface Chain
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
ChainImpl
Defines the interface for a Chain. A Chain corresponds to a Chain in a PDB file.
A chain consists out of a list of Group objects. A Group can either be
an AminoAcid, Hetatom or Nucleotide.
The BioJava API provides access to both the ATOM and SEQRES records in a PDB file.
During parsing of a PDB file it aligns the ATOM and SEQRES groups and joins them.
The SEQRES sequence can be accessed via getSeqResGroups() and the
ATOM groups via getAtomGroups(). Groups that have been observed
(i.e. they are in the ATOM records) can be detected by Group.has3D()
- Since:
- 1.4
- Version:
- %I% %G%
- Author:
- Andreas Prlic
-
Method Summary
Modifier and TypeMethodDescriptionvoidadd a group to the list of ATOM record group of this chain.clone()returns an identical copy of this Chain.getAtomGroup(int position) Return the Group at given position, from within Groups with observed density in the chain, i.e.Return all Groups with observed density in the chain, i.e.getAtomGroups(GroupType type) Return a List of all (observed) Groups of a special type, one of:GroupType.AMINOACID,GroupType.HETATMorGroupType.NUCLEOTIDE.intReturns the number of Groups with observed density in the chain, i.e.Deprecated.since biojava 5.0 this does not apply anymore.Returns the sequence of amino acids as it has been provided in the ATOM records.Sequence<?>Converts the SEQRES groups of a Chain to a Biojava Sequence object.Deprecated.use getId() insteadReturns the EntityInfo for this chain.Returns the EntityType of this chain.getGroupByPDB(ResidueNumber resNum) Get a group by its PDB residue numbering.Group[]getGroupsByPDB(ResidueNumber pdbresnumStart, ResidueNumber pdbresnumEnd) Get all groups that are located between two PDB residue numbers.Group[]getGroupsByPDB(ResidueNumber pdbresnumStart, ResidueNumber pdbresnumEnd, boolean ignoreMissing) Get all groups that are located between two PDB residue numbers.getId()Get the 'private' asymId (internal chain IDs in mmCif) for this chain.Deprecated.usegetId()insteadgetName()Get the 'public' authId (chain ID in PDB file)Deprecated.use getStructure(Structure) instead.Get the predominantGroupTypefor a given Chain, following these rules: if the ratio of number of residues of a certainGroupTypeto total non-water residues is above the threshold {@value #org.biojava.nbio.structure.StructureTools.RATIO_RESIDUES_TO_TOTAL}, then thatGroupTypeis returned if there is noGroupTypethat is above the threshold then theGroupTypewith most members is chosen, logging itGets annotated sequence mismatches for this chain.getSeqResGroup(int position) Return the Group at given position, from within groups in the SEQRES records of the chain, i.e.Returns a list of all groups in SEQRES records of the chain, i.e.getSeqResGroups(GroupType type) Returns a List of all SEQRES groups of a special type, one of:GroupType.AMINOACID,GroupType.HETATMorGroupType.NUCLEOTIDE.intReturns the number of groups in the SEQRES records of the chain, i.e.Returns the PDB SEQRES sequence as a one-letter sequence string.Returns the parent Structure of this chain.Gets the Swissprot id of this chain.booleanTell whether given chain is DNA or RNAbooleanTell whether given chain is a protein chainbooleanReturns true if the given chain is composed of non-polymeric (including water) groups only.booleanTests if a chain is consisting of water molecules onlyvoidsetAtomGroups(List<Group> groups) Set all Groups with observed density in the chain, i.e.voidsetChainID(String asymId) Deprecated.usesetId(String asymId)insteadvoidsetEntityInfo(EntityInfo entityInfo) Sets the Entity informationvoidSet the 'private' asymId (internal chain IDs in mmCif) for this chain.voidsetInternalChainID(String internalChainID) Deprecated.use#setId()insteadvoidSet the 'public' authId (chain ID in PDB file)voidDeprecated.use setStructure insteadvoidsetSeqMisMatches(List<SeqMisMatch> seqMisMatches) Sets annotated sequence mismatches for this chain.voidsetSeqResGroups(List<Group> seqResGroups) Sets the list of SeqResGroups for this chain.voidsetStructure(Structure parent) Sets the back-reference to its parent Structure.voidsetSwissprotId(String sp_id) Sets the Swissprot id of this chain.toMMCIF()Convert this Chain to a String in mmCIF formattoPDB()Convert this Chain to a String in PDB formattoString()
-
Method Details
-
clone
Object clone()returns an identical copy of this Chain.- Returns:
- an identical copy of this Chain
-
addGroup
add a group to the list of ATOM record group of this chain. To add SEQRES records a more complex alignment between ATOM and SEQRES residues is required, please see SeqRes2AtomAligner for more details on that.- Parameters:
group- a Group object
-
getId
String getId()Get the 'private' asymId (internal chain IDs in mmCif) for this chain.- Returns:
- the asymId
- See Also:
-
setId
Set the 'private' asymId (internal chain IDs in mmCif) for this chain.- Parameters:
asymId- the internal chain Id
-
setName
Set the 'public' authId (chain ID in PDB file)- Parameters:
authId- the 'public' authId (chain ID in PDB file)- See Also:
-
getName
String getName()Get the 'public' authId (chain ID in PDB file)- Returns:
- the authId for this chain.
- See Also:
-
getAtomGroup
Return the Group at given position, from within Groups with observed density in the chain, i.e. those with coordinates in ATOM and HETATMS (including waters) records.- Parameters:
position- an int- Returns:
- a Group object
- See Also:
-
getSeqResGroup
Return the Group at given position, from within groups in the SEQRES records of the chain, i.e. the aminoacids/nucleotides in the construct.- Parameters:
position- an int- Returns:
- a Group object
- See Also:
-
getAtomGroups
Return all Groups with observed density in the chain, i.e. those with coordinates in ATOM and HETATMS (including waters) records.- Returns:
- a List object representing the Groups of this Chain.
- See Also:
-
setAtomGroups
Set all Groups with observed density in the chain, i.e. those with coordinates in ATOM and HETATMs (including waters) records.- Parameters:
groups- a List object representing the Groups of this Chain.- See Also:
-
getAtomGroups
Return a List of all (observed) Groups of a special type, one of:GroupType.AMINOACID,GroupType.HETATMorGroupType.NUCLEOTIDE. Note that if a standard aminoacid appears as a HETATM (because it is part of a ligand) then it is still considered asGroupType.AMINOACIDand not asGroupType.HETATM.- Parameters:
type- GroupType- Returns:
- a List object
- See Also:
-
getGroupByPDB
Get a group by its PDB residue numbering. If the PDB residue number is not known, throws a StructureException.- Parameters:
resNum- the PDB residue number of the group- Returns:
- the matching group
- Throws:
StructureException
-
getGroupsByPDB
Group[] getGroupsByPDB(ResidueNumber pdbresnumStart, ResidueNumber pdbresnumEnd) throws StructureException Get all groups that are located between two PDB residue numbers.- Parameters:
pdbresnumStart- PDB residue number of start. If null, defaults to the chain start.pdbresnumEnd- PDB residue number of end. If null, defaults to the chain end.- Returns:
- Groups in between. or throws a StructureException if either start or end can not be found,
- Throws:
StructureException
-
getGroupsByPDB
Group[] getGroupsByPDB(ResidueNumber pdbresnumStart, ResidueNumber pdbresnumEnd, boolean ignoreMissing) throws StructureException Get all groups that are located between two PDB residue numbers. In contrast to getGroupsByPDB this method call ignores if the exact outer groups are not found. This is useful e.g. when requesting the range of groups as specified by the DBREF records - these frequently are rather inaccurate.- Parameters:
pdbresnumStart- PDB residue number of start. If null, defaults to the chain start.pdbresnumEnd- PDB residue number of end. If null, defaults to the chain end.ignoreMissing- ignore missing groups in this range.- Returns:
- Groups in between. or throws a StructureException if either start or end can not be found,
- Throws:
StructureException
-
getAtomLength
int getAtomLength()Returns the number of Groups with observed density in the chain, i.e. those with coordinates in ATOM and HETATMs (including waters) records- Returns:
- the length
- See Also:
-
getSeqResLength
int getSeqResLength()Returns the number of groups in the SEQRES records of the chain, i.e. the number of aminoacids/nucleotides in the construct- Returns:
- the length
- See Also:
-
setEntityInfo
Sets the Entity information- Parameters:
entityInfo- the EntityInfo- See Also:
-
getEntityInfo
EntityInfo getEntityInfo()Returns the EntityInfo for this chain.- Returns:
- the EntityInfo object
- See Also:
-
setChainID
Deprecated.usesetId(String asymId)insteadSets the 'private' asymId of this chain (Chain id in PDB file ).- Parameters:
asymId- a String specifying the name value- See Also:
-
getChainID
Deprecated.use getId() insteadGets the 'private' asymId of this chain.- Returns:
- a String representing the name value
- See Also:
-
getInternalChainID
String getInternalChainID()Deprecated.usegetId()insteadIf available, returns the internal chain ID that is used in mmCIF files (asym_id), otherwise null- Returns:
- String or null
- Since:
- 3.0.5
-
setInternalChainID
Deprecated.use#setId()insteadSets the internal chain ID that is used in mmCif files- Parameters:
internalChainID-- Since:
- 3.0.5
-
toString
String toString() -
getBJSequence
Sequence<?> getBJSequence()Converts the SEQRES groups of a Chain to a Biojava Sequence object.- Returns:
- the SEQRES groups of the Chain as a Sequence object.
-
getAtomSequence
String getAtomSequence()Returns the sequence of amino acids as it has been provided in the ATOM records. Non-standard residues will be present in the string only if the property has been set.- Returns:
- amino acid sequence as string
- See Also:
-
getSeqResSequence
String getSeqResSequence()Returns the PDB SEQRES sequence as a one-letter sequence string. Non-standard residues are represented by an "X".- Returns:
- one-letter PDB SEQRES sequence as string
- See Also:
-
setSwissprotId
Sets the Swissprot id of this chain.- Parameters:
sp_id- a String specifying the swissprot id value- See Also:
-
getSwissprotId
String getSwissprotId()Gets the Swissprot id of this chain.- Returns:
- a String representing the swissprot id value
- See Also:
-
getSeqResGroups
Returns a List of all SEQRES groups of a special type, one of:GroupType.AMINOACID,GroupType.HETATMorGroupType.NUCLEOTIDE.- Parameters:
type- a GroupType- Returns:
- an List object
- See Also:
-
getSeqResGroups
Returns a list of all groups in SEQRES records of the chain, i.e. the aminoacids/nucleotides in the construct.- Returns:
- a List of all Group objects of this chain
- See Also:
-
setSeqResGroups
Sets the list of SeqResGroups for this chain.- Parameters:
seqResGroups- a List of Group objects that from the SEQRES groups of this chain.- See Also:
-
setParent
Deprecated.use setStructure insteadSets the back-reference to its parent Structure.- Parameters:
parent- the parent Structure object for this Chain- See Also:
-
setStructure
Sets the back-reference to its parent Structure.- Parameters:
parent-
-
getParent
Deprecated.use getStructure(Structure) instead.Returns the parent Structure of this chain.- Returns:
- the parent Structure object
- See Also:
-
getStructure
Structure getStructure()Returns the parent Structure of this chain.- Returns:
- the parent Structure object
- See Also:
-
getAtomLigands
Deprecated.since biojava 5.0 this does not apply anymore. Chains contain either polymeric groups or non-polymeric groupsGets all groups that are not polymer groups and that are not solvent groups. Will automatically fetch Chemical Component files from the PDB web site, even ifFileParsingParameters#setLoadChemCompInfo(boolean)has not been set to true. Otherwise the Ligands could not correctly be identified.- Returns:
- list of Groups that are ligands
-
toPDB
String toPDB()Convert this Chain to a String in PDB format- Returns:
-
toMMCIF
String toMMCIF()Convert this Chain to a String in mmCIF format- Returns:
-
setSeqMisMatches
Sets annotated sequence mismatches for this chain. This is based on the STRUCT_REF_SEQ_DIF mmCif category- Parameters:
seqMisMatches-
-
getSeqMisMatches
List<SeqMisMatch> getSeqMisMatches()Gets annotated sequence mismatches for this chain. This is based on the STRUCT_REF_SEQ_DIF mmCif category -
getEntityType
EntityType getEntityType()Returns the EntityType of this chain. Equivalent to getEntityInfo().getType()- Returns:
- See Also:
-
isWaterOnly
boolean isWaterOnly()Tests if a chain is consisting of water molecules only- Returns:
- true if there are only solvent molecules in this chain.
-
isPureNonPolymer
boolean isPureNonPolymer()Returns true if the given chain is composed of non-polymeric (including water) groups only.- Returns:
- true if only non-polymeric groups in this chain.
-
getPredominantGroupType
GroupType getPredominantGroupType()Get the predominantGroupTypefor a given Chain, following these rules:- if the ratio of number of residues of a certain
GroupTypeto total non-water residues is above the threshold {@value #org.biojava.nbio.structure.StructureTools.RATIO_RESIDUES_TO_TOTAL}, then thatGroupTypeis returned- if there is no
GroupTypethat is above the threshold then theGroupTypewith most members is chosen, logging itSee also
ChemComp.getPolymerType()andChemComp.getResidueType()which follow the PDB chemical component dictionary and provide a much more accurate description of groups and their linking.- Returns:
- if the ratio of number of residues of a certain
-
isProtein
boolean isProtein()Tell whether given chain is a protein chain- Returns:
- true if protein, false if nucleotide or ligand
- See Also:
-
isNucleicAcid
boolean isNucleicAcid()Tell whether given chain is DNA or RNA- Returns:
- true if nucleic acid, false if protein or ligand
- See Also:
-