Package ffx.potential.parsers
Class SystemFilter
java.lang.Object
ffx.potential.parsers.SystemFilter
- Direct Known Subclasses:
CIFFilter
,INTFilter
,MergeFilter
,PDBFilter
,SimulationFilter
,XPHFilter
,XYZFilter
The SystemFilter class is the base class for most Force Field X file parsers.
- Since:
- 1.0
- Author:
- Michael J. Schnieders
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionThe atomList is filled by filters that extend SystemFilter.The bondList may be filled by the filters that extend SystemFilter.protected final boolean
ConstantdieOnMissingAtom=
protected boolean
True after the file has been read successfully.Append multiple files into one MolecularAssembly.protected Utilities.FileType
The file format being handled.protected ForceField
The molecular mechanics force field being used.protected static final Pattern
protected org.apache.commons.configuration2.CompositeConfiguration
Properties associated with this file.protected final boolean
Standardize atom names to PDB standard by default.protected List
<MolecularAssembly> All MolecularAssembly instances defined.protected final boolean
True if atoms are to be printed to their van der Waals centers instead of nuclear centers (applies primarily to hydrogen). -
Constructor Summary
ConstructorDescriptionSystemFilter
(File file, MolecularAssembly molecularAssembly, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties) Constructor for SystemFilter.SystemFilter
(File file, List<MolecularAssembly> molecularAssemblies, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties) Constructor for SystemFilter.SystemFilter
(List<File> files, MolecularAssembly molecularAssembly, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties) Constructor for SystemFilter. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Automatically sets atom-specific flags, particularly nouse and inactive, and apply harmonic restraints.atomListToSet
(List<Integer> atomList, Atom[] atoms) Converts a list of atom indices to an array of atoms.abstract void
Attempts to close any open resources associated with the underlying file; primarily to be used when finished reading a trajectory.int
boolean
fileRead()
Returns true if the read was successfulReturn the MolecularSystem that has been read inGetter for the fieldatomList
.getFile()
getFilegetFiles()
Getter for the fieldfiles
.Gets the last read lambda value read by the filter, if any.Get the MolecularAssembly array.String[]
Gets all remark lines read by the last readFile or readNext call.int
Return snapshot number.getType()
getTypestatic File
previousVersion
(File file) previousVersionabstract boolean
readFile()
This method is different for each subclass and must be overridden.abstract boolean
readNext()
Reads the next model if applicable (currently, ARC and PDB files only).abstract boolean
readNext
(boolean resetPosition) Reads the next model if applicable (currently, ARC files only).abstract boolean
readNext
(boolean resetPosition, boolean print) Reads the next model if applicable (currently, ARC files only).abstract boolean
readNext
(boolean resetPosition, boolean print, boolean parse) Reads the next model if applicable (currently, ARC files only).void
setFileprotected void
setFileRead
(boolean fileRead) Setter for the fieldfileRead
.void
Setter for the fieldfiles
.void
setForceField
(ForceField forceField) Setter for the fieldforceField
.void
setProperties
(org.apache.commons.configuration2.CompositeConfiguration properties) Setter for the fieldproperties
.void
setType
(Utilities.FileType fileType) setTypestatic void
Negative: prefix a version number; Positive: postfix; Zero: TINKER-style.static File
Use setVersioning() to choose between prefix/postfix.boolean
This method is different for each subclass and must be overridden.abstract boolean
This method is different for each subclass and must be overridden.
-
Field Details
-
lambdaPattern
-
dieOnMissingAtom
protected final boolean dieOnMissingAtomConstantdieOnMissingAtom=
-
standardizeAtomNames
protected final boolean standardizeAtomNamesStandardize atom names to PDB standard by default. -
vdwH
protected final boolean vdwHTrue if atoms are to be printed to their van der Waals centers instead of nuclear centers (applies primarily to hydrogen). -
atomList
The atomList is filled by filters that extend SystemFilter. -
bondList
The bondList may be filled by the filters that extend SystemFilter. -
systems
All MolecularAssembly instances defined. More than one MolecularAssembly should be defined for PDB entries with alternate locations. -
files
Append multiple files into one MolecularAssembly. -
fileType
The file format being handled. -
properties
protected org.apache.commons.configuration2.CompositeConfiguration propertiesProperties associated with this file. -
forceField
The molecular mechanics force field being used. -
fileRead
protected boolean fileReadTrue after the file has been read successfully.
-
-
Constructor Details
-
SystemFilter
public SystemFilter(List<File> files, MolecularAssembly molecularAssembly, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties) Constructor for SystemFilter.- Parameters:
files
- aList
object.molecularAssembly
- aMolecularAssembly
object.forceField
- aForceField
object.properties
- aCompositeConfiguration
object.
-
SystemFilter
public SystemFilter(File file, MolecularAssembly molecularAssembly, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties) Constructor for SystemFilter.- Parameters:
file
- aFile
object.molecularAssembly
- aMolecularAssembly
object.forceField
- aForceField
object.properties
- aCompositeConfiguration
object.
-
SystemFilter
public SystemFilter(File file, List<MolecularAssembly> molecularAssemblies, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties) Constructor for SystemFilter.- Parameters:
file
- aFile
object.molecularAssemblies
- aList
object.forceField
- aForceField
object.properties
- aCompositeConfiguration
object.
-
-
Method Details
-
previousVersion
previousVersion -
setVersioning
Negative: prefix a version number; Positive: postfix; Zero: TINKER-style.- Parameters:
vers
- aSystemFilter.Versioning
object.
-
version
Use setVersioning() to choose between prefix/postfix. -
atomListToSet
Converts a list of atom indices to an array of atoms.- Parameters:
atomList
- List of atom indices.atoms
- Array of atoms.- Returns:
- Array of atoms.
-
applyAtomProperties
public void applyAtomProperties()Automatically sets atom-specific flags, particularly nouse and inactive, and apply harmonic restraints. Intended to be called at the end of readFile() implementations.Supported syntax: "(\\d+)-(\\d+)"
-
closeReader
public abstract void closeReader()Attempts to close any open resources associated with the underlying file; primarily to be used when finished reading a trajectory. -
countNumModels
public int countNumModels() -
fileRead
public boolean fileRead()Returns true if the read was successful- Returns:
- a boolean.
-
getActiveMolecularSystem
Return the MolecularSystem that has been read in- Returns:
- a
MolecularAssembly
object.
-
getAtomList
Getter for the fieldatomList
.- Returns:
- a
List
object.
-
getFile
getFile- Returns:
- a
File
object.
-
setFile
setFile- Parameters:
file
- aFile
object.
-
getFiles
Getter for the fieldfiles
.- Returns:
- a
List
object.
-
setFiles
Setter for the fieldfiles
.- Parameters:
files
- aList
object.
-
getLastReadLambda
Gets the last read lambda value read by the filter, if any.- Returns:
- Last lambda value read by this filter.
-
getMolecularAssemblyArray
Get the MolecularAssembly array.- Returns:
- an array of
MolecularAssembly
objects.
-
getRemarkLines
Gets all remark lines read by the last readFile or readNext call.- Returns:
- Array of Strings representing remark lines, if any.
-
getSnapshot
public int getSnapshot()Return snapshot number.- Returns:
- The snapshot number.
-
getType
getType- Returns:
- a
Utilities.FileType
object.
-
setType
setType- Parameters:
fileType
- aUtilities.FileType
object.
-
readFile
public abstract boolean readFile()This method is different for each subclass and must be overridden.- Returns:
- a boolean.
-
readNext
public abstract boolean readNext()Reads the next model if applicable (currently, ARC and PDB files only).- Returns:
- If next model read.
-
readNext
public abstract boolean readNext(boolean resetPosition) Reads the next model if applicable (currently, ARC files only).- Parameters:
resetPosition
- Resets to first frame.- Returns:
- If next model read.
-
readNext
public abstract boolean readNext(boolean resetPosition, boolean print) Reads the next model if applicable (currently, ARC files only).- Parameters:
resetPosition
- Resets to first frame.print
- Flag to print.- Returns:
- If next model read.
-
readNext
public abstract boolean readNext(boolean resetPosition, boolean print, boolean parse) Reads the next model if applicable (currently, ARC files only).- 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.
-
setForceField
Setter for the fieldforceField
.- Parameters:
forceField
- aForceField
object.
-
setProperties
public void setProperties(org.apache.commons.configuration2.CompositeConfiguration properties) Setter for the fieldproperties
.- Parameters:
properties
- aCompositeConfiguration
object.
-
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.
- Parameters:
saveFile
- aFile
object.append
- a boolean.- Returns:
- a boolean.
-
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.
- Parameters:
saveFile
- aFile
object.append
- a boolean.extraLines
- Additional lines to append to a comments section, or null.- Returns:
- a boolean.
-
setFileRead
protected void setFileRead(boolean fileRead) Setter for the fieldfileRead
.- Parameters:
fileRead
- a boolean.
-