org.biojava.bio.structure.server
Class FlatFileInstallation

java.lang.Object
  extended by org.biojava.bio.structure.server.FlatFileInstallation
All Implemented Interfaces:
PDBInstallation

public class FlatFileInstallation
extends java.lang.Object
implements PDBInstallation

a PDB installation that reads all files from one directory in the file system. and keeps several files with the information parsed from the PDB headers for easier data access.
In particular these files are:

In order to create these index files for this PDB installation, please see the PrepareIndexFile class.

Author:
Andreas Prlic
See Also:
PrepareIndexFile

Field Summary
static java.text.SimpleDateFormat dateFormat
           
static java.lang.String DEFAUL_CHAIN_FILE
           
static java.lang.String DEFAULT_INDEX_FILE
           
static java.util.logging.Logger logger
           
 
Constructor Summary
FlatFileInstallation(java.io.File filePath)
          create a new FlatFile Installation and point it to the directory that contains all PDB files
 
Method Summary
 void addPDBFilter(PDBFilter filter)
          add a filter for PDB files.
 void applyFilters()
           
 void clearFilters()
          remove all filters, next time getAll is called, it will return all available PDBs
 java.util.List<PDBHeader> getAll()
          get all PDBHeaders that pass the added Filters, if no filters have been added returns all available PDBs
 java.io.File getChainInfoFile()
           
 java.io.File getFilePath()
           
 PDBHeader getPDBHeader(java.lang.String pdbId)
          get the PDB header for a single protein structure
 java.io.File getPDBInfoFile()
           
 Structure getStructure(java.lang.String pdbId)
          request a structure by its PDB identifier
 boolean hasNext()
          return if the iteration over all structures will return another structure
 Structure next()
          iterate over all structures in this Installation that pass the provided filters and return the next one in the list.
 void setChainInfoFile(java.io.File chainInfoFile)
           
 void setFilePath(java.io.File filePath)
           
 void setPDBInfoFile(java.io.File indexFile)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static final java.util.logging.Logger logger

DEFAULT_INDEX_FILE

public static final java.lang.String DEFAULT_INDEX_FILE
See Also:
Constant Field Values

DEFAUL_CHAIN_FILE

public static final java.lang.String DEFAUL_CHAIN_FILE
See Also:
Constant Field Values

dateFormat

public static java.text.SimpleDateFormat dateFormat
Constructor Detail

FlatFileInstallation

public FlatFileInstallation(java.io.File filePath)
create a new FlatFile Installation and point it to the directory that contains all PDB files

Parameters:
filePath -
Method Detail

getPDBInfoFile

public java.io.File getPDBInfoFile()

setPDBInfoFile

public void setPDBInfoFile(java.io.File indexFile)

getChainInfoFile

public java.io.File getChainInfoFile()

setChainInfoFile

public void setChainInfoFile(java.io.File chainInfoFile)

getFilePath

public java.io.File getFilePath()

setFilePath

public void setFilePath(java.io.File filePath)

addPDBFilter

public void addPDBFilter(PDBFilter filter)
Description copied from interface: PDBInstallation
add a filter for PDB files. THis can be used to request, e.g. all X-ray structures, or all structures with a given resolution, all proteins with a certain function, etc.

Specified by:
addPDBFilter in interface PDBInstallation
Parameters:
filter - the filter to apply when getAll is being called.
See Also:
PDBInstallation.getAll()

clearFilters

public void clearFilters()
Description copied from interface: PDBInstallation
remove all filters, next time getAll is called, it will return all available PDBs

Specified by:
clearFilters in interface PDBInstallation

applyFilters

public void applyFilters()

getAll

public java.util.List<PDBHeader> getAll()
Description copied from interface: PDBInstallation
get all PDBHeaders that pass the added Filters, if no filters have been added returns all available PDBs

Specified by:
getAll in interface PDBInstallation
Returns:
a list of PDBHeader objects

getPDBHeader

public PDBHeader getPDBHeader(java.lang.String pdbId)
Description copied from interface: PDBInstallation
get the PDB header for a single protein structure

Specified by:
getPDBHeader in interface PDBInstallation
Returns:
the PDB header object

getStructure

public Structure getStructure(java.lang.String pdbId)
Description copied from interface: PDBInstallation
request a structure by its PDB identifier

Specified by:
getStructure in interface PDBInstallation
Returns:
the structure for the pdbId

hasNext

public boolean hasNext()
Description copied from interface: PDBInstallation
return if the iteration over all structures will return another structure

Specified by:
hasNext in interface PDBInstallation
Returns:
true if there is another structure that has not been iterated over yet

next

public Structure next()
Description copied from interface: PDBInstallation
iterate over all structures in this Installation that pass the provided filters and return the next one in the list.

Specified by:
next in interface PDBInstallation
Returns:
the next structure