Package org.biojava.nbio.structure
Interface Chain
-
- All Known Implementing Classes:
ChainImpl
public interface Chain
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 anAminoAcid
,Hetatom
orNucleotide
.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 viagetAtomGroups()
. Groups that have been observed (i.e. they are in the ATOM records) can be detected byGroup
.has3D()- Since:
- 1.4
- Version:
- %I% %G%
- Author:
- Andreas Prlic
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addGroup(Group group)
add a group to the list of ATOM record group of this chain.java.lang.Object
clone()
returns an identical copy of this Chain.Group
getAtomGroup(int position)
Return the Group at given position, from within Groups with observed density in the chain, i.e.java.util.List<Group>
getAtomGroups()
Return all Groups with observed density in the chain, i.e.java.util.List<Group>
getAtomGroups(GroupType type)
Return a List of all (observed) Groups of a special type, one of:GroupType.AMINOACID
,GroupType.HETATM
orGroupType.NUCLEOTIDE
.int
getAtomLength()
Returns the number of Groups with observed density in the chain, i.e.java.util.List<Group>
getAtomLigands()
Gets all groups that are not polymer groups and that are not solvent groups.java.lang.String
getAtomSequence()
Returns the sequence of amino acids as it has been provided in the ATOM records.Sequence<?>
getBJSequence()
Converts the SEQRES groups of a Chain to a Biojava Sequence object.java.lang.String
getChainID()
Gets the name of this chain (Chain id in PDB file ).Compound
getCompound()
Returns the Compound for this chain.Group
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.java.lang.Long
getId()
Get the ID used by Hibernate.java.lang.String
getInternalChainID()
If available, returns the internal chain ID that is used in mmCIF files (asym_id), otherwise nullStructure
getParent()
Deprecated.use getStructure(Structure) instead.java.util.List<SeqMisMatch>
getSeqMisMatches()
Get annotated sequence mismatches for this chain.Group
getSeqResGroup(int position)
Return the Group at given position, from within groups in the SEQRES records of the chain, i.e.java.util.List<Group>
getSeqResGroups()
Returns a list of all groups in SEQRES records of the chain, i.e.java.util.List<Group>
getSeqResGroups(GroupType type)
Returns a List of all SEQRES groups of a special type, one of:GroupType.AMINOACID
,GroupType.HETATM
orGroupType.NUCLEOTIDE
.int
getSeqResLength()
Returns the number of groups in the SEQRES records of the chain, i.e.java.lang.String
getSeqResSequence()
Returns the PDB SEQRES sequence as a one-letter sequence string.Structure
getStructure()
Returns the parent Structure of this chain.java.lang.String
getSwissprotId()
Gets the Swissprot id of this chain.void
setAtomGroups(java.util.List<Group> groups)
Set all Groups with observed density in the chain, i.e.void
setChainID(java.lang.String name)
Sets the name of this chain (Chain id in PDB file ).void
setCompound(Compound compound)
Sets the Compoundvoid
setId(java.lang.Long id)
Set the ID used by Hibernate.void
setInternalChainID(java.lang.String internalChainID)
Sets the internal chain ID that is used in mmCif filesvoid
setParent(Structure parent)
Deprecated.use setStructure insteadvoid
setSeqMisMatches(java.util.List<SeqMisMatch> seqMisMatches)
Set annotated sequence mismatches for this chain.void
setSeqResGroups(java.util.List<Group> seqResGroups)
Sets the list of SeqResGroups for this chain.void
setStructure(Structure parent)
Sets the back-reference to its parent Structure.void
setSwissprotId(java.lang.String sp_id)
Sets the Swissprot id of this chain.java.lang.String
toMMCIF()
Convert this Chain to a String in mmCIF formatjava.lang.String
toPDB()
Convert this Chain to a String in PDB formatjava.lang.String
toString()
-
-
-
Method Detail
-
clone
java.lang.Object clone()
returns an identical copy of this Chain.- Returns:
- an identical copy of this Chain
-
addGroup
void addGroup(Group group)
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
java.lang.Long getId()
Get the ID used by Hibernate.- Returns:
- the ID used by Hibernate
- See Also:
setId(Long)
-
setId
void setId(java.lang.Long id)
Set the ID used by Hibernate.- Parameters:
id
- assigned by Hibernate- See Also:
getId()
-
getAtomGroup
Group getAtomGroup(int position)
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:
getAtomLength()
,getAtomGroups()
,getSeqResGroup(int)
-
getSeqResGroup
Group getSeqResGroup(int position)
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:
getSeqResLength()
,getSeqResGroups()
,getAtomGroup(int)
-
getAtomGroups
java.util.List<Group> 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(List)
,getAtomLength()
,getSeqResGroups()
-
setAtomGroups
void setAtomGroups(java.util.List<Group> groups)
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()
-
getAtomGroups
java.util.List<Group> getAtomGroups(GroupType type)
Return a List of all (observed) Groups of a special type, one of:GroupType.AMINOACID
,GroupType.HETATM
orGroupType.NUCLEOTIDE
. Note that if a standard aminoacid appears as a HETATM (because it is part of a ligand) then it is still considered asGroupType.AMINOACID
and not asGroupType.HETATM
.- Parameters:
type
- GroupType- Returns:
- a List object
- See Also:
setAtomGroups(List)
-
getGroupByPDB
Group getGroupByPDB(ResidueNumber resNum) throws StructureException
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 startpdbresnumEnd
- PDB residue number of 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 startpdbresnumEnd
- PDB residue number of endignoreMissing
- 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:
getAtomGroup(int)
,getAtomGroups()
-
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:
getSeqResGroup(int)
,getSeqResGroups()
,getAtomLength()
-
setCompound
void setCompound(Compound compound)
Sets the Compound- Parameters:
compound
- the Compound- See Also:
getCompound()
-
getCompound
Compound getCompound()
Returns the Compound for this chain.- Returns:
- the Compound object
- See Also:
setCompound(Compound)
-
setChainID
void setChainID(java.lang.String name)
Sets the name of this chain (Chain id in PDB file ).- Parameters:
name
- a String specifying the name value- See Also:
getChainID()
-
getChainID
java.lang.String getChainID()
Gets the name of this chain (Chain id in PDB file ).- Returns:
- a String representing the name value
- See Also:
setChainID(String)
-
getInternalChainID
java.lang.String getInternalChainID()
If 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
void setInternalChainID(java.lang.String internalChainID)
Sets the internal chain ID that is used in mmCif files- Parameters:
internalChainID
-- Since:
- 3.0.5
-
toString
java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
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
java.lang.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()
-
getSeqResSequence
java.lang.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:
getAtomSequence()
-
setSwissprotId
void setSwissprotId(java.lang.String sp_id)
Sets the Swissprot id of this chain.- Parameters:
sp_id
- a String specifying the swissprot id value- See Also:
getSwissprotId()
-
getSwissprotId
java.lang.String getSwissprotId()
Gets the Swissprot id of this chain.- Returns:
- a String representing the swissprot id value
- See Also:
setSwissprotId(String sp_id)
-
getSeqResGroups
java.util.List<Group> getSeqResGroups(GroupType type)
Returns a List of all SEQRES groups of a special type, one of:GroupType.AMINOACID
,GroupType.HETATM
orGroupType.NUCLEOTIDE
.- Parameters:
type
- a GroupType- Returns:
- an List object
- See Also:
setSeqResGroups(List)
-
getSeqResGroups
java.util.List<Group> 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(List)
,getSeqResLength()
,getAtomGroups()
-
setSeqResGroups
void setSeqResGroups(java.util.List<Group> seqResGroups)
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:
getSeqResGroups()
-
setParent
@Deprecated void setParent(Structure parent)
Deprecated.use setStructure insteadSets the back-reference to its parent Structure.- Parameters:
parent
- the parent Structure object for this Chain- See Also:
getStructure()
-
setStructure
void setStructure(Structure parent)
Sets the back-reference to its parent Structure.- Parameters:
parent
-
-
getParent
@Deprecated Structure getParent()
Deprecated.use getStructure(Structure) instead.Returns the parent Structure of this chain.- Returns:
- the parent Structure object
- See Also:
setStructure(Structure)
-
getStructure
Structure getStructure()
Returns the parent Structure of this chain.- Returns:
- the parent Structure object
- See Also:
setStructure(Structure)
-
getAtomLigands
java.util.List<Group> getAtomLigands()
Gets 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
java.lang.String toPDB()
Convert this Chain to a String in PDB format- Returns:
-
toMMCIF
java.lang.String toMMCIF()
Convert this Chain to a String in mmCIF format- Returns:
-
setSeqMisMatches
void setSeqMisMatches(java.util.List<SeqMisMatch> seqMisMatches)
Set annotated sequence mismatches for this chain. This is based on the STRUCT_REF_SEQ_DIF mmCif category- Parameters:
seqMisMatches
-
-
getSeqMisMatches
java.util.List<SeqMisMatch> getSeqMisMatches()
Get annotated sequence mismatches for this chain. This is based on the STRUCT_REF_SEQ_DIF mmCif category
-
-