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
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionThe atomList is filled by filters that extend SystemFilter.The bondList may be filled by the filters that extend SystemFilter.protected final booleanConstantdieOnMissingAtom=protected booleanTrue after the file has been read successfully.Append multiple files into one MolecularAssembly.protected Utilities.FileTypeThe file format being handled.protected ForceFieldThe molecular mechanics force field being used.protected static final Patternprotected org.apache.commons.configuration2.CompositeConfigurationProperties associated with this file.protected booleanStandardize atom names to PDB standard by default.protected List<MolecularAssembly> All MolecularAssembly instances defined.protected final booleanTrue if atoms are to be printed to their van der Waals centers instead of nuclear centers (applies primarily to hydrogen). -
Constructor Summary
ConstructorsConstructorDescriptionSystemFilter(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 TypeMethodDescriptionvoidAutomatically 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 voidAttempts to close any open resources associated with the underlying file; primarily to be used when finished reading a trajectory.intbooleanfileRead()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.intReturn snapshot number.getType()getTypestatic FilepreviousVersion(File file) previousVersionabstract booleanreadFile()This method is different for each subclass and must be overridden.abstract booleanreadNext()Reads the next model if applicable (currently, ARC and PDB files only).abstract booleanreadNext(boolean resetPosition) Reads the next model if applicable (currently, ARC files only).abstract booleanreadNext(boolean resetPosition, boolean print) Reads the next model if applicable (currently, ARC files only).abstract booleanreadNext(boolean resetPosition, boolean print, boolean parse) Reads the next model if applicable (currently, ARC files only).voidsetFileprotected voidsetFileRead(boolean fileRead) Setter for the fieldfileRead.voidSetter for the fieldfiles.voidsetForceField(ForceField forceField) Setter for the fieldforceField.voidsetProperties(org.apache.commons.configuration2.CompositeConfiguration properties) Setter for the fieldproperties.voidsetType(Utilities.FileType fileType) setTypestatic voidNegative: prefix a version number; Positive: postfix; Zero: TINKER-style.static FileUse setVersioning() to choose between prefix/postfix.booleanThis method is different for each subclass and must be overridden.abstract booleanThis method is different for each subclass and must be overridden.
-
Field Details
-
lambdaPattern
-
dieOnMissingAtom
protected final boolean dieOnMissingAtomConstantdieOnMissingAtom= -
standardizeAtomNames
protected 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- aListobject.molecularAssembly- aMolecularAssemblyobject.forceField- aForceFieldobject.properties- aCompositeConfigurationobject.
-
SystemFilter
public SystemFilter(File file, MolecularAssembly molecularAssembly, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties) Constructor for SystemFilter.- Parameters:
file- aFileobject.molecularAssembly- aMolecularAssemblyobject.forceField- aForceFieldobject.properties- aCompositeConfigurationobject.
-
SystemFilter
public SystemFilter(File file, List<MolecularAssembly> molecularAssemblies, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties) Constructor for SystemFilter.- Parameters:
file- aFileobject.molecularAssemblies- aListobject.forceField- aForceFieldobject.properties- aCompositeConfigurationobject.
-
-
Method Details
-
previousVersion
previousVersion -
setVersioning
Negative: prefix a version number; Positive: postfix; Zero: TINKER-style.- Parameters:
vers- aSystemFilter.Versioningobject.
-
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
MolecularAssemblyobject.
-
getAtomList
Getter for the fieldatomList.- Returns:
- a
Listobject.
-
getFile
getFile- Returns:
- a
Fileobject.
-
setFile
setFile- Parameters:
file- aFileobject.
-
getFiles
Getter for the fieldfiles.- Returns:
- a
Listobject.
-
setFiles
Setter for the fieldfiles.- Parameters:
files- aListobject.
-
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
MolecularAssemblyobjects.
-
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.FileTypeobject.
-
setType
setType- Parameters:
fileType- aUtilities.FileTypeobject.
-
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- aForceFieldobject.
-
setProperties
public void setProperties(org.apache.commons.configuration2.CompositeConfiguration properties) Setter for the fieldproperties.- Parameters:
properties- aCompositeConfigurationobject.
-
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- aFileobject.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- aFileobject.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.
-