10.1.1.1.2. freeflux.analysis.inst_fit¶
Define the InstFitter class.
10.1.1.1.2.1. Attributes¶
10.1.1.1.2.2. Classes¶
Estimated fluxes are in the unit of umol/gCDW/s if concentrations in the unit of |
10.1.1.1.2.3. Module Contents¶
- class freeflux.analysis.inst_fit.InstFitter(model)[source]¶
Bases:
freeflux.analysis.fit.Fitter,freeflux.analysis.inst_simulate.InstSimulatorEstimated fluxes are in the unit of umol/gCDW/s if concentrations in the unit of umol/gCDW and timepoints in the unit of s.
- set_measured_MDVs(fragmentid, timepoints, means, sds)[source]¶
Set measured MDVs at various timepoints.
- Parameters:
- set_measured_MDVs_from_file(file)[source]¶
Read measured MDVs at various timepoints from file.
- Parameters:
file (file path) –
Path of tsv or excel file with fields “fragment_ID”, “time”, “mean” and “sd”. “fragment_ID” is metabolite ID + ‘_’ + atom NOs, e.g., ‘Glu_12345’; “time” is timepoint when MDVs are measured (while some timepoints could be missing); “mean” and “sd” are the mean and standard deviation of MDV with element seperated by ‘,’.
Header line starts with “#”, and will be skiped.
- _unset_measured_MDVs(fragmentid_tpoints)[source]¶
- Parameters:
fragmentid_tpoints (dict) – measured MDV ID => list of timepoints.
- set_concentration_bounds(metabid, bounds)[source]¶
Set lower and upper bounds for concentration in unit of umol/gCDW.
- Parameters:
metabid (str or 'all') – Metabolite ID. If ‘all’, all concentrations will be set to the range.
bounds (2-list) – [lower bound, upper bound]. Lower bound is not allow to equal upper bound.
- _set_default_concentration_bounds()[source]¶
This method assign bounds of [0.01, 100] (umol/gCDW) for concentrations not set by set_concentration_bounds
- _check_dependencies(fit_measured_fluxes)[source]¶
- Parameters:
fit_measured_fluxes (bool) – Whether to fit measured fluxes.
- solve(fit_measured_fluxes=True, ini_fluxes=None, ini_concs=None, solver='slsqp', tol=1e-06, max_iters=400, show_progress=True)[source]¶
- Parameters:
fit_measured_fluxes (bool) – Whether to fit measured fluxes.
ini_fluxes (ser or file in .tsv or .xlsx) – Initial values of net fluxes.
ini_concs (ser or file in .tsv or .xlsx) – Initial values of concentrations.
solvor ({"slsqp", "ralg"}) –
If “slsqp”, scipy.optimize.minimze will be used.
If “ralg”, openopt NLP solver will be used.
tol (float) – Tolerance for termination.
max_iters (int) – Maximum # of iterations.
show_progress (bool) – Whether to show the progress bar.
- _solve_with_confidence_intervals(fit_measured_fluxes, ini_fluxes, ini_concs, solver, tol, max_iters, nruns)[source]¶
- Parameters:
fit_measured_fluxes (bool) – Whether to fit measured fluxes.
ini_fluxes (ser or file in .tsv or .xlsx or None) – Initial values of net fluxes.
ini_concs (ser or file in .tsv or .xlsx or None) – Initial values of concentrations.
solvor ({"slsqp", "ralg"}) –
If “slsqp”, scipy.optimize.minimze will be used.
If “ralg”, openopt NLP solver will be used.
tol (float) – Tolerance for termination.
max_iters (int) – Maximum # of iterations.
nruns (int) – # of estimations in each worker.
- solve_with_confidence_intervals(fit_measured_fluxes=True, ini_fluxes=None, ini_concs=None, solver='slsqp', tol=1e-06, max_iters=400, n_runs=100, n_jobs=1, show_progress=True)[source]¶
- Parameters:
fit_measured_fluxes (bool) – Whether to fit measured fluxes.
ini_fluxes (ser or file in .tsv or .xlsx) – Initial values of net fluxes.
ini_concs (ser or file in .tsv or .xlsx) – Initial values of concentrations.
solvor ({"slsqp", "ralg"}) –
If “slsqp”, scipy.optimize.minimze will be used.
If “ralg”, openopt NLP solver will be used.
tol (float) – Tolerance for termination.
max_iters (int) – Max # of iterations.
show_progress (bool) – Whether to show the progress bar.
n_runs (int) – # of runs to estimate confidence intervals.
n_jobs (int) – # of jobs to run in parallel.