Package ffx.numerics.estimator
Class MBARFilter
java.lang.Object
ffx.numerics.estimator.MBARFilter
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 Summary
ConstructorDescriptionMBARFilter
(File fileLocation, boolean continuousLambda) Constructor for MBARFilter. -
Method Summary
Modifier and TypeMethodDescriptionCreate an MBAR instance with the given seed type.getMBAR
(MultistateBennettAcceptanceRatio.SeedType seedType, double tolerance) Create an MBAR instance with the given seed type and tolerance.getPeriodComparisonMBAR
(MultistateBennettAcceptanceRatio.SeedType seedType, double tolerance) 10% of the total samples at different time points.boolean
readObservableData
(boolean multiDataObservable, boolean isBiasData, boolean isDerivativeData) Read in observable data, try to leave as many fields in-tact as possible.void
setEndSnapshot
(int endIndex) Set the end snapshot.void
setStartSnapshot
(int startIndex) Set the start snapshot.void
Write the energies to a file.void
writeFiles
(File mbarFileLoc, double[][][] energies, double[] temperatures) Write the energies to files.
-
Constructor Details
-
MBARFilter
Constructor for MBARFilter.- Parameters:
fileLocation
- the directory containing the mbar filescontinuousLambda
- 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
public MultistateBennettAcceptanceRatio getMBAR(MultistateBennettAcceptanceRatio.SeedType seedType, double tolerance) 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
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
Write the energies to a file.- Parameters:
energies
- the energies to writefile
- the file to write totemperature
- 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.
-