micom.viz.prediction#

Visualization for phenotype prediction.

Module Contents#

Functions#

plot_fit(results, phenotype[, variable_type, ...])

Test for differential metabolite production.

micom.viz.prediction.plot_fit(results, phenotype, variable_type='binary', variable_name='phenotype', filename='fit_%s.html' % datetime.now().strftime('%Y%m%d'), flux_type='production', min_coef=0.001, atol=1e-06)[source]#

Test for differential metabolite production.

This will fit the phenotype response using L1-regularized linear models with log-fluxes as features. Will use LASSO regression for a continuous response and L1-regularized Logistic regression for a binary response.

Parameters:
  • results (micom.workflows.GrowthResults) – The results returned by the grow workflow.

  • phenotype (pandas.Series) – The data to be fitted. Its index must correspond to sample_id in exchanges.

  • variable_type (str of ["binary", "continuous"]) – The type of the variable.

  • variable_name (str) – A short description of the phenotype for instance “disease_status”.

  • filename (str) – The HTML file where the visualization will be saved.

  • flux_type (str of ["import", "production"]) – Whether to fit using import or production fluxes.

  • min_coef (float in [0.0, Inf]) – Only report coefficient that are at least that large.

  • atol (float) – Tolerance to consider a flux different from zero. Should be roughly equivalent to the solver tolerance.

Returns:

A MICOM visualization. Can be served with viz.view.

Return type:

Visualization