10.1.6.1.4. freeflux.utils.utils

Define the Calculator class.

10.1.6.1.4.1. Attributes

__author__

JAX_INSTALLED

10.1.6.1.4.2. Classes

Calculator

10.1.6.1.4.3. Module Contents

freeflux.utils.utils.__author__ = 'Chao Wu'[source]
freeflux.utils.utils.JAX_INSTALLED = False[source]
class freeflux.utils.utils.Calculator(model)[source]
Parameters:

model (Model) – Freeflux Model.

model[source]
_set_timepoints()[source]
_calculate_null_space()[source]
_calculate_transform_matrix()[source]
_calculate_substrate_MDVs(extra_subs)[source]
_calculate_substrate_MDV_derivatives_basic(nvars, extra_subs)[source]
_calculate_substrate_MDV_derivatives_u(extra_subs)[source]
_calculate_substrate_MDV_derivatives_c(extra_subs)[source]
_calculate_substrate_MDV_derivatives_p(kind, extra_subs=None)[source]
Parameters:
  • kind ({"ss", "inst"}) –

    • “ss” if isotopic steady state.

    • ”inst” if isotopically nonstationary state.

  • extra_subs (list or None)

_calculate_measured_fluxes_inversed_covariance_matrix()[source]
_calculate_measured_fluxes_derivative_v()[source]
_calculate_measured_fluxes_derivative_c()[source]
_calculate_measured_fluxes_derivative_p(kind)[source]
Parameters:

kind ({"ss", "inst"}) –

  • “ss” if isotopic steady state.

  • ”inst” if isotopically nonstationary state.

_generate_random_fluxes()[source]
_reset_measured_fluxes()[source]
_calculate_measured_MDVs_inversed_covariance_matrix()[source]
_calculate_measured_inst_MDVs_inversed_covariance_matrix()[source]
_generate_random_MDVs()[source]
_reset_measured_MDVs()[source]
_generate_random_inst_MDVs()[source]
_reset_measured_inst_MDVs()[source]
static _calculate_matrix_A_and_B_derivatives_v(EAM, fluxids)[source]
Parameters:
  • EAMstr (df) – EMU adjacency matrix of some size.

  • fluxids (list) – Total fluxes IDs.

Returns:

matrix_A_der, matrix_B_der – Derivatives of A(B) w.r.t. total fluxes in shape of (len(total fluxes), A(B).shape[0], A(B).shape[1]).

Return type:

3-D array

_calculate_matrix_As_and_Bs_derivatives_u(n_jobs)[source]
Parameters:

n_jobs (int) – # of jobs to run in parallel.

Returns:

  • matrix_A_der (3-D array) – Derivatives of A(B) w.r.t. free fluxes in shape of (len(free fluxes), A(B).shape[0], A(B).shape[1]).

  • matrix_B_der (3-D array) – Derivatives of A(B) w.r.t. free fluxes in shape of (len(free fluxes), A(B).shape[0], A(B).shape[1]).

_calculate_matrix_As_and_Bs_derivatives_c()[source]
Returns:

  • matrix_A_der (3-D array) – Derivatives of A(B) w.r.t. total fluxes in shape of (len(concs), A(B).shape[0], A(B).shape[1]).

  • matrix_B_der (3-D array) – Derivatives of A(B) w.r.t. total fluxes in shape of (len(concs), A(B).shape[0], A(B).shape[1]).

_calculate_matrix_As_and_Bs_derivatives_p(kind, n_jobs)[source]
Parameters:
  • kind ({"ss", "inst"}) –

    • “ss” if isotopic steady state.

    • ”inst” if isotopically nonstationary state.

  • n_jobs (int) – # of jobs to run in parallel.

_lambdify_matrix_As_and_Bs()[source]
_calculate_matrix_Ms_derivatives_u()[source]
_calculate_matrix_Ms_derivatives_c()[source]
_calculate_matrix_Ms_derivatives_p()[source]
_lambdify_matrix_Ms()[source]
_calculate_initial_matrix_Xs()[source]
_calculate_initial_matrix_Ys()[source]
_calculate_initial_matrix_Xs_derivatives_p()[source]
_calculate_initial_matrix_Ys_derivatives_p()[source]
_build_initial_sim_MDVs()[source]
_calculate_MDVs()[source]

This method simulate MDVs at isotopically steady state.

Returns:

simMDVs – EMU ID => MDV (in array).

Return type:

dict

_calculate_MDVs_and_derivatives_p()[source]

This method simulate MDVs and their derivatives at isotopically steady state.

Returns:

  • simMDVs (dict) – EMU ID => MDV (in array).

  • simMDVsDer (dict) – EMU ID => 2-D array in shape of (len(MDV), len(u)).

_calculate_inst_MDVs()[source]

This method simulate MDVs at isotopically nonstationary state.

Returns:

simInstMDVs – EMU ID => {t => MDV (in array)} (starting from t1).

Return type:

dict

_calculate_inst_MDVs_and_derivatives_p()[source]

This method simulate MDVs and their derivatives at isotopically nonstationary state.

Returns:

  • simInstMDVs (dict) – EMU ID => {t => MDV (in array)} (starting from t1).

  • simInstMDVsDer (dict) – EMU ID => {t => 2-D array in shape of (len(MDV), len(u)+len(c))} (starting from t1).