17.1.1.1.1.1. cobra.core.summary

17.1.1.1.1.1.1. Submodules

17.1.1.1.1.1.2. Package Contents

17.1.1.1.1.1.2.1. Classes

Summary

Define the abstract base summary.

MetaboliteSummary

Define the metabolite summary.

ModelSummary

Define the model summary.

class cobra.core.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()

Return a data frame representation of the summary.

abstract _generate(self)

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)

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)

Generate a pandas DataFrame.

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

abstract _to_table(self)

Generate a pretty-print table.

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

__str__(self)

Return str(self).

_repr_html_(self)
class cobra.core.summary.MetaboliteSummary(metabolite, model, **kwargs)[source]

Bases: cobra.core.summary.Summary

Define the metabolite summary.

metabolite

The metabolite to summarize.

Type

cobra.Metabolite

See also

Summary

Parent that defines further attributes.

ReactionSummary, ModelSummary

_generate(self)
Returns

flux_summary – The DataFrame of flux summary data.

Return type

pandas.DataFrame

to_frame(self)
Returns

Return type

A pandas.DataFrame of the summary.

_to_table(self)
Returns

Return type

A string of the summary table.

class cobra.core.summary.ModelSummary(model, **kwargs)[source]

Bases: cobra.core.summary.Summary

Define the model summary.

See also

Summary

Parent that defines further attributes.

MetaboliteSummary, ReactionSummary

_generate(self)
Returns

flux_summary – The DataFrame of flux summary data.

Return type

pandas.DataFrame

to_frame(self)
Returns

Return type

A pandas.DataFrame of the summary.

_to_table(self)
Returns

Return type

A string of the summary table.