org.proteinshader.structure.io
Class PDBStructureReader

java.lang.Object
  extended by org.proteinshader.structure.io.PDBStructureReader
All Implemented Interfaces:
StructureReader

public class PDBStructureReader
extends Object
implements StructureReader

This concrete implementation of interface StructureReader reads a protein structure entry from a '.pdb' file formated according to the PDB Contents Guide (Version 2.2, 20 Dec 1996) and creates a Structure.

The first line of the file must start with 'HEADER' to indicate a PDB header record, and a complete list of the record types that need to be recognized are specified in the RecordEnum enumeration of package io.enums. A PDBLineParser is used to assist the readFile() method.

Currently, PDBStructureReader only reads protein (amino acids and heterogens). It does not read DNA, but that capability will be added at a later time (beyond the scope of this thesis).


Field Summary
static int MIN_CHAR_IN_HEADER
          The minimum number of columns in a HEADER record.
 
Constructor Summary
PDBStructureReader()
          Creates a PDBStructureReader.
 
Method Summary
 List<String> getBadLines()
          Returns a list with any bad lines that were found the last time readStructure() was called.
 Structure readStructure(File file)
          Reads a protein structure from a ".pdb" file and returns a Structure object.
 Structure readStructure(String filename)
          Reads a protein structure from a ".pdb" file and returns a Structure object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_CHAR_IN_HEADER

public static final int MIN_CHAR_IN_HEADER
The minimum number of columns in a HEADER record.

See Also:
Constant Field Values
Constructor Detail

PDBStructureReader

public PDBStructureReader()
Creates a PDBStructureReader.

Method Detail

readStructure

public Structure readStructure(String filename)
                        throws StructureReaderException
Reads a protein structure from a ".pdb" file and returns a Structure object.

The first line of a PDB formatted file must be a HEADER record with a PDB ID code. A StructureReaderException will be thrown if a problem occurs.

Serious errors which prevent obtaining a Structure will result in a StructureReaderException (e.g., The file cannot be found or does not appear to be a PDB formatted file). Errors such as a bad individual record (a single line) will be recorded in a list of bad lines that can be obtained with the getBadLines() method.

Specified by:
readStructure in interface StructureReader
Parameters:
filename - the name of the PDB formatted file to read.
Returns:
The newly created Structure.
Throws:
StructureReaderException - if a serious error occurs while parsing the PDB file.

readStructure

public Structure readStructure(File file)
                        throws StructureReaderException
Reads a protein structure from a ".pdb" file and returns a Structure object.

The first line of a PDB formatted file must be a HEADER record with a PDB ID code. A StructureReaderException will be thrown if a problem occurs.

Serious errors which prevent obtaining a Structure will result in a StructureReaderException (e.g., The file cannot be found or does not appear to be a PDB formatted file). Errors such as a bad individual record (a single line) will be recorded in a list of bad lines that can be obtained with the getBadLines() method.

Specified by:
readStructure in interface StructureReader
Parameters:
file - the PDB formatted file to read.
Returns:
The newly created Structure.
Throws:
StructureReaderException - if a serious error occurs while parsing the PDB file.

getBadLines

public List<String> getBadLines()
Returns a list with any bad lines that were found the last time readStructure() was called.

Specified by:
getBadLines in interface StructureReader
Returns:
A list of invalid lines from a PDB formatted file.


Copyright © 2007-2008