fluxpy.utils.analysis ===================== .. py:module:: fluxpy.utils.analysis Functions --------- .. autoapisummary:: fluxpy.utils.analysis.get_nutrients_gradient fluxpy.utils.analysis.parse_qfca fluxpy.utils.analysis.samples_on_qfca fluxpy.utils.analysis.producing_or_consuming_a_met fluxpy.utils.analysis.get_reactions_producing_a_met fluxpy.utils.analysis.trace_path_with_backtracking_iterative Module Contents --------------- .. py:function:: get_nutrients_gradient(model, nutrients=None, upper_bound=None, step=None) -> fluxpy.utils.utils.NestedDataFrameType 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 .. py:function:: parse_qfca(qfca_output, model=None, remove_exchange_routes=True, exclude_biomass=True, format='csv') Parses QFCA (Quantitative Fatty Acid Composition Analysis) output data into a networkx graph representation. :param qfca_output: Path to the QFCA output file in CSV or Excel format. :type qfca_output: str :param model: Metabolic model object. Default is None. :type model: object, optional :param remove_exchange_routes: Whether to remove exchange reactions from the graph. Default is True. :type remove_exchange_routes: bool, optional :param exclude_biomass: Whether to exclude biomass reaction from the graph. Default is True. :type exclude_biomass: bool, optional :param format: Format of the QFCA output file. Can be 'csv' or 'xlsx'. Default is 'csv'. :type format: str, optional :returns: A networkx Graph representing the interactions between metabolic reactions based on QFCA data. :rtype: nx.Graph .. py:function:: samples_on_qfca(qfca_graph, samples) ongoing .. py:function:: producing_or_consuming_a_met(model, reaction_id, metabolite_id) Returns whether a metabolite is being produced or consumed when model is optimized. :param model: :type model: cobra.Model :param reaction_id: :type reaction_id: str :param metabolite_id: :type metabolite_id: str :returns: 'producing | consuming' (str) .. py:function:: get_reactions_producing_a_met(model, metabolite_id) Get reactions that produce a specific metabolite. .. rubric:: Notes Exloits the producing_or_consuming_a_met() function :param model: :type model: cobra.Model :param metabolite_id: :type metabolite_id: str :returns: list of reactions (cobra.Reaction) .. py:function:: trace_path_with_backtracking_iterative(model, start_reaction_id, target_reaction_id, ignore_mets=None) 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. :param model: COBRApy model object. :type model: cobra.Model :param start_reaction_id: The ID of the starting reaction. :type start_reaction_id: str :param target_reaction_id: The ID of the target reaction. :type target_reaction_id: str :param 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. :rtype: keep_rxns