Class MBARFilter

java.lang.Object
ffx.numerics.estimator.MBARFilter

public class MBARFilter extends Object
The MBARFilter class parses mbar (*.mbar or *.bar) files. Expected file format is a header line including the number of snapshots contained, a name, and a temperature. Following the header is a list of energies for each snapshot at each lambda value being considered with an index to start the line. Then the energies go from least (0) to greatest (1) lambda value.

Files less than numLambda states are handled. Users should simply generate MBAR files with desired number of lambda windows, this filter should handle the rest and warn about potential issues.

Since:
1.0
Author:
Matthew J. Speranza
  • Constructor Details

    • MBARFilter

      public MBARFilter(File fileLocation, boolean continuousLambda)
      Constructor for MBARFilter.
      Parameters:
      fileLocation - the directory containing the mbar files
      continuousLambda - whether a single file is being used.
  • Method Details

    • getMBAR

      Create an MBAR instance with the given seed type.
      Parameters:
      seedType - the seed type to use.
      Returns:
      an MBAR instance.
    • getMBAR

      Create an MBAR instance with the given seed type and tolerance.
      Parameters:
      seedType - the seed type to use.
      tolerance - the tolerance to use.
      Returns:
      an MBAR instance.
    • getPeriodComparisonMBAR

      public MultistateBennettAcceptanceRatio[] getPeriodComparisonMBAR(MultistateBennettAcceptanceRatio.SeedType seedType, double tolerance)
      10% of the total samples at different time points.
      Parameters:
      seedType - the seed type to use.
      tolerance - the tolerance to use.
      Returns:
      an array of MBAR objects
    • writeFiles

      public void writeFiles(File mbarFileLoc, double[][][] energies, double[] temperatures)
      Write the energies to files.
      Parameters:
      mbarFileLoc - the directory to write the files to.
      energies - the energies to write.
      temperatures - the temperatures to write.
    • writeFile

      public void writeFile(double[][] energies, File file, double temperature)
      Write the energies to a file.
      Parameters:
      energies - the energies to write
      file - the file to write to
      temperature - the temperature to write
    • setStartSnapshot

      public void setStartSnapshot(int startIndex)
      Set the start snapshot.
      Parameters:
      startIndex - the start index.
    • setEndSnapshot

      public void setEndSnapshot(int endIndex)
      Set the end snapshot.
      Parameters:
      endIndex - the end index.
    • readObservableData

      public boolean readObservableData(boolean multiDataObservable, boolean isBiasData, boolean isDerivativeData)
      Read in observable data, try to leave as many fields in-tact as possible.
      Parameters:
      multiDataObservable - whether the observable data is multi-data.
      isBiasData - whether the data is bias data.
      isDerivativeData - whether the data is derivative data.
      Returns:
      whether the data was read successfully.