public interface Structure extends Cloneable, Serializable
Structure |For more documentation on how to work with the Structure API please see http://biojava.org/wiki/BioJava:CookBook#Protein_StructureChain
|Group
|Atom
The tutorial for the BioJava structure modules can be found at github.
Q: How can I get a Structure object from a PDB file?
A:
Structure
loadStructure(String pathToPDBFile){PDBFileReader
pdbreader = newPDBFileReader
();Structure
structure = null; try{ structure = pdbreader.getStructure(pathToPDBFile); System.out.println(structure); } catch (IOException e) { e.printStackTrace(); } return structure; }
Q: How can I calculate Phi and Psi angles of AminoAcids?
A:
void calcPhiPsi(Structure
structure){ // get the first chain from the structureChain
chain = structure.getChain(0); // A protein chain consists of a number of groups. These can be either //AminoAcid
,Hetatom
orNucleotide
groups. // // Note: BioJava provides access to both the ATOM and SEQRES data in a PDB file. // since we are interested in doing calculations here, we only request the groups // from the ATOM records // get the Groups of the chain that are AminoAcids. Listgroups = chain.getAtomGroups(GroupType.AMINOACID); AminoAcid
a;AminoAcid
b;AminoAcid
c ; for ( int i=0; i < groups.size(); i++){ // since we requested only groups of type AMINOACID they will always be amino acids // Nucleotide and Hetatom groups will not be present in the groups list. b = (AminoAcid
)groups.get(i); double phi =360.0; double psi =360.0; if ( i > 0) { a = (AminoAcid
)groups.get(i-1) ; try { // the Calc class provides utility methods for various calculations on // structures, groups and atoms phi =Calc
.getPhi(a,b); } catch (StructureException
e){ e.printStackTrace(); phi = 360.0 ; } } if ( i < groups.size()-1) { c = (AminoAcid
)groups.get(i+1) ; try { psi =Calc
.getPsi(b,c); }catch (StructureException
e){ e.printStackTrace(); psi = 360.0 ; } } System.out.print(b.getPDBCode() + " " + b.getPDBName() + ":" ); System.out.println(String.format("\tphi: %+7.2f psi: %+7.2f", phi, psi)); }
Modifier and Type | Method and Description |
---|---|
void |
addChain(Chain chain)
Add a new chain to the first model
|
void |
addChain(Chain chain,
int modelnr)
Add a new chain to the model specified by the given index
|
void |
addEntityInfo(EntityInfo entityInfo)
Add an EntityInfo to this Structure
|
void |
addModel(List<Chain> model)
Add a new model.
|
void |
addSSBond(Bond ssbond)
Add a single disulfide Bond to this structure
|
Structure |
clone()
Return an identical copy of this Structure object
|
Chain |
findChain(String authId)
Deprecated.
|
Chain |
findChain(String authId,
int modelnr)
Deprecated.
|
Group |
findGroup(String authId,
String pdbResnum)
Request a particular group from a structure.
|
Group |
findGroup(String authId,
String pdbResnum,
int modelnr)
Request a particular group from a structure.
|
Chain |
getChain(String asymId)
Retrieve a Chain (polymeric, non-polymeric or water) based on
the 'internal' chain id (asymId) for the first model
|
Chain |
getChain(String asymId,
int modelIdx)
Retrieve a Chain (polymeric, non-polymeric or water) based on
the 'internal' chain id (asymId) for the given model index
|
Chain |
getChainByIndex(int chainIndex)
Retrieve a chain by its index within the Structure .
|
Chain |
getChainByIndex(int modelnr,
int chainIndex)
Retrieve a chain by its indices within the Structure and model.
|
Chain |
getChainByPDB(String authId)
Deprecated.
use
getPolyChainByPDB(String) instead |
Chain |
getChainByPDB(String authId,
int modelIdx)
Deprecated.
use
getPolyChainByPDB(String,int) instead |
List<Chain> |
getChains()
Retrieve all chains for the first model.
|
List<Chain> |
getChains(int modelnr)
Retrieve all chains of a model.
|
EntityInfo |
getCompoundById(int entityId)
Deprecated.
use
getEntityById(int) instead |
PDBCrystallographicInfo |
getCrystallographicInfo()
Get crystallographic information for this structure
|
List<DBRef> |
getDBRefs()
Get the list of database references
|
EntityInfo |
getEntityById(int entityId)
Request a particular entity by its entity id (mol id in legacy PDB format)
|
List<EntityInfo> |
getEntityInfos()
Get all the EntityInfo for this Structure.
|
Long |
getId()
Get the ID used by Hibernate
|
String |
getIdentifier()
Get a string representing this structure's contents.
|
JournalArticle |
getJournalArticle()
Get the associated publication as defined by the JRNL records in a PDB
file.
|
List<Chain> |
getModel(int modelnr)
Retrieve all Chains belonging to a model .
|
String |
getName()
Get biological name of Structure.
|
Chain |
getNonPolyChain(String asymId)
Retrieve a non-polymeric Chain based on the 'internal' chain
id (asymId) for the first model
|
Chain |
getNonPolyChain(String asymId,
int modelIdx)
Retrieve a non-polymeric Chain based on the 'internal' chain
id (asymId) for the given model index
|
List<Chain> |
getNonPolyChains()
Return all non-polymeric chains for the first model
|
List<Chain> |
getNonPolyChains(int modelIdx)
Return all non-polymeric chains for the given model index.
|
List<Chain> |
getNonPolyChainsByPDB(String authId)
Retrieve all non-polymeric Chains corresponding to the given 'public' chain
name (authId) for the first model.
|
List<Chain> |
getNonPolyChainsByPDB(String authId,
int modelIdx)
Retrieve all non-polymeric Chains corresponding to the 'public' chain
name (authId) and the given model index.
|
String |
getPDBCode()
Get PDB code of structure.
|
PDBHeader |
getPDBHeader()
Return the header information for this PDB file
|
String |
getPdbId()
Deprecated.
From BioJava 4.2, use
getPDBCode() or
getStructureIdentifier().toCanonical().getPdbId() |
Chain |
getPolyChain(String asymId)
Retrieve a polymeric Chain based on the 'internal' chain
id (asymId) for the first model
See
getPolyChainByPDB(String) for a similar
method using the chain name (authId). |
Chain |
getPolyChain(String asymId,
int modelIdx)
Retrieve a polymeric Chain based on the 'internal' chain
id (asymId) for the given model index
See
getPolyChainByPDB(String, int) for a similar
method using the chain name (authId). |
Chain |
getPolyChainByPDB(String authId)
Retrieve a polymeric Chain based on the 'public' chain
name (authId) for the first model
See
getPolyChain(String) for a similar
method using the chain id (asymId). |
Chain |
getPolyChainByPDB(String authId,
int modelIdx)
Retrieve a polymeric Chain based on the 'public' chain
name (authId) for the given model index.
|
List<Chain> |
getPolyChains()
Return all polymeric chains for the first model
|
List<Chain> |
getPolyChains(int modelIdx)
Return all polymeric chains for the given model index.
|
List<String> |
getRanges()
Deprecated.
From BioJava 4.2, use
getStructureIdentifier().toCanonical().getRanges() |
List<? extends ResidueRange> |
getResidueRanges()
Deprecated.
From BioJava 4.2, use
getStructureIdentifier().toCanonical().getResidueRanges() |
List<Site> |
getSites() |
List<Bond> |
getSSBonds()
Get the list of disulfide Bonds as they have been defined in the PDB files
|
StructureIdentifier |
getStructureIdentifier()
Get an identifier corresponding to this structure
|
Chain |
getWaterChain(String asymId)
Retrieve a water Chain based on the 'internal' chain id (asymId)
for the first model
|
Chain |
getWaterChain(String asymId,
int modelIdx)
Retrieve a water chain based on the 'internal' chain id (asymId)
for the given model index
|
Chain |
getWaterChainByPDB(String authId)
Retrieve a water Chain based on the 'public' chain name (authId)
for the first model
|
Chain |
getWaterChainByPDB(String authId,
int modelIdx)
Retrieve a water Chain based on the 'public' chain name (authId)
for the given model index
|
List<Chain> |
getWaterChains()
Return all water chains for the first model
|
List<Chain> |
getWaterChains(int modelIdx)
Return all water chains for the given model index
|
boolean |
hasChain(String asymId)
Check if a chain with the chainId aymId is contained in this structure.
|
boolean |
hasJournalArticle()
Return whether or not the entry has an associated journal article
or ation.
|
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 structure
|
boolean |
isBiologicalAssembly()
Get flag that indicates if this structure is a biological assembly
|
boolean |
isCrystallographic()
Test if this structure is a crystallographic structure, i.e. it is an asymmetric unit
from which it is possible to reconstruct the crystal lattice given cell parameters and
space group.
|
boolean |
isNmr()
Test if this structure is an NMR structure.
|
int |
nrModels()
Return the number of models .
|
void |
resetModels()
Resets all models of this Structure
|
void |
setBiologicalAssembly(boolean biologicalAssembly)
Set a flag to indicate if this structure is a biological assembly
|
void |
setChains(int modelnr,
List<Chain> chains)
Set the chains for a model
|
void |
setChains(List<Chain> chains)
Set the chains of a structure, if this is a NMR structure,
this will only set model 0.
|
void |
setCrystallographicInfo(PDBCrystallographicInfo crystallographicInfo)
Set crystallographic information for this structure
|
void |
setDBRefs(List<DBRef> dbrefs)
Set the list of database references for this structure
|
void |
setEntityInfos(List<EntityInfo> molList)
Set the EntityInfo
|
void |
setId(Long id)
set the ID used by Hibernate
|
void |
setJournalArticle(JournalArticle journalArticle)
Set the associated publication as defined by the JRNL records in a PDB
file.
|
void |
setModel(int position,
List<Chain> model)
A convenience function if one wants to edit and replace the
models in a structure.
|
void |
setName(String name)
Set biological name of Structure .
|
void |
setPDBCode(String pdb_id)
Set PDB code of structure .
|
void |
setPDBHeader(PDBHeader header)
Set the the header information for this PDB file
|
void |
setSites(List<Site> sites) |
void |
setSSBonds(List<Bond> ssbonds)
Set the list of SSBonds for this structure
|
void |
setStructureIdentifier(StructureIdentifier structureIdentifier)
Set the identifier corresponding to this structure
|
int |
size()
Return number of polymer Chains in this Structure for first model.
|
int |
size(int modelnr)
Return number of chains of model.
|
String |
toMMCIF()
Create a String that contains this Structure's contents in MMCIF file format.
|
String |
toPDB()
Create a String that contains this Structure's contents in PDB file format.
|
String |
toString()
String representation of object.
|
Structure clone()
void setPDBCode(String pdb_id)
pdb_id
- a String specifying the PDBCodegetPDBCode()
String getPDBCode()
setPDBCode(java.lang.String)
void setName(String name)
name
- a String specifying the biological name of the StructuregetName()
String getName()
setName(java.lang.String)
StructureIdentifier getStructureIdentifier()
void setStructureIdentifier(StructureIdentifier structureIdentifier)
structureIdentifier
- the structureIdentifier corresponding to this structureint size()
int size(int modelnr)
modelnr
- an int specifying the number of the Model that should be usedint nrModels()
isNmr()
.isNmr()
boolean isNmr()
nrModels()
boolean isCrystallographic()
void addModel(List<Chain> model)
model
- a List object containing the Chains of the new Modelvoid setModel(int position, List<Chain> model)
position
- starting at 0model
- list of chains representing a modelList<Chain> getModel(int modelnr)
modelnr
- an intgetChains(int modelnr)
List<Chain> getChains()
getModel(int modelnr)
,
getChains(int modelnr)
void setChains(List<Chain> chains)
chains
- the list of chains for this structure.setChains(int, List)
List<Chain> getChains(int modelnr)
modelnr
- an intgetModel(int)
void setChains(int modelnr, List<Chain> chains)
chains
- the chains for a modelmodelnr
- the number of the modelList<Chain> getPolyChains()
List<Chain> getPolyChains(int modelIdx)
modelIdx
- the model indexList<Chain> getNonPolyChains()
List<Chain> getNonPolyChains(int modelIdx)
modelIdx
- the model indexList<Chain> getWaterChains()
List<Chain> getWaterChains(int modelIdx)
modelIdx
- void addChain(Chain chain)
chain
- a Chain objectvoid addChain(Chain chain, int modelnr)
chain
- a Chain objectmodelnr
- an int specifying to which model the Chain should be addedChain getChainByIndex(int chainIndex)
chainIndex
- the index of the desired chain in the structureChain getChainByIndex(int modelnr, int chainIndex)
chainIndex
- the index of the desired chain in the structuremodelnr
- the model the desired chain is in@Deprecated Chain findChain(String authId) throws StructureException
authId
- name of a chain that should be returnedStructureException
@Deprecated Chain findChain(String authId, int modelnr) throws StructureException
authId
- the name of a chain that should be returnedmodelnr
- the number of the model to useStructureException
boolean hasChain(String asymId)
asymId
- the Id of the chainboolean hasNonPolyChain(String asymId)
asymId
- the id of the chainboolean hasPdbChain(String authId)
authId
- the chain nameGroup findGroup(String authId, String pdbResnum) throws StructureException
authId
- the name of the chain to usepdbResnum
- the PDB residue number of the requested groupStructureException
Group findGroup(String authId, String pdbResnum, int modelnr) throws StructureException
authId
- the chain name of the chain to usepdbResnum
- the PDB residue number of the requested groupmodelnr
- the number of the model to useStructureException
@Deprecated Chain getChainByPDB(String authId) throws StructureException
getPolyChainByPDB(String)
insteadauthId
- the author id (chainName, public chain id)StructureException
- if chain can't be found@Deprecated Chain getChainByPDB(String authId, int modelIdx) throws StructureException
getPolyChainByPDB(String,int)
insteadauthId
- the author id (chainName, public chain id)modelIdx
- the index of the required model (0-based)StructureException
- if chain can't be foundChain getChain(String asymId)
asymId
- the asymId (chainId)getPolyChain(String)
,
getNonPolyChain(String)
,
getWaterChain(String)
Chain getChain(String asymId, int modelIdx)
asymId
- the asymId (chainId)modelIdx
- the index of the required model (0-based)getPolyChain(String, int)
,
getNonPolyChain(String, int)
,
getWaterChain(String, int)
Chain getPolyChain(String asymId)
See getPolyChainByPDB(String)
for a similar
method using the chain name (authId).
asymId
- the asymId (chainId)Chain getPolyChain(String asymId, int modelIdx)
See getPolyChainByPDB(String, int)
for a similar
method using the chain name (authId).
asymId
- the asymId (chainId)modelIdx
- the index of the required model (0-based)Chain getPolyChainByPDB(String authId)
See getPolyChain(String)
for a similar
method using the chain id (asymId).
authId
- the author id (chainName, public chain id)Chain getPolyChainByPDB(String authId, int modelIdx)
See getPolyChain(String, int)
for a similar
method using the chain id (asymId).
authId
- the author id (chainName, public chain id)modelIdx
- the index of the required model (0-based)Chain getNonPolyChain(String asymId)
asymId
- the asymId (chainId)Chain getNonPolyChain(String asymId, int modelIdx)
asymId
- the asymId (chainId)modelIdx
- the index of the required model (0-based)List<Chain> getNonPolyChainsByPDB(String authId)
authId
- the author id (chainName, public chain id)List<Chain> getNonPolyChainsByPDB(String authId, int modelIdx)
authId
- the author id (chainName, public chain id)modelIdx
- the index of the required model (0-based)Chain getWaterChain(String asymId)
asymId
- the asymId (chainId)Chain getWaterChain(String asymId, int modelIdx)
asymId
- the asymId (chainId)modelIdx
- the index of the required model (0-based)Chain getWaterChainByPDB(String authId)
authId
- the author id (chainName, public chain id)Chain getWaterChainByPDB(String authId, int modelIdx)
authId
- the author id (chainName, public chain id)modelIdx
- the index of the required model (0-based)String toPDB()
FileConvert
String toMMCIF()
void setEntityInfos(List<EntityInfo> molList)
molList
- list of entityinfo objectsList<EntityInfo> getEntityInfos()
void addEntityInfo(EntityInfo entityInfo)
void setDBRefs(List<DBRef> dbrefs)
dbrefs
- list of DBRef objectsList<DBRef> getDBRefs()
@Deprecated EntityInfo getCompoundById(int entityId)
getEntityById(int)
insteadentityId
- the number of the entityEntityInfo getEntityById(int entityId)
entityId
- the number of the entityPDBHeader getPDBHeader()
boolean hasJournalArticle()
JournalArticle getJournalArticle()
void setJournalArticle(JournalArticle journalArticle)
journalArticle
- a JournalArticle objectList<Bond> getSSBonds()
void setSSBonds(List<Bond> ssbonds)
ssbonds
- void addSSBond(Bond ssbond)
ssbond
- a disulfide bondvoid setPDBHeader(PDBHeader header)
header
- the PDBHeader objectvoid setBiologicalAssembly(boolean biologicalAssembly)
biologicalAssembly
- true if biological assembly, otherwise falseboolean isBiologicalAssembly()
void setCrystallographicInfo(PDBCrystallographicInfo crystallographicInfo)
crystallographicInfo
- crystallographic informationPDBCrystallographicInfo getCrystallographicInfo()
void resetModels()
@Deprecated String getPdbId()
getPDBCode()
or
getStructureIdentifier().toCanonical().getPdbId()
@Deprecated List<? extends ResidueRange> getResidueRanges()
getStructureIdentifier().toCanonical().getResidueRanges()
ResidueRanges
that this StructureIdentifier defines.
This is a unique representation.@Deprecated List<String> getRanges()
getStructureIdentifier().toCanonical().getRanges()
getRanges().get(0): 'A' getRanges().get(1): 'B_5-100'This is a unique representation.
String getIdentifier()
getStructureIdentifier()
.getIdentifier(), which should give
the string originally used to create the structure
getName()
getPDBCode()
with a heuristic description
of the residue ranges, in SubstructureIdentifier
format.
SubstructureIdentifier
-format string describing the residue ranges in this structuregetPDBCode()
Copyright © 2000–2019 BioJava. All rights reserved.