micom.workflows.media

Example workflows for micom.

Module Contents

Functions

process_medium(medium, samples)

Prepare a medium for simulation.

_medium(args)

Get minimal medium for a single model.

minimal_media(manifest, model_folder, summarize=True, min_growth=0.1, threads=1)

Calculate the minimal medium for a set of community models.

_fix_medium(args)

Get the fixed medium for a model.

fix_medium(manifest, model_folder, medium, community_growth=0.1, min_growth=0.001, max_import=1, minimize_components=False, summarize=True, weights=None, threads=1)

Augment a growth medium so all community members can grow in it.

micom.workflows.media.process_medium(medium, samples)[source]

Prepare a medium for simulation.

micom.workflows.media._medium(args)[source]

Get minimal medium for a single model.

micom.workflows.media.minimal_media(manifest, model_folder, summarize=True, min_growth=0.1, threads=1)[source]

Calculate the minimal medium for a set of community models.

micom.workflows.media._fix_medium(args)[source]

Get the fixed medium for a model.

micom.workflows.media.fix_medium(manifest, model_folder, medium, community_growth=0.1, min_growth=0.001, max_import=1, minimize_components=False, summarize=True, weights=None, threads=1)[source]

Augment a growth medium so all community members can grow in it.

Parameters
  • manifest (pandas.DataFrame) – The manifest as returned by the build workflow.

  • model_folder (str) – The folder in which to find the files mentioned in the manifest.

  • medium (pandas.Series or pandas.DataFrame) – A growth medium with exchange reaction IDs as index and positive import fluxes as values. If a DataFrame needs columns flux and reaction.

  • community_growth (positive float) – The minimum community-wide growth rate that has to be achieved on the created medium.

  • min_growth (positive float) – The minimum biomass production required for growth.

  • max_import (positive float) – The maximum import rate for added imports.

  • minimize_components (boolean) – Whether to minimize the number of media components rather than the total flux.

  • summarize (boolean) – Whether to summarize the medium across all samples. If False will return a medium for each sample.

  • weights (str) – Will scale the fluxes by a weight factor. Can either be “mass” which will scale by molecular mass, a single element which will scale by the elemental content (for instance “C” to scale by carbon content). If None every metabolite will receive the same weight. Will be ignored if minimize_components is True.

  • threads (int) – The number of processes to use.

Returns

A new growth medium with the smallest amount of augmentations such that all members of the community can grow in it.

Return type

pandas.DataFrame