17.1.1.1.1.1.1.3. cobra.core.summary.summary

Define the Summary class.

17.1.1.1.1.1.1.3.1. Module Contents

17.1.1.1.1.1.1.3.1.1. Classes

Summary

Define the abstract base summary.

class cobra.core.summary.summary.Summary(model, solution=None, threshold=None, fva=None, names=False, float_format='{:.3G}'.format, **kwargs)[source]

Bases: object

Define the abstract base summary.

model

The metabolic model in which to generate a summary description.

Type

cobra.Model

solution

A solution that matches the given model.

Type

cobra.Solution

threshold

Threshold below which fluxes are not reported.

Type

float, optional

fva

The result of a flux variability analysis (FVA) involving reactions of interest if an FVA was requested.

Type

pandas.DataFrame, optional

names

Whether or not to use object names rather than identifiers.

Type

bool

float_format

Format string for displaying floats.

Type

callable

to_frame()[source]

Return a data frame representation of the summary.

abstract _generate(self)[source]

Generate the summary for the required cobra object.

This is an abstract method and thus the subclass needs to implement it.

_process_flux_dataframe(self, flux_dataframe)[source]

Process a flux DataFrame for convenient downstream analysis.

This method removes flux entries which are below the threshold and also adds information regarding the direction of the fluxes. It is used in both ModelSummary and MetaboliteSummary.

Parameters

flux_dataframe (pandas.DataFrame) – The pandas.DataFrame to process.

Returns

Return type

A processed pandas.DataFrame.

abstract to_frame(self)[source]

Generate a pandas DataFrame.

This is an abstract method and thus the subclass needs to implement it.

abstract _to_table(self)[source]

Generate a pretty-print table.

This is an abstract method and thus the subclass needs to implement it.

__str__(self)[source]

Return str(self).

_repr_html_(self)[source]