Package ffx.potential.parsers
Class XYZFilter
java.lang.Object
ffx.potential.parsers.SystemFilter
ffx.potential.parsers.XYZFilter
The XYZFilter class parses TINKER Cartesian coordinate (*.XYZ) files.
- Since:
- 1.0
- Author:
- Michael J. Schnieders
-
Nested Class Summary
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
ConstructorDescriptionXYZFilter
(File file, MolecularAssembly system, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties) Constructor for XYZFilter.XYZFilter
(List<File> files, MolecularAssembly system, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties) Constructor for XYZFilter. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Attempts to close any open resources associated with the underlying file; primarily to be used when finished reading a trajectory.int
Gets the last read lambda value read by the filter, if any.String[]
Gets all remark lines read by the last readFile or readNext call.int
Return snapshot number.boolean
readFile()
This method is different for each subclass and must be overridden.boolean
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 snapshot of an archive into the activeMolecularAssembly.static boolean
readOnto
(File newFile, MolecularAssembly oldSystem) readOntoboolean
This method is different for each subclass and must be overridden.boolean
writeFileAsP1
(File saveFile, boolean append, Crystal crystal) writeFileAsP1boolean
writeFileAsP1
(File saveFile, boolean append, Crystal crystal, int[] lmn, String[] extraLines) Write file as a P1 system in XYZ format.boolean
writeFileAsP1
(File saveFile, boolean append, Crystal crystal, String[] extraLines) writeFileAsP1Methods 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, writeFile
-
Constructor Details
-
XYZFilter
public XYZFilter(List<File> files, MolecularAssembly system, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties) Constructor for XYZFilter.- Parameters:
files
- aList
object.system
- aMolecularAssembly
object.forceField
- aForceField
object.properties
- aCompositeConfiguration
object.
-
XYZFilter
public XYZFilter(File file, MolecularAssembly system, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties) Constructor for XYZFilter.- Parameters:
file
- aFile
object.system
- aMolecularAssembly
object.forceField
- aForceField
object.properties
- aCompositeConfiguration
object.
-
-
Method Details
-
readOnto
readOnto- Parameters:
newFile
- aFile
object.oldSystem
- aMolecularAssembly
object.- Returns:
- a boolean.
-
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
-
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
Description copied from class:SystemFilter
Gets all remark lines read by the last readFile or readNext call.- Overrides:
getRemarkLines
in classSystemFilter
- Returns:
- Array of Strings representing remark lines, if any.
-
getSnapshot
public int getSnapshot()Description copied from class:SystemFilter
Return snapshot number.- Overrides:
getSnapshot
in classSystemFilter
- Returns:
- The snapshot number.
-
readFile
public boolean readFile()This method is different for each subclass and must be overridden.Parse the XYZ 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).Reads the next snapshot of an archive into the activeMolecularAssembly. After calling this function, a BufferedReader will remain open until the
close
method is called.- 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).Reads the next snapshot of an archive into the activeMolecularAssembly. After calling this function, a BufferedReader will remain open until the
close
method is called.- 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 snapshot of an archive into the activeMolecularAssembly. After calling this function, a BufferedReader will remain open until theclose
method is called.- 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.
-
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.
- 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.
-
writeFileAsP1
writeFileAsP1 -
writeFileAsP1
writeFileAsP1 -
writeFileAsP1
public boolean writeFileAsP1(File saveFile, boolean append, Crystal crystal, int[] lmn, String[] extraLines) Write file as a P1 system in XYZ format.
-