10.1.3.1.2. freeflux.io.results¶
Define classes of simulation and fitting results.
10.1.3.1.2.1. Attributes¶
10.1.3.1.2.2. Classes¶
dict() -> new empty dictionary |
|
10.1.3.1.2.3. Module Contents¶
- class freeflux.io.results.pDict(*args, digits=3, **kwargs)[source]¶
Bases:
dictdict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s
(key, value) pairs
- dict(iterable) -> new dictionary initialized as if via:
d = {} for k, v in iterable:
d[k] = v
- dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
- class freeflux.io.results.FVAResults(flux_ranges)[source]¶
- Parameters:
flux_ranges (dict) – Reaction ID => [lower bound, upper bound].
- class freeflux.io.results.SimResults(simulated_MDVs)[source]¶
- Parameters:
simulated_MDVs (dict) – EMU ID => MDV.
- class freeflux.io.results.InstSimResults(simulated_inst_MDVs)[source]¶
- Parameters:
simulated_inst_MDVs (dict) – EMU IDs => {timepoints => MDV}.
- class freeflux.io.results.FitResults(opt_total_fluxes, opt_net_fluxes, opt_obj, opt_resids, n_meas, n_params, sim_MDVs, exp_MDVs, sim_fluxes, exp_fluxes, hessian, null_space, transform_matrix, sim_MDVs_der_u, sim_fluxes_der_u, exp_MDVs_inv_cov, exp_fluxes_inv_cov, is_success)[source]¶
- Parameters:
opt_total_fluxes (ser) – Total fluxes at optimal objective.
opt_net_fluxes (ser) – Net fluxes at optimal objective.
opt_obj (float) – Optimal value of objective.
opt_resids (array) – Optimal weighted residuals.
n_meas (int) – # of measurements.
n_params (int) – # of parameters.
sim_MDVs (dict) – EMU ID => simulated MDV.
exp_MDVs (dict) – EMU ID => [means, sds].
sim_fluxes (dict) – Flux ID => simulated flux.
exp_fluxes (dict) – Flux ID => [mean, sd].
hessian (array) – Hessian matrix at convergence.
null_space (array) – Null space of stoichiometric matrix.
transform_matrix (array) – Transform matrix from total fluxes to net fluxes.
sim_MDVs_der_u (array) – Derivative of simulated MDVs w.r.t. free fluxes.
sim_fluxes_der_u (array) – Derivative of simualted fluxes w.r.t. free fluxes.
exp_MDVs_inv_cov (array) – Inversed covariance matrix of measured MDVs.
exp_fluxes_inv_cov (array) – Inversed covariance matrix of measured fluxes.
is_success (bool) – Whether the optimization is successful.
- chi2_test(confidence_level=0.999)[source]¶
Perform chi square test of the optimal objective. SSR < LB of chi square interval sometimes can be also considered as successful estimation.
- Parameters:
confidence_level (float) – Confidence level, e.g. 0.95 as 95% confidence level.
- plot_normal_probability(show_fig=True, output_dir=None)[source]¶
Perform normal probability plot for residuals.
- plot_simulated_vs_measured_MDVs(show_fig=True, output_dir=None)[source]¶
Plot simulated and measured MDVs.
- plot_simulated_vs_measured_fluxes(show_fig=True, output_dir=None)[source]¶
Plot simulated and measured fluxes.
- estimate_confidence_intervals(which='net', confidence_level=0.95)[source]¶
Calculate CI of net (total) fluxes using local estimation.
- Parameters:
which ({"net", "total"}) –
“net” if net fluxes.
”total” if total fluxes.
confidence_level (float) – Confidence level, e.g. 0.95 as 95% confidence level.
- estimate_contribution_matrix(which='net')[source]¶
Calculate contribution matrix of measurement variance to net (total) flux variance.
- Parameters:
which ({"net", "total"}) –
“net” if net fluxes.
”total” if total fluxes.
- estimate_sensitivity(which='net')[source]¶
Calculate sensitivity matrix of estimated net (total) flux w.r.t. measurement changes.
- Parameters:
which ({"net", "total"}) –
“net” if net fluxes.
”total” if total fluxes.
- class freeflux.io.results.FitMCResults(total_fluxes_set, net_fluxes_set)[source]¶
- Parameters:
- class freeflux.io.results.InstFitResults(opt_total_fluxes, opt_net_fluxes, opt_concs, opt_obj, opt_resids, n_meas, n_params, sim_inst_MDVs, exp_inst_MDVs, sim_fluxes, exp_fluxes, hessian, null_space, transform_matrix, sim_inst_MDVs_der_u, sim_fluxes_der_u, exp_inst_MDVs_inv_cov, exp_fluxes_inv_cov, is_success)[source]¶
Bases:
FitResults- Parameters:
opt_total_fluxes (ser) – Total fluxes at optimal objective.
opt_net_fluxes (ser) – Net fluxes at optimal objective.
opt_concs (ser) – Concentrations at optimal objective.
opt_obj (float) – Optimal value of objective.
opt_resids (array) – Optimal weighted residuals.
n_meas (int) – # of measurements.
n_params (int) – # of parameters.
sim_inst_MDVs (dict) – EMU ID => {t => simulated MDV}.
exp_inst_MDVs (dict) – EMU ID => {t => [means, sds]}.
sim_fluxes (dict) – Flux ID => simulated flux.
exp_fluxes (dict) – Flux ID => [mean, sd].
hessian (array) – Hessian matrix at convergence.
null_space (array) – Null space of stoichiometric matrix.
transform_matrix (array) – Transform matrix from total fluxes to net fluxes.
sim_inst_MDVs_der_u (array) – Derivative of simulated MDVs w.r.t. free fluxes.
sim_fluxes_der_u (array) – Derivative of simualted fluxes w.r.t. free fluxes.
exp_inst_MDVs_inv_cov (array) – Inversed covariance matrix of measured MDVs.
exp_fluxes_inv_cov (array) – Inversed covariance matrix of measured fluxes.
is_success (bool) – Whether the optimization is successful.
- plot_simulated_vs_measured_MDVs(show_fig=True, output_dir=None)[source]¶
Plot simulated and measured MDVs.
- estimate_confidence_intervals(which='net', confidence_level=0.95)[source]¶
Calculate CI of fluxes and concentrations using local estimation.
- Parameters:
which ({"net", "total", "conc"}) –
“net” if net fluxes.
”total” if total fluxes.
”conc” if concentrations.
confidence_level (float) – Confidence level, e.g. 0.95 as 95% confidence level.
- estimate_contribution_matrix(which='net')[source]¶
Calculate contribution matrix of measurement variance to net (total) flux variance.
- Parameters:
which ({"net", "total"}) –
“net” if net fluxes.
”total” if total fluxes.
- class freeflux.io.results.InstFitMCResults(total_fluxes_set, net_fluxes_set, concs_set)[source]¶
Bases:
FitMCResults- Parameters:
- estimate_confidence_intervals(which='net', confidence_level=0.95)[source]¶
This method estimates CI from a set of fluxes.
- Parameters:
which ({"net", "total", "conc"}) –
“net” if net fluxes.
”total” if total fluxes.
”conc” if concentrations.
confidence_level (float) – Confidence level, e.g. 0.95 as 95% confidence level.