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:
-
Constructor Summary
Constructors -
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.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.Returns 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 start, ResidueNumber end) Get all groups that are located between two PDB residue numbers.Group[]getGroupsByPDB(ResidueNumber start, ResidueNumber end, 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.getName()Get the 'public' authId (chain ID in PDB file)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 0.95, 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.Get the one letter sequence so that Sequence is guaranteed to be the same length as seqResGroups.Returns the PDB SEQRES sequence as a one-letter sequence string.Returns the parent Structure 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.voidsetEntityInfo(EntityInfo mol) Sets the Entity informationvoidSet the 'private' asymId (internal chain IDs in mmCif) for this chain.voidSet the 'public' authId (chain ID in PDB file)voidsetSeqMisMatches(List<SeqMisMatch> seqMisMatches) Sets annotated sequence mismatches for this chain.voidsetSeqResGroups(List<Group> groups) Sets the list of SeqResGroups for this chain.voidsetStructure(Structure parent) Sets the back-reference to its parent Structure.toMMCIF()Convert this Chain to a String in mmCIF formattoPDB()Convert this Chain to a String in PDB formattoString()
-
Constructor Details
-
ChainImpl
public ChainImpl()Constructs a ChainImpl object.
-
-
Method Details
-
getId
Description copied from interface:ChainGet the 'private' asymId (internal chain IDs in mmCif) for this chain. -
setId
Description copied from interface:ChainSet the 'private' asymId (internal chain IDs in mmCif) for this chain. -
getName
Description copied from interface:ChainGet the 'public' authId (chain ID in PDB file) -
setName
Description copied from interface:ChainSet the 'public' authId (chain ID in PDB file) -
setStructure
Description copied from interface:ChainSets the back-reference to its parent Structure.- Specified by:
setStructurein interfaceChain- Parameters:
parent-
-
getStructure
Description copied from interface:ChainReturns the parent Structure of this chain.- Specified by:
getStructurein interfaceChain- Returns:
- the parent Structure object
- See Also:
-
clone
Description copied from interface:ChainReturns an identical copy of this Chain. -
setEntityInfo
Description copied from interface:ChainSets the Entity information- Specified by:
setEntityInfoin interfaceChain- Parameters:
mol- the EntityInfo- See Also:
-
getEntityInfo
Description copied from interface:ChainReturns the EntityInfo for this chain.- Specified by:
getEntityInfoin interfaceChain- Returns:
- the EntityInfo object
- See Also:
-
addGroup
Description copied from interface:ChainAdd 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
Description copied from interface:ChainReturn 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:
getAtomGroupin interfaceChain- Parameters:
position- an int- Returns:
- a Group object
- See Also:
-
getAtomGroups
Description copied from interface:ChainReturn 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.- Specified by:
getAtomGroupsin interfaceChain- Parameters:
type- GroupType- Returns:
- a List object
- See Also:
-
getAtomGroups
Description copied from interface:ChainReturn all Groups with observed density in the chain, i.e. those with coordinates in ATOM and HETATMS (including waters) records.- Specified by:
getAtomGroupsin interfaceChain- Returns:
- a List object representing the Groups of this Chain.
- See Also:
-
setAtomGroups
Description copied from interface:ChainSet all Groups with observed density in the chain, i.e. those with coordinates in ATOM and HETATMs (including waters) records.- Specified by:
setAtomGroupsin interfaceChain- Parameters:
groups- a List object representing the Groups of this Chain.- See Also:
-
getGroupsByPDB
public Group[] getGroupsByPDB(ResidueNumber start, ResidueNumber end, boolean ignoreMissing) throws StructureException Description copied from interface:ChainGet 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:
getGroupsByPDBin interfaceChain- Parameters:
start- PDB residue number of start. If null, defaults to the chain start.end- 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
-
getGroupByPDB
Description copied from interface:ChainGet a group by its PDB residue numbering. If the PDB residue number is not known, throws a StructureException.- Specified by:
getGroupByPDBin interfaceChain- Parameters:
resNum- the PDB residue number of the group- Returns:
- the matching group
- Throws:
StructureException
-
getGroupsByPDB
Description copied from interface:ChainGet all groups that are located between two PDB residue numbers.- Specified by:
getGroupsByPDBin interfaceChain- Parameters:
start- PDB residue number of start. If null, defaults to the chain start.end- 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
-
getSeqResLength
Description copied from interface:ChainReturns the number of groups in the SEQRES records of the chain, i.e. the number of aminoacids/nucleotides in the construct- Specified by:
getSeqResLengthin interfaceChain- Returns:
- the length
- See Also:
-
toString
-
getBJSequence
Description copied from interface:ChainConverts the SEQRES groups of a Chain to a Biojava Sequence object.- Specified by:
getBJSequencein interfaceChain- Returns:
- the SEQRES groups of the Chain as a Sequence object.
-
getAtomSequence
Description copied from interface:ChainReturns the sequence of amino acids as it has been provided in the ATOM records.- Specified by:
getAtomSequencein interfaceChain- Returns:
- amino acid sequence as string
- See Also:
-
getSeqResSequence
Description copied from interface:ChainReturns the PDB SEQRES sequence as a one-letter sequence string. Non-standard residues are represented by an "X".- Specified by:
getSeqResSequencein interfaceChain- Returns:
- one-letter PDB SEQRES sequence as string
- See Also:
-
getSeqResOneLetterSeq
Get the one letter sequence so that Sequence is guaranteed to be the same length as seqResGroups. Method related to https://github.com/biojava/biojava/issues/457- Returns:
- a string of the sequence guaranteed to be the same length as seqResGroups.
-
getSeqResGroup
Description copied from interface:ChainReturn 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:
getSeqResGroupin interfaceChain- Parameters:
position- an int- Returns:
- a Group object
- See Also:
-
getSeqResGroups
Description copied from interface:ChainReturns a List of all SEQRES groups of a special type, one of:GroupType.AMINOACID,GroupType.HETATMorGroupType.NUCLEOTIDE.- Specified by:
getSeqResGroupsin interfaceChain- Parameters:
type- a GroupType- Returns:
- an List object
- See Also:
-
getSeqResGroups
Description copied from interface:ChainReturns a list of all groups in SEQRES records of the chain, i.e. the aminoacids/nucleotides in the construct.- Specified by:
getSeqResGroupsin interfaceChain- Returns:
- a List of all Group objects of this chain
- See Also:
-
setSeqResGroups
Description copied from interface:ChainSets the list of SeqResGroups for this chain.- Specified by:
setSeqResGroupsin interfaceChain- Parameters:
groups- a List of Group objects that from the SEQRES groups of this chain.- See Also:
-
getAtomLength
Description copied from interface:ChainReturns the number of Groups with observed density in the chain, i.e. those with coordinates in ATOM and HETATMs (including waters) records- Specified by:
getAtomLengthin interfaceChain- Returns:
- the length
- See Also:
-
toPDB
Description copied from interface:ChainConvert this Chain to a String in PDB format -
toMMCIF
Description copied from interface:ChainConvert this Chain to a String in mmCIF format -
setSeqMisMatches
Description copied from interface:ChainSets annotated sequence mismatches for this chain. This is based on the STRUCT_REF_SEQ_DIF mmCif category- Specified by:
setSeqMisMatchesin interfaceChain- Parameters:
seqMisMatches-
-
getSeqMisMatches
Description copied from interface:ChainGets annotated sequence mismatches for this chain. This is based on the STRUCT_REF_SEQ_DIF mmCif category- Specified by:
getSeqMisMatchesin interfaceChain- Returns:
- a list of sequence mismatches (or null if none found)
-
getEntityType
Description copied from interface:ChainReturns the EntityType of this chain. Equivalent to getEntityInfo().getType()- Specified by:
getEntityTypein interfaceChain- Returns:
- See Also:
-
isWaterOnly
Description copied from interface:ChainTests if a chain is consisting of water molecules only- Specified by:
isWaterOnlyin interfaceChain- Returns:
- true if there are only solvent molecules in this chain.
-
isPureNonPolymer
Description copied from interface:ChainReturns true if the given chain is composed of non-polymeric (including water) groups only.- Specified by:
isPureNonPolymerin interfaceChain- Returns:
- true if only non-polymeric groups in this chain.
-
getPredominantGroupType
Description copied from interface:ChainGet 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 0.95, then thatGroupTypeis returned - if there is no
GroupTypethat is above the threshold then theGroupTypewith most members is chosen, logging it
See also
ChemComp.getPolymerType()andChemComp.getResidueType()which follow the PDB chemical component dictionary and provide a much more accurate description of groups and their linking.- Specified by:
getPredominantGroupTypein interfaceChain- Returns:
- the predominant group type
- if the ratio of number of residues of a certain
-
isProtein
Description copied from interface:ChainTell whether given chain is a protein chain -
isNucleicAcid
Description copied from interface:ChainTell whether given chain is DNA or RNA- Specified by:
isNucleicAcidin interfaceChain- Returns:
- true if nucleic acid, false if protein or ligand
- See Also:
-