|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Structure
Interface for a structure object. Provides access to the data of a PDB file. A structure object allows to access the PDB header information as well as to the data from the ATOM records. The header information is currently available through the following objects:
The structure object provides access to the data from the ATOM records through a hierarchy of sub-object:Structure |For more documentation on how to work with the Structure API please see http://biojava.org/wiki/BioJava:CookBook#Protein_StructureChain
|Group
|Atom
Q: How can I get a Structure object from a PDB file?
A:
publicStructure
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:
public 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("amino"); AminoAcid
a;AminoAcid
b;AminoAcid
c ; for ( int i=0; i < groups.size(); i++){ // since we requested only groups of type "amino" 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)); }
Method Summary | |
---|---|
void |
addChain(Chain chain)
add a new chain. |
void |
addChain(Chain chain,
int modelnr)
add a new chain, if several models are available. |
void |
addModel(List<Chain> model)
add a new model. |
void |
addSSBond(SSBond ssbond)
add a single SSBond to this structure |
Structure |
clone()
returns 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 it's position within the Structure . |
Chain |
getChain(int pos,
int modelnr)
retrieve a chain by it's position within the Structure and model number. |
Chain |
getChainByPDB(String chainId)
request a chain by it's PDB code by default takes only the first model |
Chain |
getChainByPDB(String chainId,
int modelnr)
request a chain by it's 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(String molId)
request a particular compound by its id |
List<Compound> |
getCompounds()
get all the Compounds that are defined in the PDB Header |
List<Map<String,Integer>> |
getConnections()
Returns the connections value. |
List<DBRef> |
getDBRefs()
get the list of database references |
Map<String,Object> |
getHeader()
Deprecated. use getPDBHeader instead |
Long |
getId()
get the ID used by Hibernate |
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 |
List<SSBond> |
getSSBonds()
get the list of SSBonds as they have been defined in the PDB files |
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 |
isNmr()
test if this structure is an nmr structure. |
int |
nrModels()
return number of models . |
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 compounts |
void |
setConnections(List<Map<String,Integer>> connections)
sets/gets an List of Maps which corresponds to the CONECT lines in the PDB file: |
void |
setDBRefs(List<DBRef> dbrefs)
set the list of database references for this structure |
void |
setHeader(Map<String,Object> h)
set the Header data . |
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)
set NMR flag. |
void |
setPDBCode(String pdb_id)
set PDB code of structure . |
void |
setPDBHeader(PDBHeader header)
the the header information for this PDB file |
void |
setSSBonds(List<SSBond> ssbonds)
set the list of SSBonds for this structure |
int |
size()
return number of Chains in this Structure. |
int |
size(int modelnr)
return number of chains of model. |
String |
toPDB()
create a String that contains the contents of a PDB file . |
String |
toString()
String representation of object. |
Method Detail |
---|
Structure clone()
String toString()
toString
in class Object
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)
void setHeader(Map<String,Object> h)
h
- a Map object specifying the headergetHeader()
Map<String,Object> getHeader()
setHeader(java.util.Map)
,
getPDBHeader()
void setConnections(List<Map<String,Integer>> connections)
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 atomthe HashMap for a single CONECT line contains the following fields:
connections
- a List object specifying the connectionsgetConnections()
List<Map<String,Integer>> getConnections()
setConnections(java.util.List>)
int size()
int size(int modelnr)
modelnr
- an int specifying the number of the Model that should be used
int nrModels()
boolean isNmr()
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 int
getChains(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 int
getModel(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 pos, int modelnr)
pos
- an intmodelnr
- an int
Chain findChain(String chainId) throws StructureException
chainId
- the ID of a chain that should be returned
StructureException
boolean hasChain(String chainId)
chainId
- the name of the chain
Chain findChain(String chainId, int modelnr) throws StructureException
modelnr
- the number of the model to usechainId
- the ID of a chain that should be returned
StructureException
Group findGroup(String chainId, String pdbResnum) throws StructureException
chainId
- the ID of the chain to usepdbResnum
- the PDB residue number of the requested group
StructureException
Group 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 use
StructureException
Chain getChainByPDB(String chainId) throws StructureException
chainId
- the chain identifier
StructureException
Chain getChainByPDB(String chainId, int modelnr) throws StructureException
chainId
- the chain identifiermodelnr
- request a particular model;
StructureException
String toPDB()
FileConvert
void setCompounds(List<Compound> molList)
molList
- List<Compound> getCompounds()
void setDBRefs(List<DBRef> dbrefs)
dbrefs
- list of DBRef objectsList<DBRef> getDBRefs()
Compound getCompoundById(String molId)
molId
-
PDBHeader getPDBHeader()
boolean hasJournalArticle()
JournalArticle getJournalArticle()
void setJournalArticle(JournalArticle journalArticle)
journalArticle
- List<SSBond> getSSBonds()
void setSSBonds(List<SSBond> ssbonds)
ssbonds
- void addSSBond(SSBond ssbond)
ssbond
- void setPDBHeader(PDBHeader header)
header
- the PDBHeader objectLong getId()
void setId(Long id)
id
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |