wekap.kinetics module

Plot the fluxes and rates from direct.h5 files.

list(h5): [‘arrivals’, ‘avg_color_probs’, ‘avg_conditional_fluxes’, ‘avg_rates’, ‘avg_state_probs’, ‘avg_total_fluxes’, ‘color_prob_evolution’, ‘conditional_arrivals’, ‘conditional_flux_evolution’, ‘conditional_fluxes’, ‘duration_count’, ‘durations’, ‘rate_evolution’, ‘state_labels’, ‘state_pop_evolution’, ‘target_flux_evolution’, ‘total_fluxes’]

/target_flux_evolution [window,state]

Total flux into a given macro state based on windows of iterations of varying width, as in /rate_evolution.

/conditional_flux_evolution [window,state,state]

State-to-state fluxes based on windows of varying width, as in /rate_evolution.

The structure of these datasets is as follows:
iter_start

(Integer) Iteration at which the averaging window begins (inclusive).

iter_stop

(Integer) Iteration at which the averaging window ends (exclusive).

expected

(Floating-point) Expected (mean) value of the observable as evaluated within this window, in units of inverse tau.

ci_lbound

(Floating-point) Lower bound of the confidence interval of the observable within this window, in units of inverse tau.

ci_ubound

(Floating-point) Upper bound of the confidence interval of the observable within this window, in units of inverse tau.

stderr

(Floating-point) The standard error of the mean of the observable within this window, in units of inverse tau.

corr_len

(Integer) Correlation length of the observable within this window, in units of tau.

TODO:
  • fix mfpt plots

  • multi direct.h5/assign.h5 input and error using Bayesian bootstrapping

  • account for assign.h5 populations implicitly using averaging info from direct.h5. E.g. auto use cumulative or window averaged assign.h5 populations.

  • option to apply the RED scheme

Other plots: 4 panel plot of P_A, P_B, rate_AB, rate_BA, all as function of WE iteration Autocorrelation plot Event durations and distributions

class wekap.kinetics.Kinetics(direct=None, assign=None, statepop='direct', tau=1e-10, state=1, label=None, units='rates', ax=None, savefig=None, color=None, moltime=True, cumulative_avg=True, linewidth=None, linestyle='-', postprocess_func=None, red=False, *args, **kwargs)

Bases: object

Plot the fluxes and rates from direct.h5 files.

extract_rate()

Get the raw rate array from one direct.h5 file.

Return type:

rate_ab, ci_lb_ab, ci_ub_ab

format_rate_plot()

General formatting options for rate plots.

get_state_pop()

Update self.state_pops, self.state_pop_a, and self.state_pop_b based on self.direct_h5 and self.assign_h5

static load_module(module_name, path=None)

Load and return the given module, recursively loading containing packages as necessary.

plot_exp_vals(ax=None, f_range=False, d2d1=False, f_range_all=False)
f_rangebool

Set to True to use mark 25-67 s^-1 as the k_D1D2 rate.

d2d1bool

Set to True to also include k_D2D1.

plot_multi_rates(multi_direct)

Plot multiple direct.h5 flux evolution datasets. Use Bayesian bootstrapping for error estimates.

Parameters:

multi_direct (list) – List of paths to multiple direct.h5 files.

Return type:

multi_k, multi_k_avg, multi_k_uncertainty

plot_rate()

Plot the rate constant = target flux evolution AB / P_A

Returns:

rate_ab – Array of rates from A -> B in seconds^-1.

Return type:

ndarray

plot_statepop()

Plot the state populations