Package org.biojava.bio.structure
Class ChainImpl
- java.lang.Object
-
- org.biojava.bio.structure.ChainImpl
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_CHAIN_ID
The default chain identifier is an empty space.
-
Constructor Summary
Constructors Constructor Description ChainImpl()
Constructs a ChainImpl object.
-
Method Summary
All Methods Instance Methods Concrete 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 .Annotation
getAnnotation()
get/set the Annotation of a Chain.Group
getAtomGroup(int position)
return the group at position .java.util.List<Group>
getAtomGroups()
Return all groups that have been specified in the ATOM section of this chain .java.util.List<Group>
getAtomGroups(java.lang.String type)
Get the Groups of a certain type, that are listed int the ATOM records of the PDB file.int
getAtomLength()
Return the number of Groups in the ATOM records of the chain.java.lang.String
getAtomSequence()
Return the sequence of amino acids as it has been provided in the ATOM records.Sequence
getBJSequence()
Convert the SEQRES groups of a Chain to a Biojava Sequence object.Group
getGroup(int position)
Deprecated.use getAtomGroup or getSeqResGroup insteadGroup
getGroupByPDB(java.lang.String pdbresnum)
get a group by its PDB residue numbering.java.util.List<Group>
getGroups()
Deprecated.use getAtomGroups insteadjava.util.List<Group>
getGroups(java.lang.String type)
Deprecated.use getAtomGroups insteadGroup[]
getGroupsByPDB(java.lang.String pdbresnumStart, java.lang.String pdbresnumEnd)
Get all groups that are located between two PDB residue numbers.Group[]
getGroupsByPDB(java.lang.String pdbresnumStart, java.lang.String pdbresnumEnd, boolean ignoreMissing)
Get all groups that are located between two PDB residue numbers.Compound
getHeader()
Returns the Header ( a Compound object) for this chain.java.lang.Long
getId()
Get the ID used by Hibernate.int
getLength()
Deprecated.use getAtomLength insteadint
getLengthAminos()
returns the length of the AminoAcids in the ATOM records of this chain.java.lang.String
getName()
get and set the name of this chain (Chain id in PDB file ).Structure
getParent()
Returns the parent Structure of this chain.Group
getSeqResGroup(int position)
return the Group at position X.java.util.List<Group>
getSeqResGroups()
Return all groups of this chain.java.util.List<Group>
getSeqResGroups(java.lang.String type)
Return a List of all groups of a special type (e.g.int
getSeqResLength()
Returns the number of groups in the SEQRES records of the chain.java.lang.String
getSeqResSequence()
Get the sequence for all amino acids as it is specified in the SEQRES residues.java.lang.String
getSequence()
Deprecated.use getAtomSequence insteadjava.lang.String
getSwissprotId()
get the Swissprot id of this chains .void
setAnnotation(Annotation anno)
get/set the Annotation of a Chain.void
setAtomGroups(java.util.List<Group> groups)
Set all groups that have been specified in the ATOM section of this chain .void
setHeader(Compound mol)
Set the Header from the PDB file.void
setId(java.lang.Long id)
Set the ID used by Hibernate.void
setName(java.lang.String nam)
get and set the name of this chain (Chain id in PDB file ).void
setParent(Structure parent)
Set the back-reference to its parent Structure.void
setSeqResGroups(java.util.List<Group> groups)
Set the list of SeqResGroups for this chain.void
setSwissprotId(java.lang.String sp_id)
set the Swissprot id of this chains .java.lang.String
toString()
String representation.
-
-
-
Method Detail
-
getId
public java.lang.Long getId()
Get the ID used by Hibernate.- Specified by:
getId
in interfaceChain
- Returns:
- the ID used by Hibernate
- See Also:
Chain.setId(Long)
-
setId
public void setId(java.lang.Long id)
Set the ID used by Hibernate.- Specified by:
setId
in interfaceChain
- Parameters:
id
- assigned by Hibernate- See Also:
Chain.getId()
-
setParent
public void setParent(Structure parent)
Set the back-reference to its parent Structure.- Specified by:
setParent
in interfaceChain
- Parameters:
parent
- the parent Structure object for this Chain- See Also:
Chain.getParent()
-
getParent
public Structure getParent()
Returns the parent Structure of this chain.- Specified by:
getParent
in interfaceChain
- Returns:
- the parent Structure object
- See Also:
Chain.setParent(Structure)
-
clone
public java.lang.Object clone()
Returns an identical copy of this Chain .
-
setAnnotation
public void setAnnotation(Annotation anno)
get/set the Annotation of a Chain. allows to annotate a protein chain, e.g. molecule description "AZURIN" for pdb 1a4a.A- Specified by:
setAnnotation
in interfaceChain
- Parameters:
anno
- the Annotation to be provided.- See Also:
Chain.getAnnotation()
-
getAnnotation
public Annotation getAnnotation()
get/set the Annotation of a Chain. allows to annotate a protein chain, e.g. molecule description "AZURIN" for pdb 1a4a.A- Specified by:
getAnnotation
in interfaceChain
- Returns:
- the Annotation of this chain
- See Also:
Chain.setAnnotation(Annotation)
-
setHeader
public void setHeader(Compound mol)
Set the Header from the PDB file.- Specified by:
setHeader
in interfaceChain
- Parameters:
mol
- the Compound that contains the header information for this chain- See Also:
Chain.getHeader()
-
getHeader
public Compound getHeader()
Returns the Header ( a Compound object) for this chain.- Specified by:
getHeader
in interfaceChain
- Returns:
- the Compound object that contains the Header information
- See Also:
Chain.setHeader(Compound)
-
setSwissprotId
public void setSwissprotId(java.lang.String sp_id)
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()
-
getSwissprotId
public java.lang.String getSwissprotId()
get the Swissprot id of this chains .- Specified by:
getSwissprotId
in interfaceChain
- Returns:
- a String representing the swissprot id value
- See Also:
setSwissprotId(java.lang.String)
-
addGroup
public 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.
-
getGroup
public Group getGroup(int position)
Deprecated.use getAtomGroup or getSeqResGroup insteadreturn the group at position .- Specified by:
getGroup
in interfaceChain
- Parameters:
position
- an int- Returns:
- a Group object
- See Also:
Chain.getAtomGroup(int)
,Chain.getSeqResGroup(int)
-
getAtomGroup
public Group getAtomGroup(int position)
return the group at position .- Specified by:
getAtomGroup
in interfaceChain
- Parameters:
position
- an int- Returns:
- a Group object
-
getGroups
public java.util.List<Group> getGroups(java.lang.String type)
Deprecated.use getAtomGroups insteadReturn a list of all groups of one of the types defined in hteGroupType
constants.
-
getAtomGroups
public java.util.List<Group> getAtomGroups(java.lang.String type)
Get the Groups of a certain type, that are listed int the ATOM records of the PDB file.- Specified by:
getAtomGroups
in interfaceChain
- Parameters:
type
- the type of the groups to return. Can be one of the 3 types defined in theGroupType
constants- Returns:
- a list of group objects
- See Also:
Chain.setAtomGroups(List)
-
getGroups
public java.util.List<Group> getGroups()
Deprecated.use getAtomGroups insteadreturn all groups of this chain .
-
getAtomGroups
public java.util.List<Group> getAtomGroups()
Return all groups that have been specified in the ATOM section of this chain .- Specified by:
getAtomGroups
in interfaceChain
- Returns:
- a List object representing the Groups of this Chain.
- See Also:
Chain.setAtomGroups(List)
-
setAtomGroups
public void setAtomGroups(java.util.List<Group> groups)
Set all groups that have been specified in the ATOM section of this chain .- Specified by:
setAtomGroups
in interfaceChain
- Parameters:
groups
- a List object representing the Groups of this Chain.- See Also:
Chain.getAtomGroups()
-
getGroupsByPDB
public Group[] getGroupsByPDB(java.lang.String pdbresnumStart, java.lang.String 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.- Specified by:
getGroupsByPDB
in interfaceChain
- 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
-
getGroupByPDB
public Group getGroupByPDB(java.lang.String pdbresnum) throws StructureException
Description copied from interface:Chain
get a group by its PDB residue numbering. if the PDB residue number is not know, throws a StructureException.- Specified by:
getGroupByPDB
in interfaceChain
- Parameters:
pdbresnum
- the PDB residue number of the group- Returns:
- the matching group
- Throws:
StructureException
-
getGroupsByPDB
public Group[] getGroupsByPDB(java.lang.String pdbresnumStart, java.lang.String pdbresnumEnd) throws StructureException
Get all groups that are located between two PDB residue numbers.- Specified by:
getGroupsByPDB
in interfaceChain
- 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
-
getLength
public int getLength()
Deprecated.use getAtomLength insteadDescription copied from interface:Chain
get total length of chain, including HETATMs..- Specified by:
getLength
in interfaceChain
- Returns:
- an int representing the length of the whole chain including HETATMs
- See Also:
Chain.getAtomLength()
,Chain.getSeqResLength()
-
getLengthAminos
public int getLengthAminos()
returns the length of the AminoAcids in the ATOM records of this chain. note: not all amino acids need to have 3D coords, in fact in could be that none has!- Specified by:
getLengthAminos
in interfaceChain
- Returns:
- an int representing the length of the AminoAcids in the ATOM records of the chain.
-
getSeqResLength
public int getSeqResLength()
Description copied from interface:Chain
Returns the number of groups in the SEQRES records of the chain.- Specified by:
getSeqResLength
in interfaceChain
- Returns:
- the length
-
setName
public void setName(java.lang.String nam)
get and set the name of this chain (Chain id in PDB file ).
-
getName
public java.lang.String getName()
get and set the name of this chain (Chain id in PDB file ).- Specified by:
getName
in interfaceChain
- Returns:
- a String representing the name value
- See Also:
setName(java.lang.String)
-
toString
public java.lang.String toString()
String representation.
-
getBJSequence
public Sequence getBJSequence() throws IllegalSymbolException
Convert 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.
- Throws:
IllegalSymbolException
-
getSequence
public java.lang.String getSequence()
Deprecated.use getAtomSequence insteadget amino acid sequence of the chain. for backwards compatibility this returns the Atom sequence of the chain.- Specified by:
getSequence
in interfaceChain
- Returns:
- a String representing the sequence.
- See Also:
getAtomSequence()
,getSeqResSequence()
-
getAtomSequence
public java.lang.String getAtomSequence()
Return the sequence of amino acids as it has been provided in the ATOM records.- Specified by:
getAtomSequence
in interfaceChain
- Returns:
- amino acid sequence as string
- See Also:
Chain.getSeqResSequence()
-
getSeqResSequence
public java.lang.String getSeqResSequence()
Get the sequence for all amino acids as it is specified in the SEQRES residues.- Specified by:
getSeqResSequence
in interfaceChain
- Returns:
- the amino acid sequence of the SEQRES sequence as a string
- See Also:
Chain.getAtomSequence()
-
getSeqResGroup
public Group getSeqResGroup(int position)
return the Group at position X.- Specified by:
getSeqResGroup
in interfaceChain
- Parameters:
position
- an int- Returns:
- a Group object
-
getSeqResGroups
public java.util.List<Group> getSeqResGroups(java.lang.String type)
Return a List of all groups of a special type (e.g. amino, hetatm, nucleotide).- Specified by:
getSeqResGroups
in interfaceChain
- Parameters:
type
- a String- Returns:
- an List object
- See Also:
Chain.setSeqResGroups(List)
-
getSeqResGroups
public java.util.List<Group> getSeqResGroups()
Return all groups of this chain.- Specified by:
getSeqResGroups
in interfaceChain
- Returns:
- a List of all Group objects of this chain
- See Also:
Chain.setSeqResGroups(List)
-
setSeqResGroups
public void setSeqResGroups(java.util.List<Group> groups)
Set 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:
Chain.getSeqResGroups()
-
getAtomLength
public int getAtomLength()
Return the number of Groups in the ATOM records of the chain.- Specified by:
getAtomLength
in interfaceChain
- Returns:
- the length
-
-