fluxpy.utils.analysis¶
Functions¶
Assuming a single medium comound changes at a time, it returns FVA findings over the chaning envs. |
|
|
Parses QFCA (Quantitative Fatty Acid Composition Analysis) output data into a networkx graph representation. |
|
ongoing |
|
Returns whether a metabolite is being produced or consumed when model is optimized. |
|
Get reactions that produce a specific metabolite. |
|
Trace a path from the start reaction to the target reaction through reactants, |
Module Contents¶
- fluxpy.utils.analysis.get_nutrients_gradient(model, nutrients=None, upper_bound=None, step=None) fluxpy.utils.utils.NestedDataFrameType[source]¶
Assuming a single medium comound changes at a time, it returns FVA findings over the chaning envs. The model.medium will be used, i.e. first set the medium you want to investigate to your model. Returns a df with as many rows as the model.medium and columns as many as their quotient by the step. Each cell of this df includes the fva result for the medium with the corresponding alteration. For example, df.loc[0,0] corresponds to the medium where the first compound has the lowest value possible.
model – a cobra model nutrients – list of reaction ids for which a gradient will be calculated upper_bound – maximum a flux can get step – increase of upper_bound in each iteration of the gradient
- fluxpy.utils.analysis.parse_qfca(qfca_output, model=None, remove_exchange_routes=True, exclude_biomass=True, format='csv')[source]¶
Parses QFCA (Quantitative Fatty Acid Composition Analysis) output data into a networkx graph representation.
- Parameters:
qfca_output (str) – Path to the QFCA output file in CSV or Excel format.
model (object, optional) – Metabolic model object. Default is None.
remove_exchange_routes (bool, optional) – Whether to remove exchange reactions from the graph. Default is True.
exclude_biomass (bool, optional) – Whether to exclude biomass reaction from the graph. Default is True.
format (str, optional) – Format of the QFCA output file. Can be ‘csv’ or ‘xlsx’. Default is ‘csv’.
- Returns:
A networkx Graph representing the interactions between metabolic reactions based on QFCA data.
- Return type:
nx.Graph
- fluxpy.utils.analysis.producing_or_consuming_a_met(model, reaction_id, metabolite_id)[source]¶
Returns whether a metabolite is being produced or consumed when model is optimized.
- Parameters:
model (cobra.Model) –
reaction_id (str) –
metabolite_id (str) –
- Returns:
‘producing | consuming’ (str)
- fluxpy.utils.analysis.get_reactions_producing_a_met(model, metabolite_id)[source]¶
Get reactions that produce a specific metabolite.
Notes
Exloits the producing_or_consuming_a_met() function
- Parameters:
model (cobra.Model) –
metabolite_id (str) –
- Returns:
list of reactions (cobra.Reaction)
- fluxpy.utils.analysis.trace_path_with_backtracking_iterative(model, start_reaction_id, target_reaction_id, ignore_mets=None)[source]¶
Trace a path from the start reaction to the target reaction through reactants, using an iterative DFS approach, with backtracking when exchange reactions are encountered.
- Parameters:
model (cobra.Model) – COBRApy model object.
start_reaction_id (str) – The ID of the starting reaction.
target_reaction_id (str) – The ID of the target reaction.
ignore_mets – A list of metabolite IDs to ignore during tracing (optional).
- Returns:
A set of reactions needed to go from start to target, avoiding dead-end exchange reactions.
- Return type:
keep_rxns