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
ConstructorsConstructorDescriptionXYZFilter(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 TypeMethodDescriptionvoidAttempts to close any open resources associated with the underlying file; primarily to be used when finished reading a trajectory.intGets the last read lambda value read by the filter, if any.String[]Gets all remark lines read by the last readFile or readNext call.intReturn snapshot number.booleanreadFile()This method is different for each subclass and must be overridden.booleanreadNext()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 snapshot of an archive into the activeMolecularAssembly.static booleanreadOnto(File newFile, MolecularAssembly oldSystem) readOntobooleanThis method is different for each subclass and must be overridden.booleanwriteFileAsP1(File saveFile, boolean append, Crystal crystal) writeFileAsP1booleanwriteFileAsP1(File saveFile, boolean append, Crystal crystal, int[] lmn, String[] extraLines) Write file as a P1 system in XYZ format.booleanwriteFileAsP1(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- aListobject.system- aMolecularAssemblyobject.forceField- aForceFieldobject.properties- aCompositeConfigurationobject.
-
XYZFilter
public XYZFilter(File file, MolecularAssembly system, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties) Constructor for XYZFilter.- Parameters:
file- aFileobject.system- aMolecularAssemblyobject.forceField- aForceFieldobject.properties- aCompositeConfigurationobject.
-
-
Method Details
-
readOnto
readOnto- Parameters:
newFile- aFileobject.oldSystem- aMolecularAssemblyobject.- 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:
closeReaderin classSystemFilter
-
countNumModels
public int countNumModels()- Overrides:
countNumModelsin classSystemFilter
-
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
Description copied from class:SystemFilterGets all remark lines read by the last readFile or readNext call.- Overrides:
getRemarkLinesin classSystemFilter- Returns:
- Array of Strings representing remark lines, if any.
-
getSnapshot
public int getSnapshot()Description copied from class:SystemFilterReturn snapshot number.- Overrides:
getSnapshotin 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:
readFilein classSystemFilter- Returns:
- a boolean.
-
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).Reads the next snapshot of an archive into the activeMolecularAssembly. After calling this function, a BufferedReader will remain open until the
closemethod is called.- 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).Reads the next snapshot of an archive into the activeMolecularAssembly. After calling this function, a BufferedReader will remain open until the
closemethod is called.- 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 snapshot of an archive into the activeMolecularAssembly. After calling this function, a BufferedReader will remain open until theclosemethod is called.- 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.
-
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:
writeFilein classSystemFilter- Parameters:
saveFile- aFileobject.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.
-