Package org.biojava.nbio.structure
Class ChainImpl
java.lang.Object
org.biojava.nbio.structure.ChainImpl
- All Implemented Interfaces:
Serializable
,Chain
A Chain in a PDB file. It contains several groups which can be of
one of the types defined in the
GroupType
constants.- Since:
- 1.4
- Author:
- Andreas Prlic, Jules Jacobsen
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic String
The default chain identifier used to be an empty space -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add a group to the list of ATOM record group of this chain.protected void
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.HETATM
orGroupType.NUCLEOTIDE
.int
Returns the number of Groups with observed density in the chain, i.e.Gets all groups that are not polymer groups and that are not solvent groups.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.Gets the name of this chain (Chain id in PDB file ).Returns the Compound for this chain.getGroupByPDB
(ResidueNumber resNum) Get a group by its PDB residue numbering.Group[]
getGroupsByPDB
(ResidueNumber start, ResidueNumber end) Get all groups that are located between two PDB residue numbers.Group[]
getGroupsByPDB
(ResidueNumber start, ResidueNumber end, boolean ignoreMissing) Deprecated.getId()
Get the ID used by Hibernate.If available, returns the internal chain ID that is used in mmCIF files (asym_id), otherwise nullDeprecated.use getStructure instead.Get 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.HETATM
orGroupType.NUCLEOTIDE
.int
Returns 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.get the Swissprot id of this chains .void
setAtomGroups
(List<Group> groups) Set all Groups with observed density in the chain, i.e.void
setChainID
(String nam) Sets the name of this chain (Chain id in PDB file ).void
setCompound
(Compound mol) Sets the Compoundvoid
Set the ID used by Hibernate.void
setInternalChainID
(String internalChainID) Sets the internal chain ID that is used in mmCif filesvoid
Deprecated.void
setSeqMisMatches
(List<SeqMisMatch> seqMisMatches) Set annotated sequence mismatches for this chain.void
setSeqResGroups
(List<Group> groups) Sets the list of SeqResGroups for this chain.void
setStructure
(Structure parent) Sets the back-reference to its parent Structure.void
setSwissprotId
(String sp_id) set the Swissprot id of this chains .toMMCIF()
Convert this Chain to a String in mmCIF formattoPDB()
Convert this Chain to a String in PDB formattoString()
String representation.
-
Field Details
-
DEFAULT_CHAIN_ID
The default chain identifier used to be an empty space
-
-
Constructor Details
-
ChainImpl
public ChainImpl()Constructs a ChainImpl object.
-
-
Method Details
-
getId
Get the ID used by Hibernate. -
setId
Set the ID used by Hibernate. -
setParent
Deprecated.Sets the back-reference to its parent Structure. -
setStructure
Sets the back-reference to its parent Structure.- Specified by:
setStructure
in interfaceChain
-
getStructure
Returns the parent Structure of this chain.- Specified by:
getStructure
in interfaceChain
- Returns:
- the parent Structure object
- See Also:
-
getParent
Deprecated.use getStructure instead.Returns the parent Structure of this chain. -
clone
Returns an identical copy of this Chain . -
setCompound
Sets the Compound- Specified by:
setCompound
in interfaceChain
- Parameters:
mol
- the Compound- See Also:
-
getCompound
Returns the Compound for this chain.- Specified by:
getCompound
in interfaceChain
- Returns:
- the Compound object
- See Also:
-
setSwissprotId
set the Swissprot id of this chains .- Specified by:
setSwissprotId
in interfaceChain
- Parameters:
sp_id
- a String specifying the swissprot id value- See Also:
-
getSwissprotId
get the Swissprot id of this chains .- Specified by:
getSwissprotId
in interfaceChain
- Returns:
- a String representing the swissprot id value
- See Also:
-
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. -
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.- Specified by:
getAtomGroup
in interfaceChain
- Parameters:
position
- an int- Returns:
- a Group object
- See Also:
-
getAtomGroups
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
.- Specified by:
getAtomGroups
in interfaceChain
- Parameters:
type
- GroupType- Returns:
- a List 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.- Specified by:
getAtomGroups
in interfaceChain
- 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.- Specified by:
setAtomGroups
in interfaceChain
- Parameters:
groups
- a List object representing the Groups of this Chain.- See Also:
-
getGroupsByPDB
@Deprecated public Group[] getGroupsByPDB(ResidueNumber start, ResidueNumber end, boolean ignoreMissing) throws StructureException Deprecated.Description copied from interface:Chain
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.- Specified by:
getGroupsByPDB
in interfaceChain
- Parameters:
start
- PDB residue number of startend
- 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
-
getGroupByPDB
Get a group by its PDB residue numbering. If the PDB residue number is not known, throws a StructureException.- Specified by:
getGroupByPDB
in interfaceChain
- Parameters:
resNum
- the PDB residue number of the group- Returns:
- the matching group
- Throws:
StructureException
-
getGroupsByPDB
Get all groups that are located between two PDB residue numbers.- Specified by:
getGroupsByPDB
in interfaceChain
- Parameters:
start
- PDB residue number of startend
- PDB residue number of end- Returns:
- Groups in between. or throws a StructureException if either start or end can not be found,
- Throws:
StructureException
-
getSeqResLength
public int getSeqResLength()Returns the number of groups in the SEQRES records of the chain, i.e. the number of aminoacids/nucleotides in the construct- Specified by:
getSeqResLength
in interfaceChain
- Returns:
- the length
- See Also:
-
setChainID
Sets the name of this chain (Chain id in PDB file ).- Specified by:
setChainID
in interfaceChain
- Parameters:
nam
- a String specifying the name value- See Also:
-
getChainID
Gets the name of this chain (Chain id in PDB file ).- Specified by:
getChainID
in interfaceChain
- Returns:
- a String representing the name value
- See Also:
-
toString
String representation. -
getBJSequence
Converts the SEQRES groups of a Chain to a Biojava Sequence object.- Specified by:
getBJSequence
in interfaceChain
- Returns:
- the SEQRES groups of the Chain as a Sequence object.
-
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.- Specified by:
getAtomSequence
in interfaceChain
- Returns:
- amino acid sequence as string
- See Also:
-
getSeqResSequence
Returns the PDB SEQRES sequence as a one-letter sequence string. Non-standard residues are represented by an "X".- Specified by:
getSeqResSequence
in interfaceChain
- Returns:
- one-letter PDB SEQRES sequence as string
- 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.- Specified by:
getSeqResGroup
in interfaceChain
- Parameters:
position
- an int- Returns:
- a Group object
- See Also:
-
getSeqResGroups
Returns a List of all SEQRES groups of a special type, one of:GroupType.AMINOACID
,GroupType.HETATM
orGroupType.NUCLEOTIDE
.- Specified by:
getSeqResGroups
in interfaceChain
- 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.- Specified by:
getSeqResGroups
in interfaceChain
- Returns:
- a List of all Group objects of this chain
- See Also:
-
setSeqResGroups
Sets the list of SeqResGroups for this chain.- Specified by:
setSeqResGroups
in interfaceChain
- Parameters:
groups
- a List of Group objects that from the SEQRES groups of this chain.- See Also:
-
addSeqResGroup
-
getAtomLength
public 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- Specified by:
getAtomLength
in interfaceChain
- Returns:
- the length
- See Also:
-
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.- Specified by:
getAtomLigands
in interfaceChain
- Returns:
- list of Groups that are ligands
-
getInternalChainID
Description copied from interface:Chain
If available, returns the internal chain ID that is used in mmCIF files (asym_id), otherwise null- Specified by:
getInternalChainID
in interfaceChain
- Returns:
- String or null
-
setInternalChainID
Description copied from interface:Chain
Sets the internal chain ID that is used in mmCif files- Specified by:
setInternalChainID
in interfaceChain
-
toPDB
Description copied from interface:Chain
Convert this Chain to a String in PDB format -
toMMCIF
Description copied from interface:Chain
Convert this Chain to a String in mmCIF format -
setSeqMisMatches
Description copied from interface:Chain
Set annotated sequence mismatches for this chain. This is based on the STRUCT_REF_SEQ_DIF mmCif category- Specified by:
setSeqMisMatches
in interfaceChain
-
getSeqMisMatches
Description copied from interface:Chain
Get annotated sequence mismatches for this chain. This is based on the STRUCT_REF_SEQ_DIF mmCif category- Specified by:
getSeqMisMatches
in interfaceChain
-