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
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enumPresently, 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
ConstructorsConstructorDescriptionPDBFilter(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 TypeMethodDescriptionvoidclearSegIDsvoidAttempts to close any open resources associated with the underlying file; primarily to be used when finished reading a trajectory.intGet 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.intReturn snapshot number.voidmutate(List<PDBFilter.Mutation> mutations) Mutate residue(s) as the PDB file is being parsed.booleanreadFile()Parse the PDB FilebooleanreadNext()Reads the next model if applicable (currently, ARC and PDB files only).booleanreadNext(boolean resetPosition) Reads the next model if applicable (currently, ARC files only).booleanreadNext(boolean resetPosition, boolean print) Reads the next model if applicable (currently, ARC files only).booleanreadNext(boolean resetPosition, boolean print, boolean parse) Reads the next model if applicable (currently, ARC files only).voidvoidsetAltID(MolecularAssembly molecularAssembly, Character altLoc) Specify the alternate location.voidsetConstantPH(boolean constantPH) voidsetLMN(int[] lmn) voidsetLogWrites(boolean logWrites) Sets whether this PDBFilter should log each time it saves to a file.voidsetModelNumbering(int modelsWritten) setModelNumbering.voidsetRotamerTitration(boolean rotamerTitration) voidsetSymOp(int symOp) setSymOp.static StringtoPDBAtomLine(Atom atom) Simple method useful for converting files to PDB format.booleanThis method is different for each subclass and must be overridden.booleanWrites out the atomic information in PDB format.booleanwriteFilebooleanThis method is different for each subclass and must be overridden.booleanwriteFilebooleanwriteFile(File saveFile, boolean append, Set<Atom> toExclude, boolean writeEnd, boolean versioning, String[] extraLines) writeFilebooleanwriteFileAsP1(File file) Expand the current system to P1 during the save operation.booleanwriteFileWithHeader(File saveFile, String header) writeFileWithHeader.booleanwriteFileWithHeader(File saveFile, StringBuilder header) writeFileWithHeader.booleanwriteFileWithHeader(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- aListobject.molecularAssembly- aMolecularAssemblyobject.forceField- aForceFieldobject.properties- aCompositeConfigurationobject.
-
PDBFilter
public PDBFilter(File file, MolecularAssembly molecularAssembly, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties) Parse the PDB File from a URL.- Parameters:
file- aFileobject.molecularAssembly- aMolecularAssemblyobject.forceField- aForceFieldobject.properties- aCompositeConfigurationobject.
-
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- aFileobject.molecularAssemblies- aListobject.forceField- aForceFieldobject.properties- aCompositeConfigurationobject.
-
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- aListobject.molecularAssembly- aMolecularAssemblyobject.forceField- aForceFieldobject.properties- aCompositeConfigurationobject.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- aAtomobject.- 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:
closeReaderin classSystemFilter
-
countNumModels
public int countNumModels()- Overrides:
countNumModelsin 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:
getLastReadLambdain classSystemFilter- Returns:
- Last lambda value read by this filter.
-
getRemarkLines
Returns all the remark lines found by the last readFile call.- Overrides:
getRemarkLinesin classSystemFilter- Returns:
- Remark lines from the last readFile call.
-
getSnapshot
public int getSnapshot()Description copied from class:SystemFilterReturn snapshot number.- Overrides:
getSnapshotin classSystemFilter- Returns:
- The snapshot number.
-
mutate
Mutate residue(s) as the PDB file is being parsed.- Parameters:
mutations- aListobject.
-
readFile
public boolean readFile()Parse the PDB File- Specified by:
readFilein classSystemFilter- Returns:
- a boolean.
-
removeExcessHydrogens
public void removeExcessHydrogens() -
readNext
public boolean readNext()Reads the next model if applicable (currently, ARC and PDB files only).- Specified by:
readNextin classSystemFilter- Returns:
- If next model read.
-
readNext
public boolean readNext(boolean resetPosition) Reads the next model if applicable (currently, ARC files only).- Specified by:
readNextin 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:
readNextin 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:
readNextin 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- aFileobject.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- aFileobject to save to.append- Whether to append to saveFile (vs over-write).toExclude- ASetofAtoms 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- aFileobject to save to.append- Whether to append to saveFile (vs over-write).toExclude- ASetofAtoms 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:
writeFilein classSystemFilter- Parameters:
saveFile- aFileobject.append- a boolean.- Returns:
- a boolean.
-
writeFile
Description copied from class:SystemFilterThis 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:
writeFilein classSystemFilter- Parameters:
saveFile- aFileobject.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- aFileobject.header- aStringBuilderobject.- Returns:
- a boolean.
-