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)

Initialize self. See help(type(self)) for accurate signature.

set_nresamples(nresamples)
set_output(fn_out='stdout', fn_log=None, fn_err='stderr')

Set up output filehandles :param fn_out: Filename for output, stdout for stdout

or None for no output
Parameters:
  • 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

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.desmond.bennett', '__doc__': '\n Attributes for parsing the observables and setting up BAR calculations.\n ', '__init__': <function CalcBAR.__init__>, 'set_nresamples': <function CalcBAR.set_nresamples>, 'set_output': <function CalcBAR.set_output>, 'set_seed': <function CalcBAR.set_seed>, 'close_output': <function CalcBAR.close_output>, 'load_data': <function CalcBAR.load_data>, 'filter_data': <function CalcBAR.filter_data>, 'analyze_data': <function CalcBAR.analyze_data>, 'write_results': <function CalcBAR.write_results>, 'bennett': <function CalcBAR.bennett>, 'exchange_acceptance_ratio': <function CalcBAR.exchange_acceptance_ratio>, '_root': <function CalcBAR._root>, 'write_data': <function CalcBAR.write_data>, '__dict__': <attribute '__dict__' of 'CalcBAR' objects>, '__weakref__': <attribute '__weakref__' of 'CalcBAR' objects>})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.application.desmond.bennett'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

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()