schrodinger.application.desmond.bennett module

schrodinger.application.desmond.bennett.logistic(v, x)
schrodinger.application.desmond.bennett.logistic_function(v1, v2, x)
schrodinger.application.desmond.bennett.logistic_full(v, x)
schrodinger.application.desmond.bennett.logistic_function_full(v1, v2, x)
schrodinger.application.desmond.bennett.min_func(x, v1, v2)
class schrodinger.application.desmond.bennett.CalcBAR(begin_time=300.0, end_time=- 1.0, forward_column=2, reverse_column=1, temperature=300.0, nresamples=100, tolerance=1e-05, exchange=False, seed=2111839, bootstrap_flavor='stationary', blocksize=False, syncseed=True)

Bases: object

Attributes for parsing the observables and setting up BAR calculations.

__init__(begin_time=300.0, end_time=- 1.0, forward_column=2, reverse_column=1, temperature=300.0, nresamples=100, tolerance=1e-05, exchange=False, seed=2111839, bootstrap_flavor='stationary', blocksize=False, syncseed=True)
set_nresamples(nresamples)
set_output(fn_out='stdout', fn_log=None, fn_err='stderr')

Set up output filehandles

Parameters
  • fn_out (string or None) – Filename for output, stdout for stdout or None for no output

  • fn_log (string or None) – Filename for log output, stdout for stdout or None for no output

  • fn_err (string or None) – Filename for error, stderr for stderr or None for no output

set_seed(seed)

Set random seed.

close_output()

Close filehandles.

load_data(dE_fns)

Load data from dE_fns for subsequent analysis. :param dE_fns: List of filenames to load in order :type dE_fns: List of strings

filter_data(begin_time=0, end_time=- 1)

Filter data based on the start, end time :param begin_time: keep data after this time :type begin_time: float :param end_time: keep data before this time :type end_time: float

analyze_data()

Analyze filtered data. :return: [[dG, bootstrap sigma, analytic sigma],…] :rtype: list of list of floats

write_results(results)

Write out the results. :param results: results from analyze data :type results: list of list of floats

bennett(wf, wr)

Given a series of forward and reverse work values between two systems, use Bennett’s acceptance ratio method to estimate the free energy differences.

The notations in this program follow that of Shirts et al. P.R.L. 91, 140601 (2003) :param wf: Forward work values :type wf: numpy array :param wr: Reverse work values :type wr: numpy array :return: bennett dG, bennett sigma :rtype: float, float

exchange_acceptance_ratio(bwf, bwr)

Computes the expected acceptance ratio for exchange between adjacent windows.:

<a> = \int dx dy min( 1, exp( beta*(dW_f(x) + dW_r(y)) ) )
    = 1/(n_f n_r) \sum_{i,j} min( 1, exp( beta( dW_{fi} + dW_{rj} ) ) )
Parameters
  • bwf (numpy array) – forward work multiplied by beta

  • bwr (numpy array) – reverse work multiplied by beta

write_data(data, fh=None)

Write data to file handle (or do nothing if fh is None) :param data: Data to write :type data: string :param fh: File to write to or None to not write :type fh: Open filehandle or None

schrodinger.application.desmond.bennett.bootstrap(nresamples, size, nblocks=False, bootstrap_flavor='stationary block', blocksize=False)

Create index sets representing bootstrap resamples of original data

Written mostly dan.sindhikara@schrodinger.com

Parameters
  • nresamples (int) – number of resamplings to return

  • size (int) – size of the data

  • nblocks (int) – (optional) number of subblocks per resample

  • bootstrap_flavor (str) – type of bootstrapping

  • blocksize (int) – (optional) size of blocks comprising each resample

Return i_resamples

list of resampling indices

Rtype i_resamples

list-like of list-likes

schrodinger.application.desmond.bennett.main(argv=None)