diel_models package

DielModelsCreator

diel_models.diel_models_creator.diel_models_creator(model: Model, storage_pool_metabolites: List[str], photon_reaction_id: List[str], nitrate_exchange_reaction: List[str] = [], biomass_reaction_id: str | None = None, tissues: List[str] | None = None, day_ratio_value: int = 3, night_ratio_value: int = 2) Model

Function that allows you to run the pipeline in one go, returning the resulting model, where the arguments are all relative to the original model.

Parameters:
  • model (cobra.Model) – Metabolic model

  • storage_pool_metabolites (List[str]) – list with all the metabolites for storage pool

  • photon_reaction_id (List[str]) – id or ids for photon reaction(s) - in case of multi tissues models for example.

  • nitrate_exchange_reaction (List[str]) – id for nitrate exchange reaction(s) - in case of multi tissues models for example.

  • biomass_reaction_id (str, optional) – id for biomass_reaction, defaults to None in case no biomass reaction defined.

  • tissues (List[str], optional) – List of tissues in the multi-tissue model, defaults to None for generic models.

  • day_ratio_value (int, optional) – The ratio of nitrate uptake during the day, default is 3.

  • night_ratio_value (int, optional) – The ratio of nitrate uptake during the night, default is 2.

Return type:

cobra.Model

Submodules

DayNightCreator

class diel_models.day_night_creator.DayNightCreator(model: Model)

Bases: Step

day_attribution() None

Loop into the reactions and metabolites of a metabolic model and append “_Day” to reaction and metabolites identifications and names.

duplicate() None

Function that duplicates the original reactions and replaces the suffix “_Day” with the suffix “_Night” and further duplicates the corresponding metabolites.

run() Model

Executes the methods of the class DayNightCreator.

validate() None

Validates the model received initially in terms of reactions, metabolites and objective function.

StoragePoolGenerator

class diel_models.storage_pool_generator.StoragePoolGenerator(model: Model, metabolites: List[str], tissues: List[str] | None = None)

Bases: Step

create_exchange_reaction(metabolite_id: str, metabolite_sp_id: str, direction: str) Reaction

It creates a Reaction object representing an exchange reaction for the specified metabolite in the specified direction.

Parameters:
  • metabolite_id (str) – ID from original metabolite

  • metabolite_sp_id (str) – ID from metabolite in sp

  • direction (str) – Day or Night

Return type:

cobra.Reaction

create_storage_pool_first_reactions() None

According to the given metabolite IDs, this function creates the corresponding exchange reaction of the metabolite to the storage pool.

create_storage_pool_metabolites() None

According to the given metabolite IDs, this function creates new metabolites for a new compartment: storage pool.

If the model is a multi-tissue model (tissues are provided), the metabolites in the storage pool will have the corresponding tissue name in their sp names.

Raises:
  • ValueError – If a metabolite ID is not present in the given model.

  • ValueError – If no matching tissue found for some metabolite ID.

create_storage_pool_second_reactions() None

According to the given metabolite IDs, this function creates the complementary reactions, i.e. if it previously created the Day <-> Storage Pool reaction, it now creates the Storage Pool <-> Night reaction and vice versa.

run() Model

Executes the methods of the class StoragePoolGenerator.

validate() None

Validates the model, since it has to have metabolites, reactions and a Day and Night compartments.

PhotonReactionInhibitor

class diel_models.photon_reaction_inhibitor.PhotonReactionInhibitor(model: Model, id_photon_reaction_night: List[str])

Bases: Step

restrain() None

Function that resets the photon reaction(s) limits to zero at night.

Raises:

ValueError – If the photon uptake reaction ID is not present in the given model.

run() Model

Executes the method of the class PhotonReactionInhibitor.

validate() None

Validates the model that, in addition to the above factors, it must contain metabolites and storage pool compartments.

NitrateUptakeRatioCalibrator

class diel_models.nitrate_uptake_ratio.NitrateUptakeRatioCalibrator(model: Model, id_nitrate_uptake_reaction_day: List[str], id_nitrate_uptake_reaction_night: List[str], day_ratio_value: int = 3, night_ratio_value: int = 2)

Bases: Step

ratio_set() None

This function establishes a 3:2 ratio (by default) of nitrate uptake between day and night, respectively. The ratio can be changed.

Raises:

ValueError – If the nitrate uptake reaction ID is not present in the given model.

run() Model

Executes the method of the class NitrateUptakeRatioCalibrator.

validate() None

Validates the model of the step.

BiomassAdjuster

class diel_models.biomass_adjuster.BiomassAdjuster(model: Model, id_biomass_reaction_day: str, id_biomass_reaction_night: str)

Bases: Step

run() Model

Executes the methods of the class BiomassAdjuster.

total_biomass_reaction() None

Function that joins the two biomass reactions (day and night) into one. Defines this new reaction as the objective function of the model.

Raises:

ValueError – If the biomass reaction ID is not present in the given model.

validate() None

Validates the model of the step.

Build Pipeline

Pipeline

class diel_models.pipeline.Pipeline(model: Model, steps: list)

Bases: object

run() None

It runs the validate method followed by the run method. The resulting model is then set as self.model to be used in the next step.

class diel_models.pipeline.Step

Bases: ABC

abstract run() None

Performs the step.

abstract validate() None

Validates the model of the step.