Skip to content

Boolean system of the mammalian cell cycle

The Boolean system of the mammalian cell cycle of Faure et al.

  • Class: MammalianCellCycleSystem
  • Import: from skcomplex.systems.biology.systems_biology import MammalianCellCycleSystem
  • Field: biology/systems_biology
  • Topics: boolean network, cell cycle, discrete map, attractors, knock-out
  • References:
    • Raman 2021
    • Faure 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 MammalianCellCycleSystem

trajectory = MammalianCellCycleSystem().prepare().simulate()

Parameters

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

Parameter Default
active ('CycD', 'Rb', 'p27', 'Cdh1')
knockouts ()
solver 'auto'
backend 'auto'

Tags

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

Tag Values
Time discrete
Space none
Laws update
Randomness deterministic
Domains boolean
Structure fixed

Class

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

class MammalianCellCycleSystem(BaseSystem):
    """The Boolean system of the mammalian cell cycle of Faure et al.

    It holds ten proteins updated synchronously.

    The rules are those printed by Raman for CycD, Rb, E2F, CycE, CycA, p27, Cdc20, Cdh1, UbcH10 (`Ubc`), and CycB. The
    growth signal CycD keeps its value. Without it the network rests in the quiescent state with Rb, p27, and Cdh1 on.
    With it the network leaves that state and runs through a cycle of period 7 in which the cyclins E, A, and B rise and
    fall in turn. A knocked-out protein stays off. The system has the values `<protein>.x`.

    Args:
        active:
            The proteins that are on at the start.

        knockouts:
            The proteins that are knocked out.

        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.

    Raises:
        ValidationError:
            A name is not one of the ten proteins.

    Examples:
        >>> from skcomplex.systems.biology.systems_biology import MammalianCellCycleSystem
        >>> [node.label for node in MammalianCellCycleSystem().prepare().system_.elements if node.x]
        ['CycD', 'Rb', 'p27', 'Cdh1']
    """

    field = 'biology/systems_biology'
    topics = ('boolean network', 'cell cycle', 'discrete map', 'attractors', 'knock-out')
    references = (RAMAN, 'Faure et al. 2006')
    until = 21
    dt = 1

    def __init__(
        self,
        active: Sequence[str] = CELL_CYCLE_START,
        *,
        knockouts: Sequence[str] = (),
        label: str = 'system',
        solver: BaseSolver | str = 'auto',
        backend: BaseBackend | str = 'auto',
    ) -> None:
        super().__init__(label, solver=solver, backend=backend)
        self.active = active
        self.knockouts = knockouts

    def _prepare(self, context: Sequence[Observable] | None = None) -> None:
        """Set the system of the Boolean system of the mammalian cell cycle.

        Args:
            context:
                The observables to compile with the problem, or `None` for none.
        """
        super()._prepare(context)
        self.system_ = ThreeGeneBooleanNetworkSystem._get_rule_network(
            self.label,
            CELL_CYCLE_RULES,
            self.active,
            self.knockouts,
        )

Components

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

Elements:

Interactions:

  • BooleanFunctionInteraction, from Interaction
class BooleanNodeElement(Element):
    """Node of a Boolean network, a gene or protein that is on or off.

    Args:
        label:
            The label of the node.

        x:
            The initial value, 0 or 1.

    Examples:
        >>> from skcomplex.systems.biology.systems_biology import BooleanNodeElement
        >>> BooleanNodeElement('Sic1', x=1).x
        1
    """

    def __init__(
        self,
        label: str,
        *,
        x: Annotated[float, FiniteEnumeratedSet([0, 1])] = 0,
    ) -> None:
        super().__init__(label)
        self.x = x

class BooleanFunctionInteraction(Interaction):
    """Synchronous update of a node by a truth table of any number of input nodes.

    A table of `2^k` entries reads the `k` inputs as the bits of a binary number, from the most significant, and gives
    the next value of the target. The update is the sum, over the patterns whose entry is 1, of the product that is 1
    exactly on that pattern.

    Args:
        label:
            The label of the interaction.

        target:
            The path of the updated node.

        inputs:
            The paths of the input nodes, in the order of the bits of the table.

        table:
            The next value of the target for each of the `2^k` input patterns.

    Raises:
        ValidationError:
            The table does not have one entry per pattern of the inputs.

    Examples:
        >>> from skcomplex.systems.biology.systems_biology import BooleanFunctionInteraction
        >>> BooleanFunctionInteraction('and', target='c', inputs=['a', 'b'], table=(0, 0, 0, 1)).table
        (0, 0, 0, 1)
    """

    law_classes = (UpdateLaw,)

    def __init__(
        self,
        label: str,
        *,
        target: Role,
        inputs: tuple[Role, ...],
        table: tuple[int, ...] = (0,),
    ) -> None:
        super().__init__(label)
        self.target = target
        self.inputs = inputs
        self.table = table

    def _get_pattern(self, inputs: Sequence[Expression], index: int) -> Expression:
        """Return the product that is 1 when the inputs spell an index.

        The inputs are read as bits from the most significant.
        """
        bits = [(index >> (len(inputs) - 1 - position)) & 1 for position in range(len(inputs))]
        return prod((value if bit else 1 - value for value, bit in zip(inputs, bits, strict=True)), start=SR(1))

    def _check_arguments(self) -> None:
        """Raise an error for an argument the interaction cannot take.

        Raises:
            ValidationError:
                The table does not have one entry per pattern of the inputs.
        """
        super()._check_arguments()
        if len(self.table) != 2 ** len(self.inputs):
            error_msg = (
                f'BooleanFunction {self.label} reads {len(self.inputs)} inputs, which take {2 ** len(self.inputs)} '
                f'patterns, but its table has {len(self.table)} entries.'
            )
            raise ValidationError(error_msg)

    def _prepare(self, context: SimpleNamespace) -> None:
        """Set the next value of the target by the truth table.

        Args:
            context:
                The namespace of the target and the inputs.
        """
        super()._prepare(context)
        inputs = [item.x for item in context.inputs]
        terms = [self._get_pattern(inputs, index) for index, entry in enumerate(self.table) if entry]
        self.laws_: list[BaseLaw] = [UpdateLaw(context.target.x, sum(terms, start=SR(0)))]

Equations

The equations are those that symbolic returns for the system with its default parameters.

CycD.x: x_CycD(t + 1) == x_CycD(t)
Rb.x: x_Rb(t + 1) == -(x_CycA(t) - 1)*(x_CycB(t) - 1)*(x_CycD(t) - 1)*(x_CycE(t) - 1)*(x_p27(t) - 1) + (x_CycA(t) - 1)*(x_CycB(t) - 1)*(x_CycD(t) - 1)*(x_CycE(t) - 1)*x_p27(t) - (x_CycB(t) - 1)*(x_CycD(t) - 1)*(x_CycE(t) - 1)*x_CycA(t)*x_p27(t) - (x_CycA(t) - 1)*(x_CycB(t) - 1)*(x_CycD(t) - 1)*x_CycE(t)*x_p27(t) + (x_CycB(t) - 1)*(x_CycD(t) - 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 1)*(x_CycE(t) - 1)*(x_p27(t) - 1) + (x_CycA(t) - 1)*(x_CycB(t) - 1)*(x_CycD(t) - 1)*(x_CycE(t) - 1)*x_p27(t) - (x_CycB(t) - 1)*(x_CycD(t) - 1)*(x_CycE(t) - 1)*x_CycA(t)*x_p27(t) - (x_CycA(t) - 1)*(x_CycB(t) - 1)*(x_CycD(t) - 1)*x_CycE(t)*x_p27(t)
Cdc20.x: x_Cdc20(t + 1) == x_CycB(t)
Cdh1.x: x_Cdh1(t + 1) == (x_Cdc20(t) - 1)*(x_CycA(t) - 1)*(x_CycB(t) - 1)*(x_p27(t) - 1) - (x_CycA(t) - 1)*(x_CycB(t) - 1)*(x_p27(t) - 1)*x_Cdc20(t) + (x_CycB(t) - 1)*(x_p27(t) - 1)*x_Cdc20(t)*x_CycA(t) + (x_CycA(t) - 1)*(x_p27(t) - 1)*x_Cdc20(t)*x_CycB(t) - (x_p27(t) - 1)*x_Cdc20(t)*x_CycA(t)*x_CycB(t) - (x_Cdc20(t) - 1)*(x_CycA(t) - 1)*(x_CycB(t) - 1)*x_p27(t) + (x_CycA(t) - 1)*(x_CycB(t) - 1)*x_Cdc20(t)*x_p27(t) + (x_Cdc20(t) - 1)*(x_CycB(t) - 1)*x_CycA(t)*x_p27(t) - (x_CycB(t) - 1)*x_Cdc20(t)*x_CycA(t)*x_p27(t) - (x_CycA(t) - 1)*x_Cdc20(t)*x_CycB(t)*x_p27(t) + x_Cdc20(t)*x_CycA(t)*x_CycB(t)*x_p27(t)
Ubc.x: x_Ubc(t + 1) == -(x_Cdc20(t) - 1)*(x_Cdh1(t) - 1)*(x_CycA(t) - 1)*(x_CycB(t) - 1)*(x_Ubc(t) - 1) + (x_Cdh1(t) - 1)*(x_CycA(t) - 1)*(x_CycB(t) - 1)*(x_Ubc(t) - 1)*x_Cdc20(t) + (x_Cdc20(t) - 1)*(x_Cdh1(t) - 1)*(x_CycB(t) - 1)*(x_Ubc(t) - 1)*x_CycA(t) - (x_Cdh1(t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