openmmtools icon indicating copy to clipboard operation
openmmtools copied to clipboard

Obtaining FE estimate using time reversed data for convergence analysis

Open coparks2012 opened this issue 2 years ago • 0 comments

Hello, I am running ABFE calculation using openmmtools/openmm. To estimate the FE change for a component of the FE cycle, I am currently using the code below:

reporter = openmmtools.multistate.MultiStateReporter('run.nc', open_mode='r')
analyzer = ReplicaExchangeAnalyzer(reporter)
time, fe, std = [],[],[]
for i in range(1, iterations_to_analyze+1):
    samples_to_analyze = i *10
    analyzer.max_n_iterations = samples_to_analyze
    Delta_f_ij, dDelta_f_ij = analyzer.get_free_energy()
    end_pt_f, end_pt_std = Delta_f_ij[0, nstates - 1]*kTtokcal, dDelta_f_ij[0, nstates - 1]*kTtokcal
    time += [i]
    fe   += [end_pt_f._value]
    std  += [end_pt_std._value]

This allows me to estimate the FE for the forward trajectory quite easily. To assess convergence however, I would like to plot the FE estimate using the time reversed trajectory data as well. Is there anyway to obtain the FE estimates using the time reversed data? I have been unable to hack into analyzer to accomplish this.

Any help would be greatly appreciated.

coparks2012 avatar Feb 27 '23 22:02 coparks2012