msmedia

MediaCompound()

This class instantiates a media compound for potential manipulations:

from modelseedpy.core import MediaCompound
media_comp = MediaCompound(compound_id, lower_bound, upper_bound, concentration=None)
  • compound_id str & concentration float: The ID and concentration of the media compound.

  • lower_bound & upper_bound float: The lower and upper bounds of the exchange reaction for the media compound, respectively.

MSMedia()

This class instantiates a media for investigation:

from modelseedpy.core import MSMedia
msmedia = MSMedia(media_id)
  • media_id str: The ID of the investigated media.

from_dict()

A function that converts a media dictionary into a media object:

media = msmedia.from_dict(media_dictionary)
  • media_dictionary dict: A dictionary representation of the media that contains either a list of exchange bounds or the uptake magnitude (value) for each compound in the media.

returns media modelseedpy.core.msmedia.MSMedia: The media that is constructed from the dictionary format.

get_media_constraints()

A function that assigns a compartment to each compound in the media:

media = msmedia.get_media_constraints(cmp='e0')
  • cmp str: The compartment suffix that will be appended to all compounds in the media, while cmp is not None.

returns media dict: A dictionary of lower and upper bounds (values) for each metabolite ID (key).

merge()

A function that expands the media compounds according to amendments from the aforementioned MediaCompound object:

msmedia.merge(media, overwrite_overlap=False)
  • media modelseedpy.core.msmedia.MSMedia: The media whose compound compartments have been defined to the parameterized compartment.

  • overwrite_overlap bool: specifies whether existing metabolite IDs will be redefined by the modelseedpy.core.msmedia.MediaCompound compound object.