Class SystemFilter

java.lang.Object
ffx.potential.parsers.SystemFilter
Direct Known Subclasses:
CIFFilter, INTFilter, MergeFilter, PDBFilter, SimulationFilter, XPHFilter, XYZFilter

public abstract class SystemFilter extends Object
The SystemFilter class is the base class for most Force Field X file parsers.
Since:
1.0
Author:
Michael J. Schnieders
  • Field Details

    • lambdaPattern

      protected static final Pattern lambdaPattern
    • dieOnMissingAtom

      protected final boolean dieOnMissingAtom
      Constant dieOnMissingAtom=
    • standardizeAtomNames

      protected final boolean standardizeAtomNames
      Standardize atom names to PDB standard by default.
    • vdwH

      protected final boolean vdwH
      True if atoms are to be printed to their van der Waals centers instead of nuclear centers (applies primarily to hydrogen).
    • atomList

      protected List<Atom> atomList
      The atomList is filled by filters that extend SystemFilter.
    • bondList

      protected List<Bond> bondList
      The bondList may be filled by the filters that extend SystemFilter.
    • systems

      protected List<MolecularAssembly> systems
      All MolecularAssembly instances defined. More than one MolecularAssembly should be defined for PDB entries with alternate locations.
    • files

      protected List<File> files
      Append multiple files into one MolecularAssembly.
    • fileType

      protected Utilities.FileType fileType
      The file format being handled.
    • properties

      protected org.apache.commons.configuration2.CompositeConfiguration properties
      Properties associated with this file.
    • forceField

      protected ForceField forceField
      The molecular mechanics force field being used.
    • fileRead

      protected boolean fileRead
      True 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 - a List object.
      molecularAssembly - a MolecularAssembly object.
      forceField - a ForceField object.
      properties - a CompositeConfiguration object.
    • SystemFilter

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

      public SystemFilter(File file, List<MolecularAssembly> molecularAssemblies, ForceField forceField, org.apache.commons.configuration2.CompositeConfiguration properties)
      Constructor for SystemFilter.
      Parameters:
      file - a File object.
      molecularAssemblies - a List object.
      forceField - a ForceField object.
      properties - a CompositeConfiguration object.
  • Method Details

    • previousVersion

      public static File previousVersion(File file)
      previousVersion
      Parameters:
      file - a File object.
      Returns:
      a File object.
    • setVersioning

      public static void setVersioning(SystemFilter.Versioning vers)
      Negative: prefix a version number; Positive: postfix; Zero: TINKER-style.
      Parameters:
      vers - a SystemFilter.Versioning object.
    • version

      public static File version(File file)
      Use setVersioning() to choose between prefix/postfix.
      Parameters:
      file - a File object.
      Returns:
      a File object.
    • atomListToSet

      public static Set<Atom> atomListToSet(List<Integer> atomList, Atom[] atoms)
      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

      public MolecularAssembly getActiveMolecularSystem()
      Return the MolecularSystem that has been read in
      Returns:
      a MolecularAssembly object.
    • getAtomList

      public List<Atom> getAtomList()
      Getter for the field atomList.
      Returns:
      a List object.
    • getFile

      public File getFile()
      getFile
      Returns:
      a File object.
    • setFile

      public void setFile(File file)
      setFile
      Parameters:
      file - a File object.
    • getFiles

      public List<File> getFiles()
      Getter for the field files.
      Returns:
      a List object.
    • setFiles

      public void setFiles(List<File> files)
      Setter for the field files.
      Parameters:
      files - a List object.
    • getLastReadLambda

      public OptionalDouble getLastReadLambda()
      Gets the last read lambda value read by the filter, if any.
      Returns:
      Last lambda value read by this filter.
    • getMolecularAssemblyArray

      public MolecularAssembly[] getMolecularAssemblyArray()
      Get the MolecularAssembly array.
      Returns:
      an array of MolecularAssembly objects.
    • getRemarkLines

      public String[] 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

      public Utilities.FileType getType()
      getType
      Returns:
      a Utilities.FileType object.
    • setType

      public void setType(Utilities.FileType fileType)
      setType
      Parameters:
      fileType - a Utilities.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

      public void setForceField(ForceField forceField)
      Setter for the field forceField.
      Parameters:
      forceField - a ForceField object.
    • setProperties

      public void setProperties(org.apache.commons.configuration2.CompositeConfiguration properties)
      Setter for the field properties.
      Parameters:
      properties - a CompositeConfiguration object.
    • writeFile

      public boolean writeFile(File saveFile, boolean append)
      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 - a File object.
      append - a boolean.
      Returns:
      a boolean.
    • writeFile

      public abstract 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.

      Parameters:
      saveFile - a File 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 field fileRead.
      Parameters:
      fileRead - a boolean.