Package org.biojava.nbio.structure.io
Class PDBFileParser
- java.lang.Object
-
- org.biojava.nbio.structure.io.PDBFileParser
-
public class PDBFileParser extends java.lang.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 thesetFileParsingParameters(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
For more documentation on how to work with the Structure API please see http://biojava.org/wiki/BioJava:CookBook#Protein_StructureStructure
object.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 PDBFileReaderPDBFileReader
pdbreader = newPDBFileReader
();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, Jose Duarte
-
-
Constructor Summary
Constructors Constructor Description PDBFileParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileParsingParameters
getFileParsingParameters()
void
linkChains2Compound(Structure s)
Structure
parsePDBFile(java.io.BufferedReader buf)
Parse a PDB file and return a datastructure implementing PDBStructure interface.Structure
parsePDBFile(java.io.InputStream inStream)
Parse a PDB file and return a datastructure implementing PDBStructure interface.void
setFileParsingParameters(FileParsingParameters params)
-
-
-
Method Detail
-
parsePDBFile
public Structure parsePDBFile(java.io.InputStream inStream) throws java.io.IOException
Parse a PDB file and return a datastructure implementing PDBStructure interface.- Parameters:
inStream
- an InputStream object- Returns:
- a Structure object
- Throws:
java.io.IOException
-
parsePDBFile
public Structure parsePDBFile(java.io.BufferedReader buf) throws java.io.IOException
Parse a PDB file and return a datastructure implementing PDBStructure interface.- Parameters:
buf
- a BufferedReader object- Returns:
- the Structure object
- Throws:
java.io.IOException
- ...
-
linkChains2Compound
public void linkChains2Compound(Structure s)
- Parameters:
s
- the structure
-
setFileParsingParameters
public void setFileParsingParameters(FileParsingParameters params)
-
getFileParsingParameters
public FileParsingParameters getFileParsingParameters()
-
-