micom.viz.association¶
Visualization for phenotype prediction.
Attributes¶
Functions¶
|
Test for differential metabolite production. |
Module Contents¶
- micom.viz.association.plot_association(results, phenotype, variable_type='binary', variable_name='phenotype', filename='association_%s.html' % datetime.now().strftime('%Y%m%d'), flux_type='production', fdr_threshold=0.05, threads=1, atol=1e-06)[source]¶
Test for differential metabolite production.
This will check for associations of the phenotype with metabolite fluxes. Individual tests are performed using non-parametric tests of the overall consumption or production fluxes for each samples versus the phenotype.
To assess the the global association, this will fit 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.
threads (int) – The number of threads to use.
fdr_threshold (float) – The false discovery rate cutoff to use (FDR-corrected p-value cutoff). Defaults to 0.05.
atol (float) – Tolerance to consider a flux different from zero. Will default to the solver tolerance.
- Returns:
A MICOM visualization. Can be served with viz.view.
- Return type: