public interface Structure extends Cloneable
Structure
|
Chain
|
Group
|
Atom
For more documentation on how to work with the Structure API please
see
http://biojava.org/wiki/BioJava:CookBook#Protein_Structure
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:
publicStructureloadStructure(String pathToPDBFile){PDBFileReaderpdbreader = newPDBFileReader();Structurestructure = 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:
public void calcPhiPsi(Structurestructure){ // get the first chain from the structureChainchain = structure.getChain(0); // A protein chain consists of a number of groups. These can be either //AminoAcid,HetatomorNucleotidegroups. // // 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); AminoAcida;AminoAcidb;AminoAcidc ; 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 (StructureExceptione){ e.printStackTrace(); phi = 360.0 ; } } if ( i < groups.size()-1) { c = (AminoAcid)groups.get(i+1) ; try { psi =Calc.getPsi(b,c); }catch (StructureExceptione){ 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.
|
void |
addChain(Chain chain,
int modelnr)
Add a new chain, if several models are available.
|
void |
addCompound(Compound compound)
Add a Compound 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 chainId)
Request a particular chain from a structure.
|
Chain |
findChain(String chainId,
int modelnr)
Request a particular chain from a particular model
|
Group |
findGroup(String chainId,
String pdbResnum)
Request a particular group from a structure.
|
Group |
findGroup(String chainId,
String pdbResnum,
int modelnr)
Request a particular group from a structure.
|
Chain |
getChain(int pos)
Retrieve a chain by its position within the Structure .
|
Chain |
getChain(int modelnr,
int pos)
Retrieve a chain by its position within the Structure and model number.
|
Chain |
getChainByPDB(String chainId)
Request a chain by its PDB code
by default takes only the first model
|
Chain |
getChainByPDB(String chainId,
int modelnr)
Request a chain by its PDB code
by default takes only the first model
|
List<Chain> |
getChains()
Retrieve all chains - if it is a NMR structure will return the chains of the first model.
|
List<Chain> |
getChains(int modelnr)
Retrieve all chains of a model.
|
Compound |
getCompoundById(int molId)
Request a particular compound by its molId (entity_id in mmCIF dictionary)
|
List<Compound> |
getCompounds()
Get all the Compounds for this Structure.
|
List<Map<String,Integer>> |
getConnections()
Deprecated.
use
Atom.getBonds() instead |
PDBCrystallographicInfo |
getCrystallographicInfo()
Get crystallographic information for this structure
|
List<DBRef> |
getDBRefs()
Get the list of database references
|
List<Group> |
getHetGroups() |
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.
|
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() |
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
|
boolean |
hasChain(String chainId)
Check if a chain with the id chainId is contained in this structure.
|
boolean |
hasJournalArticle()
Return whether or not the entry has an associated journal article
or publication.
|
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.
|
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 |
setCompounds(List<Compound> molList)
Set the Compounds
|
void |
setConnections(List<Map<String,Integer>> connections)
Deprecated.
use
Atom.addBond(Bond) instead |
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 |
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 |
setNmr(boolean nmr)
Deprecated.
|
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 Chains in this Structure.
|
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 structure@Deprecated void setConnections(List<Map<String,Integer>> connections)
Atom.addBond(Bond) instead
COLUMNS DATA TYPE FIELD DEFINITION
---------------------------------------------------------------------------------
1 - 6 Record name "CONECT"
7 - 11 Integer serial Atom serial number
12 - 16 Integer serial Serial number of bonded atom
17 - 21 Integer serial Serial number of bonded atom
22 - 26 Integer serial Serial number of bonded atom
27 - 31 Integer serial Serial number of bonded atom
32 - 36 Integer serial Serial number of hydrogen bonded
atom
37 - 41 Integer serial Serial number of hydrogen bonded
atom
42 - 46 Integer serial Serial number of salt bridged
atom
47 - 51 Integer serial Serial number of hydrogen bonded
atom
52 - 56 Integer serial Serial number of hydrogen bonded
atom
57 - 61 Integer serial Serial number of salt bridged
atom
the HashMap for a single CONECT line contains the following fields:
connections - a List object specifying the connectionsgetConnections()@Deprecated List<Map<String,Integer>> getConnections()
Atom.getBonds() insteadsetConnections(java.util.List<java.util.Map<java.lang.String, java.lang.Integer>>)int 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()
@Deprecated void setNmr(boolean nmr)
nmr - true to declare that this Structure has been solved by NMR.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<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 - modelnr - 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 getChain(int pos)
pos - an int for the position in the List of Chains.Chain getChain(int modelnr, int pos)
pos - an intmodelnr - an intChain findChain(String chainId) throws StructureException
chainId - the ID of a chain that should be returnedStructureExceptionboolean hasChain(String chainId)
chainId - the name of the chainChain findChain(String chainId, int modelnr) throws StructureException
modelnr - the number of the model to usechainId - the ID of a chain that should be returnedStructureExceptionGroup findGroup(String chainId, String pdbResnum) throws StructureException
chainId - the ID of the chain to usepdbResnum - the PDB residue number of the requested groupStructureExceptionGroup findGroup(String chainId, String pdbResnum, int modelnr) throws StructureException
chainId - the ID of the chain to usepdbResnum - the PDB residue number of the requested groupmodelnr - the number of the model to useStructureExceptionChain getChainByPDB(String chainId) throws StructureException
chainId - the chain identifierStructureExceptionChain getChainByPDB(String chainId, int modelnr) throws StructureException
chainId - the chain identifiermodelnr - request a particular model;StructureExceptionString toPDB()
FileConvertString toMMCIF()
List<Compound> getCompounds()
void addCompound(Compound compound)
void setDBRefs(List<DBRef> dbrefs)
dbrefs - list of DBRef objectsList<DBRef> getDBRefs()
Compound getCompoundById(int molId)
molId - PDBHeader getPDBHeader()
boolean hasJournalArticle()
JournalArticle getJournalArticle()
void setJournalArticle(JournalArticle journalArticle)
journalArticle - List<Bond> getSSBonds()
void setSSBonds(List<Bond> ssbonds)
ssbonds - void addSSBond(Bond ssbond)
ssbond - void setPDBHeader(PDBHeader header)
header - the PDBHeader objectLong getId()
void setId(Long id)
id - void setBiologicalAssembly(boolean biologicalAssembly)
biologicalAssembly - true if biological assembly, otherwise falseboolean isBiologicalAssembly()
void setCrystallographicInfo(PDBCrystallographicInfo crystallographicInfo)
PDBCrystallographicInfo - 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–2016 BioJava. All rights reserved.