|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.bio.structure.io.PDBFileReader
public class PDBFileReader
The wrapper class for parsing a PDB file.
Several flags can be set for this class
setAutoFetch(boolean)
- if the PDB file can not be found locally, should it be fetched
from the PDB ftp servers? (default:false)setFileParsingParameters(FileParsingParameters)
Q: How can I get a Structure object from a PDB file?
A:
publicAccess PDB files from a directory, take care of compressed PDB filesStructure
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; }
publicStructure
loadStructureById() { String path = "/path/to/PDB/directory/";PDBFileReader
pdbreader = newPDBFileReader
(); pdbreader.setPath(path);Structure
structure = null; try { structure = pdbreader.getStructureById("5pti"); } catch (IOException e){ e.printStackTrace(); } return structure; }
Field Summary | |
---|---|
static String |
DEFAULT_PDB_FILE_SERVER
|
static String |
lineSplit
|
static String |
LOAD_CHEM_COMP_PROPERTY
|
static String |
PDB_FILE_SERVER_PROPERTY
|
Constructor Summary | |
---|---|
PDBFileReader()
|
Method Summary | |
---|---|
void |
addExtension(String s)
define supported file extensions compressed extensions .Z,.gz do not need to be specified they are dealt with automatically. |
void |
clearExtensions()
clear the supported file extensions |
FileParsingParameters |
getFileParsingParameters()
Get the parameters that should be used for file parsing |
String |
getPath()
Returns the path value. |
Structure |
getStructure(File filename)
opens filename, parses it and returns a Structure object |
Structure |
getStructure(String filename)
opens filename, parses it and returns aStructure object . |
Structure |
getStructure(URL u)
|
Structure |
getStructureById(String pdbId)
load a structure from local file system and return a PDBStructure object |
boolean |
isAutoFetch()
Fetch files automatically from FTP server. |
boolean |
isFetchCurrent()
N.B. This feature won't work unless the structure wasn't found & autoFetch is set to true . |
boolean |
isFetchFileEvenIfObsolete()
forces the reader to fetch the file if its status is OBSOLETE. |
boolean |
isPdbDirectorySplit()
Flag that defines if the PDB directory is containing all PDB files or is split into sub dirs (like the FTP site). |
static void |
main(String[] args)
|
void |
setAutoFetch(boolean autoFetch)
Tell the parser to fetch missing PDB files from the FTP server automatically. |
void |
setBioAssemblyFallback(boolean bioAssemblyFallback)
Set bioAssemblyFallback to true, to download the original PDB file in cases that a biological assembly file is not available. |
void |
setBioAssemblyId(int bioAssemblyId)
Sets the ID of the biological assembly to be loaded. |
void |
setFetchCurrent(boolean fetchNewestCurrent)
if enabled, the reader searches for the newest possible PDB ID, if not present in he local installation. |
void |
setFetchFileEvenIfObsolete(boolean fetchFileEvenIfObsolete)
N.B. This feature won't work unless the structure wasn't found & autoFetch is set to true . |
void |
setFileParsingParameters(FileParsingParameters params)
Set the parameters that should be used for file parsing |
void |
setPath(String p)
directory where to find PDB files |
void |
setPdbDirectorySplit(boolean pdbDirectorySplit)
Flag that defines if the PDB directory is containing all PDB files or is split into sub dirs (like the FTP site). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String LOAD_CHEM_COMP_PROPERTY
public static final String lineSplit
public static final String DEFAULT_PDB_FILE_SERVER
public static final String PDB_FILE_SERVER_PROPERTY
Constructor Detail |
---|
public PDBFileReader()
Method Detail |
---|
public static void main(String[] args)
public void setPath(String p)
setPath
in interface StructureIOFile
p
- a String specifying the path valuepublic String getPath()
getPath
in interface StructureIOFile
setPath(java.lang.String)
public void addExtension(String s)
addExtension
in interface StructureIOFile
s
- a String ...public void clearExtensions()
clearExtensions
in interface StructureIOFile
public boolean isPdbDirectorySplit()
isPdbDirectorySplit
in interface StructureIOFile
public void setPdbDirectorySplit(boolean pdbDirectorySplit)
setPdbDirectorySplit
in interface StructureIOFile
pdbDirectorySplit
- boolean. If set to false all files are in one directory.public void setBioAssemblyId(int bioAssemblyId)
bioAssemblyId
- ID of the biological assembly to be loadedpublic void setBioAssemblyFallback(boolean bioAssemblyFallback)
bioAssemblyFallback
- if true, tries reading original PDB file in case the biological assembly file is not availablepublic Structure getStructureById(String pdbId) throws IOException
getStructureById
in interface StructureIO
getStructureById
in interface StructureIOFile
pdbId
- a String specifying the id value (PDB code)
IOException
- ...public Structure getStructure(String filename) throws IOException
getStructure
in interface StructureIOFile
filename
- a String
IOException
- ...public Structure getStructure(File filename) throws IOException
getStructure
in interface StructureIOFile
filename
- a File object
IOException
- ...public Structure getStructure(URL u) throws IOException
IOException
public void setFileParsingParameters(FileParsingParameters params)
StructureIOFile
setFileParsingParameters
in interface StructureIOFile
params
- FileParsingParameterspublic FileParsingParameters getFileParsingParameters()
StructureIOFile
getFileParsingParameters
in interface StructureIOFile
public boolean isAutoFetch()
StructureIOFile
isAutoFetch
in interface StructureIOFile
public void setAutoFetch(boolean autoFetch)
StructureIOFile
setAutoFetch
in interface StructureIOFile
autoFetch
- flag.public void setFetchFileEvenIfObsolete(boolean fetchFileEvenIfObsolete)
true
.
fetchFileEvenIfObsolete
- the fetchFileEvenIfObsolete to setpublic boolean isFetchFileEvenIfObsolete()
setFetchCurrent(boolean)
. true
.
fetchCurrent
public void setFetchCurrent(boolean fetchNewestCurrent)
setFetchFileEvenIfObsolete(boolean)
function has a higher priority than this function. true
.
fetchCurrent
- the fetchCurrent to setsetFetchFileEvenIfObsolete(boolean)
public boolean isFetchCurrent()
true
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |