10.1.3.1.2. freeflux.io.results

Define classes of simulation and fitting results.

10.1.3.1.2.1. Attributes

__author__

10.1.3.1.2.2. Classes

pDict

dict() -> new empty dictionary

FBAResults

FVAResults

SimResults

InstSimResults

FitResults

FitMCResults

InstFitResults

InstFitMCResults

10.1.3.1.2.3. Module Contents

freeflux.io.results.__author__ = 'Chao Wu'[source]
class freeflux.io.results.pDict(*args, digits=3, **kwargs)[source]

Bases: dict

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

digits = 3[source]
__repr__()[source]

Return repr(self).

class freeflux.io.results.FBAResults(obj, opt_obj, opt_fluxes)[source]
Parameters:
  • obj (dict) – Reaction ID => coefficient, i.e., the objective function.

  • opt_obj (float) – Optimal objective.

  • opt_fluxes (OrderedDict) – Optimal fluxes.

_obj[source]
_opt_obj[source]
_opt_fluxes[source]
property objective[source]
property opt_objective[source]
property opt_fluxes[source]
__repr__()[source]
class freeflux.io.results.FVAResults(flux_ranges)[source]
Parameters:

flux_ranges (dict) – Reaction ID => [lower bound, upper bound].

_flux_ranges[source]
property flux_ranges[source]
__repr__()[source]
class freeflux.io.results.SimResults(simulated_MDVs)[source]
Parameters:

simulated_MDVs (dict) – EMU ID => MDV.

_simulated_MDVs[source]
_simulated_EMUs[source]
property simulated_EMUs[source]
simulated_MDV(emuid)[source]

Parameters emuid: str

EMU ID

__repr__()[source]
class freeflux.io.results.InstSimResults(simulated_inst_MDVs)[source]
Parameters:

simulated_inst_MDVs (dict) – EMU IDs => {timepoints => MDV}.

_simulated_inst_MDVs[source]
_simulated_EMUs[source]
_timepoints[source]
property simulated_EMUs[source]
property timepoints[source]
simulated_MDV(emuid)[source]
Parameters:

emuid (str) – EMU ID.

plot_MDV_kinetics(emuid, show_fig=True, output_dir=None)[source]
Parameters:
  • emuid (str) – EMU ID.

  • show_fig (bool) – Whether to show figure.

  • output_dir (str) – Output directory.

__repr__()[source]
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.

_opt_total_fluxes[source]
_opt_net_fluxes[source]
_opt_obj[source]
opt_resids[source]
simulated_MDVs[source]
measured_MDVs[source]
simulated_fluxes[source]
measured_fluxes[source]
hessian[source]
null_space[source]
transform_matrix[source]
n_meas[source]
n_params[source]
dof[source]
sim_MDVs_der_u[source]
sim_fluxes_der_u[source]
exp_MDVs_inv_cov[source]
exp_fluxes_inv_cov[source]
is_success[source]
property n_total_fluxes[source]
property n_net_fluxes[source]
property n_free_fluxes[source]
property opt_objective[source]
property opt_total_fluxes[source]
property opt_net_fluxes[source]
property optimization_successful[source]
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.

Parameters:
  • show_fig (bool) – Whether to show figure.

  • output_dir (str) – Output directory.

plot_simulated_vs_measured_MDVs(show_fig=True, output_dir=None)[source]

Plot simulated and measured MDVs.

Parameters:
  • show_fig (bool) – Whether to show figure.

  • output_dir (str) – Output directory.

plot_simulated_vs_measured_fluxes(show_fig=True, output_dir=None)[source]

Plot simulated and measured fluxes.

Parameters:
  • show_fig (bool) – Whether to show figure.

  • output_dir (str) – Output directory.

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.

static _get_name_of_measurements(measured_MDVs)[source]
Parameters:

measured_MDVs (dict) – EMU ID => [means, sds].

__repr__()[source]
class freeflux.io.results.FitMCResults(total_fluxes_set, net_fluxes_set)[source]
Parameters:
  • total_fluxes_set (list of ser) – Set of optimal total fluxes.

  • net_fluxes_set (list of ser) – Set of optimal net fluxes.

total_fluxes_set[source]
net_fluxes_set[source]
estimate_confidence_intervals(which='net', confidence_level=0.95)[source]

Estimate CI from a set of fluxes.

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.

__repr__()[source]
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.

_opt_total_fluxes[source]
_opt_net_fluxes[source]
_opt_concs[source]
_opt_obj[source]
opt_resids[source]
simulated_inst_MDVs[source]
measured_inst_MDVs[source]
simulated_fluxes[source]
measured_fluxes[source]
hessian[source]
null_space[source]
transform_matrix[source]
n_meas[source]
n_params[source]
dof[source]
sim_inst_MDVs_der_u[source]
sim_fluxes_der_u[source]
exp_inst_MDVs_inv_cov[source]
exp_fluxes_inv_cov[source]
is_success[source]
property n_concentrations[source]
property opt_concentrations[source]
plot_simulated_vs_measured_MDVs(show_fig=True, output_dir=None)[source]

Plot simulated and measured MDVs.

Parameters:
  • show_fig (bool) – Whether to show figure.

  • output_dir (str) – Output directory.

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.

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.

static _get_name_of_measurements(measured_MDVs)[source]
Parameters:

measured_MDVs (dict) – EMU ID => {t => [means, sds]}.

class freeflux.io.results.InstFitMCResults(total_fluxes_set, net_fluxes_set, concs_set)[source]

Bases: FitMCResults

Parameters:
  • total_fluxes_set (list of ser) – Set of optimal total fluxes.

  • net_fluxes_set (list of ser) – Set of optimal net fluxes.

  • concs_set (list of ser) – Set of optimal concentrations.

concs_set[source]
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.