public class PDBFileParser
extends java.lang.Object
setParseCAOnly(boolean)
- parse only the Atom records for C-alpha atomssetParseSecStruc(boolean)
- a flag if the secondary structure information from the PDB file (author's assignment) should be parsed.
If true the assignment can be accessed through AminoAcid
.getSecStruc(); setAlignSeqRes(boolean)
- should the AminoAcid sequences from the SEQRES
and ATOM records of a PDB file be aligned? (default:yes)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.
Q: How can I get a Structure object from a PDB file?
A:
publicStructure
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; }
Modifier and Type | Field and Description |
---|---|
static int |
ATOM_CA_THRESHOLD
the maximum number of atoms that will be parsed before the parser switches to a CA-only
representation of the PDB file.
|
static java.lang.String |
HELIX
Helix secondary structure assignment.
|
static int |
MAX_ATOMS
the maximum number of atoms we will add to a structure
this protects from memory overflows in the few really big protein structures.
|
boolean |
parseCAOnly
Set the flag to only read in Ca atoms - this is useful for parsing large structures like 1htq.
|
static java.lang.String |
PDB_AUTHOR_ASSIGNMENT
Secondary strucuture assigned by the PDB author/
|
static java.lang.String |
STRAND
Strand secondary structure assignment.
|
static java.lang.String |
TURN
Turn secondary structure assignment.
|
Constructor and Description |
---|
PDBFileParser() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getTimeStamp()
Returns a time stamp.
|
boolean |
isAlignSeqRes()
Flag if the SEQRES amino acids should be aligned with the ATOM amino acids.
|
boolean |
isParseCAOnly()
the flag if only the C-alpha atoms of the structure should be parsed.
|
boolean |
isParseSecStruc()
is secondary structure assignment being parsed from the file?
default is null
|
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 |
setAlignSeqRes(boolean alignSeqRes)
define if the SEQRES in the structure should be aligned with the ATOM records
if yes, the AminoAcids in structure.getSeqRes will have the coordinates set.
|
void |
setParseCAOnly(boolean parseCAOnly)
the flag if only the C-alpha atoms of the structure should be parsed.
|
void |
setParseSecStruc(boolean parseSecStruc)
a flag to tell the parser to parse the Author's secondary structure assignment from the file
default is set to false, i.e.
|
public static final java.lang.String PDB_AUTHOR_ASSIGNMENT
public static final java.lang.String HELIX
public static final java.lang.String STRAND
public static final java.lang.String TURN
public static final int ATOM_CA_THRESHOLD
public static final int MAX_ATOMS
public boolean parseCAOnly
public boolean isParseCAOnly()
public void setParseCAOnly(boolean parseCAOnly)
parseCAOnly
- boolean flag to enable or disable C-alpha only parsingpublic boolean isAlignSeqRes()
public void setAlignSeqRes(boolean alignSeqRes)
alignSeqRes
- public boolean isParseSecStruc()
public void setParseSecStruc(boolean parseSecStruc)
parseSecStruc
- if HELIX STRAND and TURN fields are being parsedprotected java.lang.String getTimeStamp()
public Structure parsePDBFile(java.io.InputStream inStream) throws java.io.IOException
inStream
- an InputStream objectjava.io.IOException
public Structure parsePDBFile(java.io.BufferedReader buf) throws java.io.IOException
buf
- a BufferedReader objectjava.io.IOException
- ...public void linkChains2Compound(Structure s)
s
- the structure