Class XYZFilter

java.lang.Object
ffx.potential.parsers.SystemFilter
ffx.potential.parsers.XYZFilter

public class XYZFilter extends SystemFilter
The XYZFilter class parses TINKER Cartesian coordinate (*.XYZ) files.
Since:
1.0
Author:
Michael J. Schnieders
  • Constructor Details

    • XYZFilter

      public XYZFilter(List<File> files, MolecularAssembly system, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties)
      Constructor for XYZFilter.
      Parameters:
      files - a List object.
      system - a MolecularAssembly object.
      forceField - a ForceField object.
      properties - a CompositeConfiguration object.
    • XYZFilter

      public XYZFilter(File file, MolecularAssembly system, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties)
      Constructor for XYZFilter.
      Parameters:
      file - a File object.
      system - a MolecularAssembly object.
      forceField - a ForceField object.
      properties - a CompositeConfiguration object.
  • Method Details

    • readOnto

      public static boolean readOnto(File newFile, MolecularAssembly oldSystem)
      readOnto
      Parameters:
      newFile - a File object.
      oldSystem - a MolecularAssembly 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 class SystemFilter
    • countNumModels

      public int countNumModels()
      Overrides:
      countNumModels in class SystemFilter
    • getLastReadLambda

      public OptionalDouble getLastReadLambda()
      Gets the last read lambda value read by the filter, if any.
      Overrides:
      getLastReadLambda in class SystemFilter
      Returns:
      Last lambda value read by this filter.
    • getRemarkLines

      public String[] getRemarkLines()
      Description copied from class: SystemFilter
      Gets all remark lines read by the last readFile or readNext call.
      Overrides:
      getRemarkLines in class SystemFilter
      Returns:
      Array of Strings representing remark lines, if any.
    • getSnapshot

      public int getSnapshot()
      Description copied from class: SystemFilter
      Return snapshot number.
      Overrides:
      getSnapshot in class SystemFilter
      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 class SystemFilter
      Returns:
      a boolean.
    • readNext

      public boolean readNext()
      Reads the next model if applicable (currently, ARC and PDB files only).
      Specified by:
      readNext in class SystemFilter
      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 class SystemFilter
      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 class SystemFilter
      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 the close method is called.
      Specified by:
      readNext in class SystemFilter
      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

      public boolean writeFile(File saveFile, boolean append, String[] extraLines)
      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 class SystemFilter
      Parameters:
      saveFile - a File object.
      append - a boolean.
      extraLines - Additional lines to append to a comments section, or null.
      Returns:
      a boolean.
    • writeFileAsP1

      public boolean writeFileAsP1(File saveFile, boolean append, Crystal crystal)
      writeFileAsP1
      Parameters:
      saveFile - a File object.
      append - a boolean.
      crystal - a Crystal object.
      Returns:
      a boolean.
    • writeFileAsP1

      public boolean writeFileAsP1(File saveFile, boolean append, Crystal crystal, String[] extraLines)
      writeFileAsP1
      Parameters:
      saveFile - a File object.
      append - a boolean.
      crystal - a Crystal object.
      extraLines - Additional lines to print in the header.
      Returns:
      a boolean.
    • writeFileAsP1

      public boolean writeFileAsP1(File saveFile, boolean append, Crystal crystal, int[] lmn, String[] extraLines)
      Write file as a P1 system in XYZ format.
      Parameters:
      saveFile - a File object.
      append - a boolean.
      crystal - a Crystal object.
      lmn - Replicate vector dimensions.
      extraLines - Additional lines to print in the header.
      Returns:
      a boolean.