:py:mod:`cobra.summary.reaction_summary` ======================================== .. py:module:: cobra.summary.reaction_summary .. autoapi-nested-parse:: Provide the reaction summary class. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: cobra.summary.reaction_summary.ReactionSummary Attributes ~~~~~~~~~~ .. autoapisummary:: cobra.summary.reaction_summary.logger .. py:data:: logger .. py:class:: ReactionSummary(*, reaction: cobra.Reaction, model: cobra.Model, solution: Optional[cobra.Solution] = None, fva: Optional[Union[float, pandas.DataFrame]] = None, **kwargs) Bases: :py:obj:`cobra.summary.Summary` Define the reaction summary. .. seealso:: :obj:`Summary` Parent that defines further attributes. :obj:`MetaboliteSummary`, :obj:`ModelSummary` .. py:method:: _generate(model: cobra.Model, solution: Optional[cobra.Solution], fva: Optional[Union[float, pandas.DataFrame]]) -> None Prepare the data for the summary instance. :param model: The metabolic model for which to generate a metabolite summary. :type model: cobra.Model :param solution: A previous model solution to use for generating the summary. If ``None``, the summary method will generate a parsimonious flux distribution. :type solution: cobra.Solution, optional :param fva: Whether or not to include flux variability analysis in the output. If given, `fva` should either be a previous FVA solution matching the model or a float between 0 and 1 representing the fraction of the optimum objective to be searched. :type fva: pandas.DataFrame or float, optional .. py:method:: _string_flux(threshold: float, float_format: str) -> str Transform a flux data frame to a string. :param threshold: Hide fluxes below the threshold from being displayed. :type threshold: float :param float_format: Format string for floats. :type float_format: str :returns: A string representation of the flux (with ranges). :rtype: str .. py:method:: to_string(names: bool = False, threshold: Optional[float] = None, float_format: str = '.4G', column_width: int = 79) -> str Return a pretty string representation of the reaction summary. :param names: Whether or not elements should be displayed by their common names (default False). :type names: bool, optional :param threshold: Hide fluxes below the threshold from being displayed. If no value is given, the model tolerance is used (default None). :type threshold: float, optional :param float_format: Format string for floats (default '.4G'). :type float_format: str, optional :param column_width: The maximum column width for each row (default 79). :type column_width: int, optional :returns: The summary formatted as a pretty string. :rtype: str .. py:method:: to_html(names: bool = False, threshold: Optional[float] = None, float_format: str = '.4G') -> str Return a rich HTML representation of the reaction summary. :param names: Whether or not elements should be displayed by their common names (default False). :type names: bool, optional :param threshold: Hide fluxes below the threshold from being displayed. If no value is given, the model tolerance is used (default None). :type threshold: float, optional :param float_format: Format string for floats (default '.4G'). :type float_format: str, optional :returns: The summary formatted as HTML. :rtype: str