Skip to content

Carbon-13 metabolic flux analysis

A metabolic network that labelling fits to labelling data.

  • Class: Carbon13MFASystem
  • Import: from skcomplex.systems.biology.systems_biology import Carbon13MFASystem
  • Field: biology/systems_biology
  • Topics: carbon-13 flux analysis, isotope labelling, elementary metabolite units, metabolism, static
  • References:
    • Raman 2021
    • Antoniewicz et al. 2007
    • Antoniewicz et al. 2006

Use this system

The block imports the class and simulates the system with its default parameters and its tuned run settings.

from skcomplex.systems.biology.systems_biology import Carbon13MFASystem

trajectory = Carbon13MFASystem().prepare().simulate()

Parameters

The model parameters take these defaults, and set_params changes them.

Parameter Default
network None
solver 'auto'
backend 'auto'

Tags

The system with its default parameters has these capability tags, which solvers and analyses check.

Tag Values
Time continuous, discrete, static
Space none
Laws equation
Randomness unknown
Domains real
Structure fixed

Class

The source of the class shows how it builds its components from its model parameters.

class Carbon13MFASystem(BaseSystem):
    """A metabolic network that `labelling` fits to labelling data.

    The network is the TCA example by default.

    Labelled atoms of a tracer spread through the network along its atom transitions, so the measured mass isotopomer
    distributions of its products carry the fluxes (Raman 2021, Section 9.7). `tca_labelling_analysis` gives the
    labelling of the TCA example of Antoniewicz et al. (2007) with data simulated from its known fluxes.

    Args:
        network:
            The flux balance of the metabolic network, or `None` for the TCA example.

        label:
            The label of the system, which names it when it is nested in another one.

        solver:
            The solver of the problem, or `'auto'` for the one the system chooses.

        backend:
            The backend that evaluates the compiled functions, or `'auto'` for the one the system chooses.

    Examples:
        >>> from skcomplex.systems.biology.systems_biology import Carbon13MFASystem
        >>> Carbon13MFASystem().prepare().system_.elements[0].label
        'tca'
    """

    field = 'biology/systems_biology'
    topics = ('carbon-13 flux analysis', 'isotope labelling', 'elementary metabolite units', 'metabolism', 'static')
    references = ('Raman 2021', 'Antoniewicz et al. 2007', 'Antoniewicz et al. 2006')
    until = 0.0

    def __init__(
        self,
        network: FluxBalanceInteraction | None = None,
        *,
        label: str = 'system',
        solver: BaseSolver | str = 'auto',
        backend: BaseBackend | str = 'auto',
    ) -> None:
        super().__init__(label, solver=solver, backend=backend)
        self.network = network

    def _prepare(self, context: Sequence[Observable] | None = None) -> None:
        """Set the system of a metabolic network that `labelling` fits to labelling data.

        Args:
            context:
                The observables to compile with the problem, or `None` for none.
        """
        super()._prepare(context)
        network = TcaFluxBalanceInteraction('fba') if self.network is None else self.network
        cell = MetabolicCellElement(network.cell, values=network.get_values())
        self.system_ = System(self.label, elements=[cell], interactions=[network])

Components

The system uses these element and interaction classes, each with its nearest class of the core.

Elements:

  • MetabolicCellElement, from Element

Interactions:

  • TcaFluxBalanceInteraction, from Interaction
class MetabolicCellElement(Element):
    """Cell whose values hold the fluxes, the bounds, and the gene switches of a metabolic network.

    It is drawn as the linear program of its network, and `FluxBalanceInteraction.get_values` gives its values.

    Examples:
        >>> from skcomplex.systems.biology.common.metabolism import FluxBalanceInteraction, MetabolicCellElement
        >>> from skcomplex.systems.biology.common.metabolism import ReactionSpec
        >>> network = FluxBalanceInteraction('fba', reactions={'r': ReactionSpec({'A': -1.0})})
        >>> MetabolicCellElement('cell', values=network.get_values()).values['upper_r']
        1000.0
    """

    visual = VisualSpec('linear_program')

class TcaFluxBalanceInteraction(FluxBalanceInteraction):
    """Flux balance of the TCA example of Antoniewicz et al. (2007).

    Args:
        label:
            The label of the interaction.

        cell:
            The path of the cell whose values hold the fluxes and the bounds.

        reactions:
            The reactions by name.

        objective:
            The coefficient of every reaction in the objective, or nothing for any fluxes the balances allow.

        parsimonious:
            Whether to minimise the total absolute flux after the objective.

        infeasible:
            What a run does when the balances and bounds cannot all hold.

        name:
            The name of the network.

    Examples:
        >>> from skcomplex.systems.biology.systems_biology import TcaFluxBalanceInteraction
        >>> TcaFluxBalanceInteraction('fba').get_values()['upper_v1']
        300.0
    """

    def __init__(
        self,
        label: str = 'fba',
        *,
        cell: Role = 'tca',
        reactions: Mapping[str, ReactionSpec] = TCA_REACTIONS,
        objective: Mapping[str, float] = TCA_OBJECTIVE,
        parsimonious: bool = False,
        infeasible: str = 'raise',
        name: str | None = 'TcaNetwork',
    ) -> None:
        super().__init__(
            label,
            cell=cell,
            reactions=reactions,
            objective=objective,
            parsimonious=parsimonious,
            infeasible=infeasible,
            name=name,
        )