fluxpy.illustrations ==================== .. py:module:: fluxpy.illustrations .. autoapi-nested-parse:: Provide functions to ullistrate metaboloc modeling alaysis findings. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/fluxpy/illustrations/build_escher_map/index /autoapi/fluxpy/illustrations/illustrations/index Functions --------- .. autoapisummary:: fluxpy.illustrations.plot_prod_env_3D fluxpy.illustrations.plot_ranging_medium_compounds fluxpy.illustrations.plot_nutrients_gradient fluxpy.illustrations.qcfa_subgraphs fluxpy.illustrations.flux_cone_example Package Contents ---------------- .. py:function:: plot_prod_env_3D(v1: pandas.Series, v2: pandas.Series, v3: pandas.Series, width=800, height=600) This function takes as arguments 3 columns of the cobra production_envelope() result to return a 3D scatter plot of those. :param v1 -- flux vector for x-axis: :param v2 -- flux vector for y-axis: :param v3 -- flux vector for z-axis which is used for the weight values: :returns: A 3D plolty.Figure object. **Usage example:** .. code-block:: python from cobra.io import load_model model = load_model("textbook") from cobra.flux_analysis import production_envelope prod_env = production_envelope(model, ["EX_glc__D_e", "EX_o2_e"]) prod_env.head(3) carbon_source flux_minimum carbon_yield_minimum mass_yield_minimum flux_maximum carbon_yield_maximum mass_yield_maximum EX_glc__D_e EX_o2_e 0 EX_glc__D_e 0.0 0.0 0.0 0.000000 0.000000 0.000000 -10.0 -60.000000 1 EX_glc__D_e 0.0 0.0 0.0 1.578947 0.052632 0.051748 -10.0 -56.842105 2 EX_glc__D_e 0.0 0.0 0.0 3.157895 0.105263 0.103496 -10.0 -53.684211 x=prod_env['EX_o2_e'] y=prod_env['EX_glc__D_e'] z=prod_env['flux_maximum'] .. py:function:: plot_ranging_medium_compounds(model: cobra.Model, dictionary_with_plots, dpi=500) Plots the behavior of medium compounds in a metabolic model across different concentrations. :param model: The metabolic model object. :type model: object :param dictionary_with_plots: A dictionary where keys are compound IDs, and values are tuples containing lists of concentrations and corresponding flux values to plot. :type dictionary_with_plots: dict :param dpi: Dots per inch (resolution) for the saved figure. Default is 500. :type dpi: int, optional :returns: A .png file .. py:function:: plot_nutrients_gradient(gradient, nutrients=None, threshold=0.2, width_size=12, height_size=12, save_fig=False, path='gradient.png', dpi=500) For each nutrient on a gradient it returns differences for the minimum and maximum cases and plots a heatmap for each where reaction that are affected with the increase of the upper bound at least threshold*max_difference are displayed. gradient -- output of the utils.get_nutrients_gradient() nutrients -- list with the reaction ids to be considered threshold -- per centage of the max difference that will be used to filter differences width_size -- width of each subplot height_size -- height of eash subplot .. py:function:: qcfa_subgraphs(H: networkx.Graph, run_app=False, save_cx2=False, cx2_output_path='qfca_graph.cx2') Creates and runs a Dash application to visualize the QCFA subgraphs using a network graph. :param H: A NetworkX graph where nodes represent reactions and edges represent relationships between them. The edge colors denote different types of couplings. :type H: networkx.Graph, mandatory :param save_cx2: Export dash cytoscape to a .cx2 format and save it as a file that can be then loaded in Cytoscape Desktop :type save_cx2: boolean, optional :param cx2_output_path: Path and output filename for the .cx2 file :type cx2_output_path: string, optional :returns: An _ExportedGraph object with either a dash Cytoscape graph or both a dash Cytoscape and a .cx2 formatted graph with the QFCA-oriented graph. To access each: .. code-block:: python _ExportedGraph.dash_graph _ExportedGraph.cx2_graph .. py:function:: flux_cone_example(facets=5, radius=5, cone_height=5, width=1000, height=1000) Generates a 3D plot of a flux cone with random points inside it. :param facets: Number of facets (sides) for the cone surface. :type facets: int :param radius: Radius of the base of the cone. :type radius: float :param cone_height: Height of the cone. :type cone_height: float :param width: Width of the plot in pixels. :type width: int :param height: Height of the plot in pixels. :type height: int :returns: A Plotly figure object containing the 3D plot of the cone and the points inside it. :rtype: plotly.graph_objects.Figure