You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is incompatible with cobra.Solution.fluxes which breaks a lot of the cobra functionality like for instance summary methods.
It can be pretty sparse for very divergent models (many NA entries)
It mixes medium and taxa fluxes
It does not specify if export fluxes denote import or export which is one of the most common help requests we receive
Basically all methods using flux results in MICOM will convert them to a long format
Proposed new API for fluxes
CommunitySolution.fluxes will retain the cobrapy format and will superseded by new accessors that all return fluxes in long format:
CommunitySolution.exchange_fluxes
Similar to the previous one but with the taxa annotated.
reaction name taxon flux direction micom_id
0 EX_ac_m ac_m medium exchange medium 1.814984e-11 export EX_ac_m
1 EX_acald_m acald_m medium exchange medium 1.328645e-11 export EX_acald_m
2 EX_akg_m akg_m medium exchange medium 3.225128e-12 export EX_akg_m
3 EX_co2_m co2_m medium exchange medium 2.280983e+01 export EX_co2_m
4 EX_etoh_m etoh_m medium exchange medium 1.515389e-11 export EX_etoh_m
.. ... ... ... ... ...
This will consolidate GrowthResults and CommunitySolution and gives a more readable format. All those properties are generated on the fly when accessing the property.
Additionaly, we may also want to save the annotations in the solution but they may be large, so it might be better to have a property on the model class like Community.annotations.
Additional context
A similar format change is planned for Community.knockout_taxa. elasticities already uses a long format.
The text was updated successfully, but these errors were encountered:
cdiener
changed the title
{API] Proposed new format for fluxes
[API] Proposed new format for fluxes
Apr 26, 2021
Sorry for perhaps the outdated question.
I am a graduate student working with MES scores from Marcelino et al., Nature Communications 2023
I am currently implementing MES framework for my metgenome data and confused about the res.exchanges['flux'] from the micom.workflow.grow function.
If I want to get the total production flux or consumption flux of a certain metabolite, should I weight each flux of each metabolite with relative abundance of each species? or are the flux of each metabolite already weighted by each species abudance?
I looked at CD_focus/MetModels_summarize_total_produc_consump.py and R_scripts_4_figs
/sulfur_stats_He2017.R and it seemed to me that it was the former case but I just wanted to be sure.
Yes, exactly it would be scaled by relative abundance, though you can also use the production_rates function that does that for you. Also note that MES scores are part of MICOM since version 0.35.0. See the MES function and new visualizations as well.
This is a proposal for a new format for fluxes slated for MICOM 1.0. Feel free to comment 😄
Checklist
Current state
The current format for fluxes returned by MICOM is a table in wide format:
This has resulted in some issues:
cobra.Solution.fluxes
which breaks a lot of the cobra functionality like for instance summary methods.Proposed new API for fluxes
CommunitySolution.fluxes
will retain the cobrapy format and will superseded by new accessors that all return fluxes in long format:CommunitySolution.exchange_fluxes
Similar to the previous one but with the taxa annotated.
CommunitySolution.internal_fluxes
This will consolidate
GrowthResults
andCommunitySolution
and gives a more readable format. All those properties are generated on the fly when accessing the property.Additionaly, we may also want to save the annotations in the solution but they may be large, so it might be better to have a property on the model class like
Community.annotations
.Additional context
A similar format change is planned for
Community.knockout_taxa
.elasticities
already uses a long format.The text was updated successfully, but these errors were encountered: