Package ffx.potential.parsers
Class PDBFilter
java.lang.Object
ffx.potential.parsers.SystemFilter
ffx.potential.parsers.PDBFilter
The PDBFilter class parses data from a Protein DataBank (*.PDB) file. The following records are
recognized: ANISOU, ATOM, CONECT, CRYST1, END, HELIX, HETATM, LINK, SHEET, SSBOND, REMARK. The
rest are currently ignored.
- Since:
- 1.0
- Author:
- Michael J. Schnieders
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static enum
Presently, VERSION3_3 is default, and VERSION3_2 is anything non-standard.Nested classes/interfaces inherited from class ffx.potential.parsers.SystemFilter
SystemFilter.Versioning
-
Field Summary
Fields inherited from class ffx.potential.parsers.SystemFilter
atomList, bondList, dieOnMissingAtom, fileRead, files, fileType, forceField, lambdaPattern, properties, standardizeAtomNames, systems, vdwH
-
Constructor Summary
ConstructorDescriptionPDBFilter
(File file, MolecularAssembly molecularAssembly, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties) Parse the PDB File from a URL.PDBFilter
(File file, MolecularAssembly molecularAssembly, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties, List<Integer> resNumberList) Constructor for PDBFilter with residue numbers.PDBFilter
(File file, List<MolecularAssembly> molecularAssemblies, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties) Parse the PDB File from a URL.PDBFilter
(List<File> files, MolecularAssembly molecularAssembly, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties) Constructor for PDBFilter. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clearSegIDsvoid
Attempts to close any open resources associated with the underlying file; primarily to be used when finished reading a trajectory.int
Get the list of alternate locations encountered.Gets the last read lambda value read by the filter, if any.String[]
Returns all the remark lines found by the last readFile call.int
Return snapshot number.void
mutate
(List<PDBFilter.Mutation> mutations) Mutate residue(s) as the PDB file is being parsed.boolean
readFile()
Parse the PDB Fileboolean
readNext()
Reads the next model if applicable (currently, ARC and PDB files only).boolean
readNext
(boolean resetPosition) Reads the next model if applicable (currently, ARC files only).boolean
readNext
(boolean resetPosition, boolean print) Reads the next model if applicable (currently, ARC files only).boolean
readNext
(boolean resetPosition, boolean print, boolean parse) Reads the next model if applicable (currently, ARC files only).void
setAltID
(MolecularAssembly molecularAssembly, Character altLoc) Specify the alternate location.void
setConstantPH
(boolean constantPH) void
setLMN
(int[] lmn) void
setLogWrites
(boolean logWrites) Sets whether this PDBFilter should log each time it saves to a file.void
setModelNumbering
(int modelsWritten) setModelNumbering.void
setRotamerTitration
(boolean rotamerTitration) void
setSymOp
(int symOp) setSymOp.static String
toPDBAtomLine
(Atom atom) Simple method useful for converting files to PDB format.boolean
This method is different for each subclass and must be overridden.boolean
Writes out the atomic information in PDB format.boolean
writeFileboolean
This method is different for each subclass and must be overridden.boolean
writeFileboolean
writeFile
(File saveFile, boolean append, Set<Atom> toExclude, boolean writeEnd, boolean versioning, String[] extraLines) writeFileboolean
writeFileAsP1
(File file) Expand the current system to P1 during the save operation.boolean
writeFileWithHeader
(File saveFile, String header) writeFileWithHeader.boolean
writeFileWithHeader
(File saveFile, StringBuilder header) writeFileWithHeader.boolean
writeFileWithHeader
(File saveFile, String header, boolean append) writeFileWithHeader.Methods inherited from class ffx.potential.parsers.SystemFilter
applyAtomProperties, atomListToSet, fileRead, getActiveMolecularSystem, getAtomList, getFile, getFiles, getMolecularAssemblyArray, getType, previousVersion, setFile, setFileRead, setFiles, setForceField, setProperties, setType, setVersioning, version
-
Constructor Details
-
PDBFilter
public PDBFilter(List<File> files, MolecularAssembly molecularAssembly, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties) Constructor for PDBFilter.- Parameters:
files
- aList
object.molecularAssembly
- aMolecularAssembly
object.forceField
- aForceField
object.properties
- aCompositeConfiguration
object.
-
PDBFilter
public PDBFilter(File file, MolecularAssembly molecularAssembly, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties) Parse the PDB File from a URL.- Parameters:
file
- aFile
object.molecularAssembly
- aMolecularAssembly
object.forceField
- aForceField
object.properties
- aCompositeConfiguration
object.
-
PDBFilter
public PDBFilter(File file, List<MolecularAssembly> molecularAssemblies, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties) Parse the PDB File from a URL.- Parameters:
file
- aFile
object.molecularAssemblies
- aList
object.forceField
- aForceField
object.properties
- aCompositeConfiguration
object.
-
PDBFilter
public PDBFilter(File file, MolecularAssembly molecularAssembly, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties, List<Integer> resNumberList) Constructor for PDBFilter with residue numbers.- Parameters:
file
- aList
object.molecularAssembly
- aMolecularAssembly
object.forceField
- aForceField
object.properties
- aCompositeConfiguration
object.resNumberList
- a List of integer residue numbers for constant pH rotamer optimization.
-
-
Method Details
-
toPDBAtomLine
Simple method useful for converting files to PDB format.- Parameters:
atom
- aAtom
object.- Returns:
- Returns a PDB ATOM or HETATM record for the passed Atom.
-
setConstantPH
public void setConstantPH(boolean constantPH) -
setRotamerTitration
public void setRotamerTitration(boolean rotamerTitration) -
clearSegIDs
public void clearSegIDs()clearSegIDs -
closeReader
public void closeReader()Attempts to close any open resources associated with the underlying file; primarily to be used when finished reading a trajectory.- Specified by:
closeReader
in classSystemFilter
-
countNumModels
public int countNumModels()- Overrides:
countNumModels
in classSystemFilter
-
getAltLocs
Get the list of alternate locations encountered.- Returns:
- the alternate location list.
-
getLastReadLambda
Gets the last read lambda value read by the filter, if any.- Overrides:
getLastReadLambda
in classSystemFilter
- Returns:
- Last lambda value read by this filter.
-
getRemarkLines
Returns all the remark lines found by the last readFile call.- Overrides:
getRemarkLines
in classSystemFilter
- Returns:
- Remark lines from the last readFile call.
-
getSnapshot
public int getSnapshot()Description copied from class:SystemFilter
Return snapshot number.- Overrides:
getSnapshot
in classSystemFilter
- Returns:
- The snapshot number.
-
mutate
Mutate residue(s) as the PDB file is being parsed.- Parameters:
mutations
- aList
object.
-
readFile
public boolean readFile()Parse the PDB File- Specified by:
readFile
in classSystemFilter
- Returns:
- a boolean.
-
readNext
public boolean readNext()Reads the next model if applicable (currently, ARC and PDB files only).- Specified by:
readNext
in classSystemFilter
- Returns:
- If next model read.
-
readNext
public boolean readNext(boolean resetPosition) Reads the next model if applicable (currently, ARC files only).- Specified by:
readNext
in classSystemFilter
- Parameters:
resetPosition
- Resets to first frame.- Returns:
- If next model read.
-
readNext
public boolean readNext(boolean resetPosition, boolean print) Reads the next model if applicable (currently, ARC files only).- Specified by:
readNext
in classSystemFilter
- Parameters:
resetPosition
- Resets to first frame.print
- Flag to print.- Returns:
- If next model read.
-
readNext
public boolean readNext(boolean resetPosition, boolean print, boolean parse) Reads the next model if applicable (currently, ARC files only).- Specified by:
readNext
in classSystemFilter
- Parameters:
resetPosition
- Resets to first frame.print
- Flag to print.parse
- Parse data in file. May want to skip structures for parallel jobs.- Returns:
- If next model read.
-
setAltID
Specify the alternate location.- Parameters:
molecularAssembly
- The MolecularAssembly to populate.altLoc
- The alternate location to use.
-
setLogWrites
public void setLogWrites(boolean logWrites) Sets whether this PDBFilter should log each time it saves to a file.- Parameters:
logWrites
- a boolean.
-
setModelNumbering
public void setModelNumbering(int modelsWritten) setModelNumbering.- Parameters:
modelsWritten
- the number of models written.
-
setLMN
public void setLMN(int[] lmn) -
setSymOp
public void setSymOp(int symOp) setSymOp.- Parameters:
symOp
- a int.
-
writeFileAsP1
Expand the current system to P1 during the save operation.- Parameters:
file
- The file to write.- Returns:
- Return true on a successful write.
-
writeFile
writeFile- Parameters:
saveFile
- aFile
object.append
- Whether to append to saveFile (vs over-write).printLinear
- Ignored (remains to present a different method signature).writeEnd
- True if this is the final model.- Returns:
- Success of writing.
-
writeFile
public boolean writeFile(File saveFile, boolean append, Set<Atom> toExclude, boolean writeEnd, boolean versioning) writeFile- Parameters:
saveFile
- aFile
object to save to.append
- Whether to append to saveFile (vs over-write).toExclude
- ASet
ofAtom
s to exclude from writing.writeEnd
- True if this is the final model.versioning
- True if the file being saved to should be versioned. False if the file being saved to should be overwritten.- Returns:
- Success of writing.
-
writeFile
public boolean writeFile(File saveFile, boolean append, Set<Atom> toExclude, boolean writeEnd, boolean versioning, String[] extraLines) writeFile- Parameters:
saveFile
- aFile
object to save to.append
- Whether to append to saveFile (vs over-write).toExclude
- ASet
ofAtom
s to exclude from writing.writeEnd
- True if this is the final model.versioning
- True if the file being saved to should be versioned. False if the file being saved to should be overwritten.extraLines
- Extra comment/header lines to write.- Returns:
- Success of writing.
-
writeFile
This method is different for each subclass and must be overridden.If the append flag is true, "saveFile" will be appended to. Otherwise, the default versioning scheme will be applied.
Write out the Atomic information in PDB format.
- Overrides:
writeFile
in classSystemFilter
- Parameters:
saveFile
- aFile
object.append
- a boolean.- Returns:
- a boolean.
-
writeFile
Description copied from class:SystemFilter
This method is different for each subclass and must be overridden.If the append flag is true, "saveFile" will be appended to. Otherwise, the default versioning scheme will be applied.
- Specified by:
writeFile
in classSystemFilter
- Parameters:
saveFile
- aFile
object.append
- a boolean.extraLines
- Additional lines to append to a comments section, or null.- Returns:
- a boolean.
-
writeFile
Writes out the atomic information in PDB format.- Parameters:
saveFile
- The file to save information to.append
- True if the current data should be appended to the saveFile (as in arc files).versioning
- True if the saveFile should be versioned. False if the saveFile should be overwritten.- Returns:
- Success of writing.
-
writeFileWithHeader
writeFileWithHeader. -
writeFileWithHeader
writeFileWithHeader. -
writeFileWithHeader
writeFileWithHeader.- Parameters:
saveFile
- aFile
object.header
- aStringBuilder
object.- Returns:
- a boolean.
-