freeflux.analysis.inst_fit ========================== .. py:module:: freeflux.analysis.inst_fit .. autoapi-nested-parse:: Define the InstFitter class. Attributes ---------- .. autoapisummary:: freeflux.analysis.inst_fit.__author__ Classes ------- .. autoapisummary:: freeflux.analysis.inst_fit.InstFitter Module Contents --------------- .. py:data:: __author__ :value: 'Chao Wu' .. py:class:: InstFitter(model) Bases: :py:obj:`freeflux.analysis.fit.Fitter`, :py:obj:`freeflux.analysis.inst_simulate.InstSimulator` Estimated fluxes are in the unit of umol/gCDW/s if concentrations in the unit of umol/gCDW and timepoints in the unit of s. .. py:method:: set_measured_MDVs(fragmentid, timepoints, means, sds) Set measured MDVs at various timepoints. :param fragmentid: Metabolite ID + '_' + atom NOs, e.g., 'Glu_12345'. :type fragmentid: str :param timepoints: Timepoint(s). :type timepoints: float or list of float :param means: Mean of measured MDV(s). len(means) should be equal to len(timepoints). :type means: array or list of array :param sds: Standard deviation of measured MDV(s). len(sds) should be equal to len(timepoints). :type sds: array or list of array .. py:method:: set_measured_MDVs_from_file(file) Read measured MDVs at various timepoints from file. :param file: 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. :type file: file path .. py:method:: _unset_measured_MDVs(fragmentid_tpoints) :param fragmentid_tpoints: measured MDV ID => list of timepoints. :type fragmentid_tpoints: dict .. py:method:: set_concentration_bounds(metabid, bounds) Set lower and upper bounds for concentration in unit of umol/gCDW. :param metabid: Metabolite ID. If 'all', all concentrations will be set to the range. :type metabid: str or 'all' :param bounds: [lower bound, upper bound]. Lower bound is not allow to equal upper bound. :type bounds: 2-list .. py:method:: _set_default_concentration_bounds() This method assign bounds of [0.01, 100] (umol/gCDW) for concentrations not set by set_concentration_bounds .. py:method:: _unset_concentration_bounds(metabids) :param metabids: Metabolite ID(s). :type metabids: str or list of str .. py:method:: _decompose_network(n_jobs) :param n_jobs: # of jobs to run in parallel. :type n_jobs: int .. py:method:: _set_timepoints() .. py:method:: _calculate_matrix_Ms_derivatives_p() .. py:method:: _unset_matrix_Ms_derivatives_p() .. py:method:: _calculate_measured_inst_MDVs_inversed_covariance_matrix() .. py:method:: _unset_measured_inst_MDVs_inversed_covariance_matrix() .. py:method:: _calculate_initial_matrix_Xs_derivatives_p() .. py:method:: _unset_initial_matrix_Xs_derivatives_p() .. py:method:: _calculate_initial_matrix_Ys_derivatives_p() .. py:method:: _unset_initial_matrix_Ys_derivatives_p() .. py:method:: _estimate_concentrations_range() .. py:method:: _unset_concentrations_range(metabids) :param metabids: Metabolite ID(s). :type metabids: str or list of str .. py:method:: prepare(dilution_from=None, n_jobs=1) :param dilution_from: ID(s) of unlabeled (inactive) metabolite leading to dilution effect. These metabolites have zero stoichiometric coefficients in reaction network. :type dilution_from: str or list of str :param n_jobs: If n_jobs > 1, decomposition job will run in parallel. :type n_jobs: int .. py:method:: _check_dependencies(fit_measured_fluxes) :param fit_measured_fluxes: Whether to fit measured fluxes. :type fit_measured_fluxes: bool .. py:method:: solve(fit_measured_fluxes=True, ini_fluxes=None, ini_concs=None, solver='slsqp', tol=1e-06, max_iters=400, show_progress=True) :param fit_measured_fluxes: Whether to fit measured fluxes. :type fit_measured_fluxes: bool :param ini_fluxes: Initial values of net fluxes. :type ini_fluxes: ser or file in .tsv or .xlsx :param ini_concs: Initial values of concentrations. :type ini_concs: ser or file in .tsv or .xlsx :param solvor: * If "slsqp", scipy.optimize.minimze will be used. * If "ralg", openopt NLP solver will be used. :type solvor: {"slsqp", "ralg"} :param tol: Tolerance for termination. :type tol: float :param max_iters: Maximum # of iterations. :type max_iters: int :param show_progress: Whether to show the progress bar. :type show_progress: bool .. py:method:: _solve_with_confidence_intervals(fit_measured_fluxes, ini_fluxes, ini_concs, solver, tol, max_iters, nruns) :param fit_measured_fluxes: Whether to fit measured fluxes. :type fit_measured_fluxes: bool :param ini_fluxes: Initial values of net fluxes. :type ini_fluxes: ser or file in .tsv or .xlsx or None :param ini_concs: Initial values of concentrations. :type ini_concs: ser or file in .tsv or .xlsx or None :param solvor: * If "slsqp", scipy.optimize.minimze will be used. * If "ralg", openopt NLP solver will be used. :type solvor: {"slsqp", "ralg"} :param tol: Tolerance for termination. :type tol: float :param max_iters: Maximum # of iterations. :type max_iters: int :param nruns: # of estimations in each worker. :type nruns: int .. py:method:: 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) :param fit_measured_fluxes: Whether to fit measured fluxes. :type fit_measured_fluxes: bool :param ini_fluxes: Initial values of net fluxes. :type ini_fluxes: ser or file in .tsv or .xlsx :param ini_concs: Initial values of concentrations. :type ini_concs: ser or file in .tsv or .xlsx :param solvor: * If "slsqp", scipy.optimize.minimze will be used. * If "ralg", openopt NLP solver will be used. :type solvor: {"slsqp", "ralg"} :param tol: Tolerance for termination. :type tol: float :param max_iters: Max # of iterations. :type max_iters: int :param show_progress: Whether to show the progress bar. :type show_progress: bool :param n_runs: # of runs to estimate confidence intervals. :type n_runs: int :param n_jobs: # of jobs to run in parallel. :type n_jobs: int