|
||||||||||
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.
Q: How can I get a Structure object from a PDB file?
A:
String filename = "path/to/pdbfile.ent" ; PDBFileReader pdbreader = new PDBFileReader(); try{ Structure struc = pdbreader.getStructure(filename); System.out.println(struc); } catch (Exception e) { e.printStackTrace(); }
Q: How can I calculate Phi and Psi angles of the AminoAcids?
A:
ArrayList chains = (ArrayList)struc.getModel(0); Chain tmpchn = (Chain)chains.get(0) ; ArrayList aminos = tmpchn.getGroups("amino"); AminoAcid a; AminoAcid b; AminoAcid c ; for ( int i=0; i < aminos.size(); i++){ b = (AminoAcid)aminos.get(i); double phi =360.0; double psi =360.0; if ( i > 0) { a = (AminoAcid)aminos.get(i-1) ; try { phi = Calc.getPhi(a,b); } catch (StructureException e){ e.printStackTrace(); phi = 360.0 ; } } if ( i < aminos.size()-1) { c = (AminoAcid)aminos.get(i+1) ; try { psi = Calc.getPsi(b,c); }catch (StructureException e){ e.printStackTrace(); psi = 360.0 ; } } String str = b.getPDBCode() + " " + b.getPDBName() + ":" ; str += "\tphi: " + phi + "\tpsi: " + psi; System.out.println(str);
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(java.util.List model)
add a new model. |
java.lang.Object |
clone()
returns an identical copy of this structure . |
Chain |
findChain(java.lang.String chainId)
request a particular chain from a structure. |
Chain |
findChain(java.lang.String chainId,
int modelnr)
request a particular chain from a particular model |
Group |
findGroup(java.lang.String chainId,
java.lang.String pdbResnum)
request a particular group from a structure. |
Group |
findGroup(java.lang.String chainId,
java.lang.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(java.lang.String chainId)
request a chain by it's PDB code by default takes only the first model |
Chain |
getChainByPDB(java.lang.String chainId,
int modelnr)
request a chain by it's PDB code by default takes only the first model |
java.util.List |
getChains(int modelnr)
retrieve all chains of a model. |
java.util.List |
getConnections()
Returns the connections value. |
java.util.Map |
getHeader()
get Header data . |
java.util.List |
getModel(int modelnr)
retrieve all Chains belonging to a model . |
java.lang.String |
getName()
get biological name of Structure. |
java.lang.String |
getPDBCode()
get PDB code of structure. |
boolean |
hasChain(java.lang.String chainId)
check if a chain with the id chainId is contained in this structure. |
boolean |
isNmr()
test if this structure is an nmr structure. |
int |
nrModels()
return number of models . |
void |
setConnections(java.util.List connections)
sets/gets an List of Maps which corresponds to the CONECT lines in the PDB file: |
void |
setHeader(java.util.Map h)
set the Header data . |
void |
setName(java.lang.String name)
set biological name of Structure . |
void |
setNmr(boolean nmr)
set NMR flag. |
void |
setPDBCode(java.lang.String pdb_id)
set PDB code of structure . |
int |
size()
return number of Chains in this Structure. |
int |
size(int modelnr)
return number of chains of model. |
java.lang.String |
toPDB()
create a String that contains the contents of a PDB file . |
java.lang.String |
toString()
String representation of object. |
Method Detail |
---|
java.lang.Object clone()
java.lang.String toString()
toString
in class java.lang.Object
void setPDBCode(java.lang.String pdb_id)
pdb_id
- a String specifying the PDBCodegetPDBCode()
java.lang.String getPDBCode()
setPDBCode(java.lang.String)
void setName(java.lang.String name)
name
- a String specifying the biological name of the StructuregetName()
java.lang.String getName()
setName(java.lang.String)
void setHeader(java.util.Map h)
h
- a Map object specifying the headergetHeader()
java.util.Map getHeader()
setHeader(java.util.Map)
void setConnections(java.util.List 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()
java.util.List 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(java.util.List model)
model
- a List object containing the Chains of the new Modeljava.util.List getModel(int modelnr)
modelnr
- an int
getChains(int)
java.util.List getChains(int modelnr)
modelnr
- an int
getModel(int)
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(java.lang.String chainId) throws StructureException
chainId
- the ID of a chain that should be returned
StructureException
boolean hasChain(java.lang.String chainId)
chainId
- the name of the chain
Chain findChain(java.lang.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(java.lang.String chainId, java.lang.String pdbResnum) throws StructureException
chainId
- the ID of the chain to usepdbResnum
- the PDB residue number of the requested group
StructureException
Group findGroup(java.lang.String chainId, java.lang.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(java.lang.String chainId) throws StructureException
chainId
- the chain identifier
StructureException
Chain getChainByPDB(java.lang.String chainId, int modelnr) throws StructureException
chainId
- the chain identifiermodelnr
- request a particular model;
StructureException
java.lang.String toPDB()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |