Package schrodinger :: Package application :: Package desmond :: Module bennett :: Class CalcBAR
[hide private]
[frames] | no frames]

Class CalcBAR

object --+
         |
        CalcBAR

Attributes for parsing the observables and setting up BAR calculations.

Instance Methods [hide private]
 
__init__(self, 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)
x.__init__(...) initializes x; see help(type(x)) for signature
 
set_nresamples(self, nresamples)
 
set_output(self, fn_out='stdout', fn_log=None, fn_err='stderr')
Set up output filehandles
 
set_seed(self, seed)
Set random seed.
 
close_output(self)
Close filehandles.
 
load_data(self, dE_fns)
Load data from dE_fns for subsequent analysis.
 
filter_data(self, begin_time=0, end_time=-1)
Filter data based on the start, end time
list of list of floats
analyze_data(self)
Analyze filtered data.
 
write_results(self, results)
Write out the results.
float, float
bennett(self, 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.
 
exchange_acceptance_ratio(self, bwf, bwr)
Computes the expected acceptance ratio for exchange between adjacent windows.
 
_root(self, bw0, bw1, x0, x1)
Use the brentq method to find the root of the logistic function
 
write_data(self, data, fh=None)
Write data to file handle (or do nothing if fh is None)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, 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)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

set_output(self, 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

load_data(self, dE_fns)

 

Load data from dE_fns for subsequent analysis.

Parameters:
  • dE_fns (List of strings) - List of filenames to load in order

filter_data(self, begin_time=0, end_time=-1)

 

Filter data based on the start, end time

Parameters:
  • begin_time (float) - keep data after this time
  • end_time (float) - keep data before this time

analyze_data(self)

 

Analyze filtered data.

Returns: list of list of floats
[[dG, bootstrap sigma, analytic sigma],...]

write_results(self, results)

 

Write out the results.

Parameters:
  • results (list of list of floats) - results from analyze data

bennett(self, 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)

Parameters:
  • wf (numpy array) - Forward work values
  • wr (numpy array) - Reverse work values
Returns: float, float
bennett dG, bennett sigma

exchange_acceptance_ratio(self, 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} ) ) )
@param bwf: forward work multiplied by beta
@type bwf: numpy array
@param bwr: reverse work multiplied by beta
@type bwr: numpy array

_root(self, bw0, bw1, x0, x1)

 

Use the brentq method to find the root of the logistic function

Parameters:
  • bw0 (numpy array) - forward work values multiplied by beta
  • bw1 (numpy array) - reverse work values multiplied by beta
  • x0 (float) - Initial estimate of the forward free energy
  • x1 (float) - Initial estimate of the reverse free energy

write_data(self, data, fh=None)

 

Write data to file handle (or do nothing if fh is None)

Parameters:
  • data (string) - Data to write
  • fh (Open filehandle or None) - File to write to or None to not write