org.biojava.bio.structure.io
Class PDBFileParser

java.lang.Object
  extended by org.biojava.bio.structure.io.PDBFileParser

public class PDBFileParser
extends Object

This class implements the actual PDB file parsing. Do not access it directly, but via the PDBFileReader class.

Parsing

During the PDBfile parsing several Flags can be set. See the setFileParsingParameters(FileParsingParameters) methods.

To provide excessive memory usage for large PDB files, there is the ATOM_CA_THRESHOLD. If more Atoms than this threshold are being parsed in a PDB file, the parser will automatically switch to a C-alpha only representation.

The result of the parsing of the PDB file is a new Structure object.

For more documentation on how to work with the Structure API please see http://biojava.org/wiki/BioJava:CookBook#Protein_Structure

Example

Q: How can I get a Structure object from a PDB file?

A:

 public Structure loadStructure(String pathToPDBFile){
            // The PDBFileParser is wrapped by the PDBFileReader
                PDBFileReader pdbreader = new PDBFileReader();

                Structure structure = null;
                try{
                        structure = pdbreader.getStructure(pathToPDBFile);
                        System.out.println(structure);
                } catch (IOException e) {
                        e.printStackTrace();
                }
                return structure;
        }
 

Since:
1.4
Author:
Andreas Prlic, Jules Jacobsen

Field Summary
static String HELIX
          Helix secondary structure assignment.
static String PDB_AUTHOR_ASSIGNMENT
          Secondary strucuture assigned by the PDB author/
static String STRAND
          Strand secondary structure assignment.
static String TURN
          Turn secondary structure assignment.
 
Constructor Summary
PDBFileParser()
           
 
Method Summary
 FileParsingParameters getFileParsingParameters()
           
protected  String getTimeStamp()
          Returns a time stamp.
 void linkChains2Compound(Structure s)
          After the parsing of a PDB file the Chain and Compound objects need to be linked to each other.
 Structure parsePDBFile(BufferedReader buf)
          parse a PDB file and return a datastructure implementing PDBStructure interface.
 Structure parsePDBFile(InputStream inStream)
          parse a PDB file and return a datastructure implementing PDBStructure interface.
 void setFileParsingParameters(FileParsingParameters params)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PDB_AUTHOR_ASSIGNMENT

public static final String PDB_AUTHOR_ASSIGNMENT
Secondary strucuture assigned by the PDB author/

See Also:
Constant Field Values

HELIX

public static final String HELIX
Helix secondary structure assignment.

See Also:
Constant Field Values

STRAND

public static final String STRAND
Strand secondary structure assignment.

See Also:
Constant Field Values

TURN

public static final String TURN
Turn secondary structure assignment.

See Also:
Constant Field Values
Constructor Detail

PDBFileParser

public PDBFileParser()
Method Detail

getTimeStamp

protected String getTimeStamp()
Returns a time stamp.

Returns:
a String representing the time stamp value

parsePDBFile

public Structure parsePDBFile(InputStream inStream)
                       throws IOException
parse a PDB file and return a datastructure implementing PDBStructure interface.

Parameters:
inStream - an InputStream object
Returns:
a Structure object
Throws:
IOException

parsePDBFile

public Structure parsePDBFile(BufferedReader buf)
                       throws IOException
parse a PDB file and return a datastructure implementing PDBStructure interface.

Parameters:
buf - a BufferedReader object
Returns:
the Structure object
Throws:
IOException - ...

linkChains2Compound

public void linkChains2Compound(Structure s)
After the parsing of a PDB file the Chain and Compound objects need to be linked to each other.

Parameters:
s - the structure

setFileParsingParameters

public void setFileParsingParameters(FileParsingParameters params)

getFileParsingParameters

public FileParsingParameters getFileParsingParameters()