micom.interaction.focal

Quantify metabolic interactions between taxa.

Attributes

Functions

workflow(func, args[, threads, description, progress])

Run analyses for several samples in parallel.

_metabolite_interaction(→ pandas.DataFrame)

Checks if and how taxa interact.

sample_interactions(→ pandas.DataFrame)

Quantify interactions in a single sammple.

_interact(→ pandas.DataFrame)

Quantify interactions of a focal taxon with other taxa.

interactions(→ pandas.DataFrame)

Quantify interactions of a focal/reference taxon with other taxa.

Module Contents

micom.interaction.focal.GrowthResults[source]
micom.interaction.focal.workflow(func, args, threads=4, description=None, progress=True)[source]

Run analyses for several samples in parallel.

This will analyze several samples in parallel. Includes a workaround for optlang memory leak.

Parameters:
  • func (function) – A function that takes a single argument (can be any object) and that performs your analysis for a single sample.

  • args (array-like object) – An array-like object (list, tuple, numpy array, pandas Series, etc.) that contains the arguments for each sample.

  • threads (positive int) – How many samples to analyze in parallel at once.

  • description (str) – The dewscription shown in front of the progress bar.

  • progress (bool) – Whether to show a progress bar.

micom.interaction.focal._metabolite_interaction(fluxes: pandas.DataFrame, taxon: str, partner: str) pandas.DataFrame[source]

Checks if and how taxa interact.

micom.interaction.focal.sample_interactions(fluxes: pandas.DataFrame, sample_id: str, taxon: str) pandas.DataFrame[source]

Quantify interactions in a single sammple.

Parameters:
  • fluxes (pandas.DataFrame) – A table of exchange fluxes.

  • sample_id (str) – The sample id to use.

  • taxon (str) – The focal taxon to use.

Returns:

The mapped interactions between the focal taxon and all other taxa.

Return type:

pandas.DataFrame

micom.interaction.focal._interact(args: List) pandas.DataFrame[source]

Quantify interactions of a focal taxon with other taxa.

micom.interaction.focal.interactions(results: micom.workflows.GrowthResults, taxa: None | str | List[str], threads: int = 1, progress: bool = True) pandas.DataFrame[source]

Quantify interactions of a focal/reference taxon with other taxa.

Parameters:
  • results (GrowthResults) – The growth results to use.

  • taxa (str, list of str, or None) – The focal taxa to use. Can be a single taxon, a list of taxa or None in which case all taxa are considered.

Returns:

The mapped interactions between the focal taxon and all other taxa.

Return type:

pandas.DataFrame