Package org.biojava.nbio.structure
Class StructureImpl
java.lang.Object
org.biojava.nbio.structure.StructureImpl
- All Implemented Interfaces:
Serializable
,Cloneable
,Structure
Implementation of a PDB Structure. This class
provides the data contained in a PDB file.
to get structure objects from different sources
see io package.
- Since:
- 1.4
- Version:
- %I% %G%
- Author:
- Andreas Prlic, Jules Jacobsen
- See Also:
-
Constructor Summary
ConstructorDescriptionConstructs a StructureImpl object.Construct a Structure object that contains a particular chainConstruct a Structure object that only contains a single group -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a new chain to the first modelvoid
Add a new chain to the model specified by the given indexvoid
addEntityInfo
(EntityInfo entityInfo) Add an EntityInfo to this Structurevoid
Add a new model.void
Adds a single disulfide Bond to this structureclone()
Returns an identical copy of this structure .Request a particular group from a structure.Request a particular group from a structure.Retrieve a Chain (polymeric, non-polymeric or water) based on the 'internal' chain id (asymId) for the first modelRetrieve a Chain (polymeric, non-polymeric or water) based on the 'internal' chain id (asymId) for the given model indexgetChainByIndex
(int number) Retrieve a chain by its index within the Structure .getChainByIndex
(int modelnr, int number) Retrieve a chain by its indices within the Structure and model.Retrieve all chains for the first model.getChains
(int modelIdx) Retrieve all chains of a model.Gets crystallographic information for this structureGet the list of database referencesgetEntityById
(int entityId) Request a particular entity by its entity id (mol id in legacy PDB format)Get all the EntityInfo for this Structure.Get a string representing this structure's contents.get the associated publication as defined by the JRNL records in a PDB file.getModel
(int modelnr) Retrieve all Chains belonging to a model .getName()
Get biological name of Structure.getNonPolyChain
(String asymId) Retrieve a non-polymeric Chain based on the 'internal' chain id (asymId) for the first modelgetNonPolyChain
(String asymId, int modelIdx) Retrieve a non-polymeric Chain based on the 'internal' chain id (asymId) for the given model indexReturn all non-polymeric chains for the first modelgetNonPolyChains
(int modelIdx) Return all non-polymeric chains for the given model index.getNonPolyChainsByPDB
(String authId) Retrieve all non-polymeric Chains corresponding to the given 'public' chain name (authId) for the first model.getNonPolyChainsByPDB
(String authId, int modelIdx) Retrieve all non-polymeric Chains corresponding to the 'public' chain name (authId) and the given model index.Deprecated.Return the header information for this PDB file.getPdbId()
Returns the PDB identifier associated with this StructureIdentifier.getPolyChain
(String asymId) Retrieve a polymeric Chain based on the 'internal' chain id (asymId) for the first modelgetPolyChain
(String asymId, int modelIdx) Retrieve a polymeric Chain based on the 'internal' chain id (asymId) for the given model indexgetPolyChainByPDB
(String authId) Retrieve a polymeric Chain based on the 'public' chain name (authId) for the first modelgetPolyChainByPDB
(String authId, int modelIdx) Retrieve a polymeric Chain based on the 'public' chain name (authId) for the given model index.Return all polymeric chains for the first modelgetPolyChains
(int modelIdx) Return all polymeric chains for the given model index.getSites()
Get the list of disulfide Bonds as they have been defined in the PDB filesGet an identifier corresponding to this structuregetWaterChain
(String asymId) Retrieve a water Chain based on the 'internal' chain id (asymId) for the first modelgetWaterChain
(String asymId, int modelIdx) Retrieve a water chain based on the 'internal' chain id (asymId) for the given model indexgetWaterChainByPDB
(String authId) Retrieve a water Chain based on the 'public' chain name (authId) for the first modelgetWaterChainByPDB
(String authId, int modelIdx) Retrieve a water Chain based on the 'public' chain name (authId) for the given model indexReturn all water chains for the first modelgetWaterChains
(int modelIdx) Return all water chains for the given model indexboolean
Check if a chain with the chainId aymId is contained in this structure.boolean
Return whether or not the entry has an associated journal article or publication.boolean
hasNonPolyChain
(String asymId) Check if a non polymeric chain with chainId asymId is contained in the structure.boolean
hasPdbChain
(String authId) Check if a chain with chain name authId is contained in the structureboolean
Gets flag that indicates if this structure is a biological assemblyboolean
Whether this Structure is a crystallographic structure or not.boolean
isNmr()
Whether this Structure is a NMR structure or not.int
nrModels()
return number of models.void
Resets all models of this Structurevoid
setBiologicalAssembly
(boolean biologicalAssembly) Sets a flag to indicate if this structure is a biological assemblyvoid
Set the chains for a modelvoid
Set the chains of a structure, if this is a NMR structure, this will only set model 0.void
setCrystallographicInfo
(PDBCrystallographicInfo crystallographicInfo) Sets crystallographic information for this structurevoid
Set the list of database references for this structurevoid
setEntityInfos
(List<EntityInfo> molList) Set the EntityInfovoid
setJournalArticle
(JournalArticle journalArticle) set the associated publication as defined by the JRNL records in a PDB file.void
A convenience function if one wants to edit and replace the models in a structure.void
Set biological name of Structure .void
setPDBCode
(String pdb_id) Deprecated.usesetPdbId(PdbId)
void
setPDBHeader
(PDBHeader pdbHeader) Set the the header information for this PDB filevoid
Sets thePdbId
identifier associated with this structure.void
void
setSSBonds
(List<Bond> ssbonds) Set the list of SSBonds for this structurevoid
setStructureIdentifier
(StructureIdentifier structureIdentifier) Set the identifier corresponding to this structureint
size()
Return number of polymer Chains in this Structure for first model.int
size
(int modelnr) return number of chains of model.toMMCIF()
Create a String that contains this Structure's contents in MMCIF file format.toPDB()
Create a String that contains this Structure's contents in PDB file format.toString()
String representation.
-
Constructor Details
-
StructureImpl
public StructureImpl()Constructs a StructureImpl object. -
StructureImpl
Construct a Structure object that only contains a single group- Parameters:
g
- group object
-
StructureImpl
Construct a Structure object that contains a particular chain- Parameters:
c
- chain
-
-
Method Details
-
clone
Returns an identical copy of this structure . -
findGroup
Request a particular group from a structure. considers only model nr X. count starts with 0.- Specified by:
findGroup
in interfaceStructure
- Parameters:
chainName
- the chain name of the chain to usepdbResnum
- the PDB residue number of the requested groupmodelnr
- the number of the model to use- Returns:
- Group the requested Group
- Throws:
StructureException
-
findGroup
Request a particular group from a structure. by default considers only the first model in the structure.- Specified by:
findGroup
in interfaceStructure
- Parameters:
chainName
- the name of the chain to usepdbResnum
- the PDB residue number of the requested group- Returns:
- Group the requested Group
- Throws:
StructureException
-
setName
Set biological name of Structure . -
getName
Get biological name of Structure. -
getStructureIdentifier
Description copied from interface:Structure
Get an identifier corresponding to this structure- Specified by:
getStructureIdentifier
in interfaceStructure
- Returns:
- The StructureIdentifier used to create this structure
-
setStructureIdentifier
Description copied from interface:Structure
Set the identifier corresponding to this structure- Specified by:
setStructureIdentifier
in interfaceStructure
- Parameters:
structureIdentifier
- the structureIdentifier corresponding to this structure
-
addChain
Add a new chain to the first model -
addChain
Add a new chain to the model specified by the given index -
getChainByIndex
Retrieve a chain by its index within the Structure .- Specified by:
getChainByIndex
in interfaceStructure
- Parameters:
number
- the index of the desired chain in the structure- Returns:
- a Chain object
-
getChainByIndex
Retrieve a chain by its indices within the Structure and model.- Specified by:
getChainByIndex
in interfaceStructure
- Parameters:
modelnr
- the model the desired chain is innumber
- the index of the desired chain in the structure- Returns:
- a Chain object
-
addModel
Add a new model. -
setChains
Set the chains of a structure, if this is a NMR structure, this will only set model 0. -
setModel
A convenience function if one wants to edit and replace the models in a structure. Allows to set (replace) the model at position with the new List of Chains. -
toString
String representation. -
size
Description copied from interface:Structure
Return number of polymer Chains in this Structure for first model. -
size
return number of chains of model. -
nrModels
return number of models. -
isCrystallographic
Whether this Structure is a crystallographic structure or not. It will first check the experimental technique and if not present it will try to guess from the presence of a space group and sensible cell parameters- Specified by:
isCrystallographic
in interfaceStructure
- Returns:
- true if crystallographic, false otherwise
-
isNmr
Whether this Structure is a NMR structure or not. It will first check the experimental technique and if not present it will try to guess from the presence of more than 1 model and from b-factors being 0 in first chain of first model -
getChains
Retrieve all chains of a model. -
getChains
Retrieve all chains for the first model. This is the same as getChains(0); -
getPolyChains
Description copied from interface:Structure
Return all polymeric chains for the first model- Specified by:
getPolyChains
in interfaceStructure
- Returns:
- all polymeric chains.
-
getPolyChains
Description copied from interface:Structure
Return all polymeric chains for the given model index.- Specified by:
getPolyChains
in interfaceStructure
- Parameters:
modelIdx
- the model index- Returns:
- all polymeric chains.
-
getNonPolyChains
Description copied from interface:Structure
Return all non-polymeric chains for the first model- Specified by:
getNonPolyChains
in interfaceStructure
- Returns:
- all non-polymeric chains.
-
getNonPolyChains
Description copied from interface:Structure
Return all non-polymeric chains for the given model index.- Specified by:
getNonPolyChains
in interfaceStructure
- Parameters:
modelIdx
- the model index- Returns:
- all non-polymeric chains.
-
getWaterChains
Description copied from interface:Structure
Return all water chains for the first model- Specified by:
getWaterChains
in interfaceStructure
- Returns:
-
getWaterChains
Description copied from interface:Structure
Return all water chains for the given model index- Specified by:
getWaterChains
in interfaceStructure
- Parameters:
modelIdx
-- Returns:
-
setChains
Set the chains for a model -
getModel
Retrieve all Chains belonging to a model . -
getChain
Retrieve a Chain (polymeric, non-polymeric or water) based on the 'internal' chain id (asymId) for the given model index -
getChain
Retrieve a Chain (polymeric, non-polymeric or water) based on the 'internal' chain id (asymId) for the first model -
getPolyChain
Description copied from interface:Structure
Retrieve a polymeric Chain based on the 'internal' chain id (asymId) for the first modelSee
Structure.getPolyChainByPDB(String)
for a similar method using the chain name (authId).- Specified by:
getPolyChain
in interfaceStructure
- Parameters:
asymId
- the asymId (chainId)- Returns:
- a polymeric Chain or null if it can't be found
-
getPolyChain
Description copied from interface:Structure
Retrieve a polymeric Chain based on the 'internal' chain id (asymId) for the given model indexSee
Structure.getPolyChainByPDB(String, int)
for a similar method using the chain name (authId).- Specified by:
getPolyChain
in interfaceStructure
- Parameters:
asymId
- the asymId (chainId)modelIdx
- the index of the required model (0-based)- Returns:
- a polymeric Chain or null if it can't be found
-
getNonPolyChain
Description copied from interface:Structure
Retrieve a non-polymeric Chain based on the 'internal' chain id (asymId) for the first model- Specified by:
getNonPolyChain
in interfaceStructure
- Parameters:
asymId
- the asymId (chainId)- Returns:
- a non-polymeric chain or null if it can't be found
-
getNonPolyChain
Description copied from interface:Structure
Retrieve a non-polymeric Chain based on the 'internal' chain id (asymId) for the given model index- Specified by:
getNonPolyChain
in interfaceStructure
- Parameters:
asymId
- the asymId (chainId)modelIdx
- the index of the required model (0-based)- Returns:
- a non-polymeric Chain or null if it can't be found
-
getPolyChainByPDB
Description copied from interface:Structure
Retrieve a polymeric Chain based on the 'public' chain name (authId) for the first modelSee
Structure.getPolyChain(String)
for a similar method using the chain id (asymId).- Specified by:
getPolyChainByPDB
in interfaceStructure
- Parameters:
authId
- the author id (chainName, public chain id)- Returns:
- a polymeric Chain or null if it can't be found
-
getPolyChainByPDB
Description copied from interface:Structure
Retrieve a polymeric Chain based on the 'public' chain name (authId) for the given model index.See
Structure.getPolyChain(String, int)
for a similar method using the chain id (asymId).- Specified by:
getPolyChainByPDB
in interfaceStructure
- Parameters:
authId
- the author id (chainName, public chain id)modelIdx
- the index of the required model (0-based)- Returns:
- a polymeric Chain or null if it can't be found
-
getNonPolyChainsByPDB
Description copied from interface:Structure
Retrieve all non-polymeric Chains corresponding to the given 'public' chain name (authId) for the first model.- Specified by:
getNonPolyChainsByPDB
in interfaceStructure
- Parameters:
authId
- the author id (chainName, public chain id)- Returns:
- a list of non-polymeric Chains, if none found the list will be empty
-
getNonPolyChainsByPDB
Description copied from interface:Structure
Retrieve all non-polymeric Chains corresponding to the 'public' chain name (authId) and the given model index.- Specified by:
getNonPolyChainsByPDB
in interfaceStructure
- Parameters:
authId
- the author id (chainName, public chain id)modelIdx
- the index of the required model (0-based)- Returns:
- a list of non-polymeric Chains, if none found the list will be empty
-
getWaterChain
Description copied from interface:Structure
Retrieve a water Chain based on the 'internal' chain id (asymId) for the first model- Specified by:
getWaterChain
in interfaceStructure
- Parameters:
asymId
- the asymId (chainId)- Returns:
- a water Chain or null if it can't be found
-
getWaterChain
Description copied from interface:Structure
Retrieve a water chain based on the 'internal' chain id (asymId) for the given model index- Specified by:
getWaterChain
in interfaceStructure
- Parameters:
asymId
- the asymId (chainId)modelIdx
- the index of the required model (0-based)- Returns:
-
getWaterChainByPDB
Description copied from interface:Structure
Retrieve a water Chain based on the 'public' chain name (authId) for the first model- Specified by:
getWaterChainByPDB
in interfaceStructure
- Parameters:
authId
- the author id (chainName, public chain id)- Returns:
-
getWaterChainByPDB
Description copied from interface:Structure
Retrieve a water Chain based on the 'public' chain name (authId) for the given model index- Specified by:
getWaterChainByPDB
in interfaceStructure
- Parameters:
authId
- the author id (chainName, public chain id)modelIdx
- the index of the required model (0-based)- Returns:
-
toPDB
Create a String that contains this Structure's contents in PDB file format. -
toMMCIF
Create a String that contains this Structure's contents in MMCIF file format. -
hasChain
Check if a chain with the chainId aymId is contained in this structure. -
hasNonPolyChain
Check if a non polymeric chain with chainId asymId is contained in the structure.- Specified by:
hasNonPolyChain
in interfaceStructure
- Parameters:
asymId
- the id of the chain- Returns:
- true if a nonpolymeric chain with the asymId is found
-
hasPdbChain
Check if a chain with chain name authId is contained in the structure- Specified by:
hasPdbChain
in interfaceStructure
- Parameters:
authId
- the chain name- Returns:
- true if a chain with the name authId is found
-
setEntityInfos
Set the EntityInfo- Specified by:
setEntityInfos
in interfaceStructure
- Parameters:
molList
- list of entityinfo objects
-
addEntityInfo
Add an EntityInfo to this Structure- Specified by:
addEntityInfo
in interfaceStructure
-
getEntityInfos
Get all the EntityInfo for this Structure.- Specified by:
getEntityInfos
in interfaceStructure
- Returns:
- a list of EntityInfos
-
getEntityById
Request a particular entity by its entity id (mol id in legacy PDB format)- Specified by:
getEntityById
in interfaceStructure
- Parameters:
entityId
- the number of the entity- Returns:
- an entity, or null if the molId was not found
-
getDBRefs
Get the list of database references -
setDBRefs
Set the list of database references for this structure -
getPDBHeader
Return the header information for this PDB file. N.B. Take care when you blindly use the returned object from this method, because it might be null in some cases.- Specified by:
getPDBHeader
in interfaceStructure
- Returns:
- the PDBHeader object
-
setPDBHeader
Set the the header information for this PDB file- Specified by:
setPDBHeader
in interfaceStructure
- Parameters:
pdbHeader
- the PDBHeader object
-
getSSBonds
Get the list of disulfide Bonds as they have been defined in the PDB files- Specified by:
getSSBonds
in interfaceStructure
- Returns:
- a list of Bonds
-
setSSBonds
Set the list of SSBonds for this structure- Specified by:
setSSBonds
in interfaceStructure
- Parameters:
ssbonds
-
-
addSSBond
Adds a single disulfide Bond to this structure -
hasJournalArticle
Return whether or not the entry has an associated journal article or publication. The JRNL section is not mandatory and thus may not be present.- Specified by:
hasJournalArticle
in interfaceStructure
- Returns:
- flag if a JournalArticle could be found.
-
getJournalArticle
get the associated publication as defined by the JRNL records in a PDB file.- Specified by:
getJournalArticle
in interfaceStructure
- Returns:
- a JournalArticle
-
setJournalArticle
set the associated publication as defined by the JRNL records in a PDB file.- Specified by:
setJournalArticle
in interfaceStructure
- Parameters:
journalArticle
- the article
-
getSites
-
setSites
-
setBiologicalAssembly
Sets a flag to indicate if this structure is a biological assembly- Specified by:
setBiologicalAssembly
in interfaceStructure
- Parameters:
biologicalAssembly
- true if biological assembly, otherwise false- Since:
- 3.2
-
isBiologicalAssembly
Gets flag that indicates if this structure is a biological assembly- Specified by:
isBiologicalAssembly
in interfaceStructure
- Returns:
- the sites contained in this structure
- Since:
- 3.2
-
setCrystallographicInfo
Sets crystallographic information for this structure- Specified by:
setCrystallographicInfo
in interfaceStructure
- Parameters:
crystallographicInfo
- crystallographic information- Since:
- 3.2
-
getCrystallographicInfo
Gets crystallographic information for this structure- Specified by:
getCrystallographicInfo
in interfaceStructure
- Returns:
- PDBCrystallographicInfo crystallographic information
- Since:
- 3.2
-
getIdentifier
Get a string representing this structure's contents. The following places are searched for a non-null value, with the first being returned:Structure.getStructureIdentifier()
.getIdentifier(), which should give the string originally used to create the structureStructure.getName()
- A combination of
Structure.getPDBCode()
with a heuristic description of the residue ranges, inSubstructureIdentifier
format.
- Specified by:
getIdentifier
in interfaceStructure
- Returns:
- A
SubstructureIdentifier
-format string describing the residue ranges in this structure
-
getPDBCode
Deprecated.Get PDB code of structure.- Specified by:
getPDBCode
in interfaceStructure
- Returns:
- a String representing the PDBCode value
- See Also:
-
setPDBCode
Deprecated.usesetPdbId(PdbId)
Set PDB code of structure .- Specified by:
setPDBCode
in interfaceStructure
- Parameters:
pdb_id
- a String specifying the PDBCode- See Also:
-
getPdbId
Returns the PDB identifier associated with this StructureIdentifier. -
setPdbId
Sets thePdbId
identifier associated with this structure. -
resetModels
Description copied from interface:Structure
Resets all models of this Structure- Specified by:
resetModels
in interfaceStructure
-
getPdbId()
to get aPdbId
object or getPdbId().getId() to get aString