Skip to content

Bristle patterning by lateral inhibition on a ring

A ring of cells that inhibit the neural fate of their neighbours.

  • Class: BristleLateralInhibitionSystem
  • Import: from skcomplex.systems.biology.systems_biology import BristleLateralInhibitionSystem
  • Field: biology/systems_biology
  • Topics: lateral inhibition, pattern formation, bristles, notch-delta, ode
  • References:
    • Corson et al. 2017
    • Rand et al. 2021

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 BristleLateralInhibitionSystem

trajectory = BristleLateralInhibitionSystem().prepare().simulate()

Parameters

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

Parameter Default
cells 40
strength 1.0
length 2.5
width 0.127
noise 0.05
seed 0
solver 'auto'
backend 'auto'

Tags

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

Tag Values
Time continuous
Space none
Laws rate
Randomness deterministic
Domains real
Structure fixed

Class

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

class BristleLateralInhibitionSystem(BaseSystem):
    """A ring of cells that inhibit the neural fate of their neighbours.

    The inhibition leaves sparse, evenly spaced bristles.

    Following Eq. (2) of Rand et al. (2021), every cell relaxes to `sigma(a_i - h_i)` under the inhibition `h_i = sum_j
    K_ij d(a_j)`, with the Gaussian kernel `K_ij = strength exp(-d_ij^2 / (2 length^2))` of the distance `d_ij` along
    the ring. All cells start near the epidermal state and rise together, until small differences break the symmetry at
    a saddle on the diagonal: the leading cells turn neural and silence their neighbours, so the neural cells end
    several cell diameters apart. The system has the neural states `cells.a`.

    Args:
        cells:
            The number of cells on the ring.

        strength:
            The inhibition between neighbouring cells at zero distance.

        length:
            The range of the inhibition, in cell diameters.

        width:
            The width of the sigmoids.

        noise:
            The largest initial neural state, drawn uniformly from zero.

        seed:
            The seed of the initial states.

        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 BristleLateralInhibitionSystem
        >>> BristleLateralInhibitionSystem(10).prepare().system_.elements[0].size
        10
    """

    field = 'biology/systems_biology'
    topics = ('lateral inhibition', 'pattern formation', 'bristles', 'notch-delta', 'ode')
    references = ('Corson et al. 2017', 'Rand et al. 2021')
    until = 60.0
    dt = 0.5

    def __init__(
        self,
        cells: int = 40,
        *,
        strength: float = 1.0,
        length: float = 2.5,
        width: float = 0.127,
        noise: float = 0.05,
        seed: int | None = 0,
        label: str = 'system',
        solver: BaseSolver | str = 'auto',
        backend: BaseBackend | str = 'auto',
    ) -> None:
        super().__init__(label, solver=solver, backend=backend)
        self.cells = cells
        self.strength = strength
        self.length = length
        self.width = width
        self.noise = noise
        self.seed = seed

    def _prepare(self, context: Sequence[Observable] | None = None) -> None:
        """Set the system of a ring of cells that inhibit the neural fate of neighbours.

        Args:
            context:
                The observables to compile with the problem, or `None` for none.
        """
        super()._prepare(context)
        index = np.arange(self.cells)
        distance = np.abs(index[:, None] - index[None, :])
        distance = np.minimum(distance, self.cells - distance)
        kernel = self.strength * np.exp(-(distance**2) / (2 * self.length**2))
        np.fill_diagonal(kernel, 0.0)
        states = np.random.default_rng(self.seed).uniform(0, self.noise, self.cells)
        group = ProneuralCellElement('cells', a=states, width=self.width, size=self.cells)
        inhibition = LateralInhibitionInteraction(
            'inhibition',
            cells='cells',
            kernel=tuple(map(tuple, kernel.tolist())),
        )
        self.system_ = System(self.label, elements=[group], interactions=[inhibition])

Components

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

Elements:

  • ProneuralCellElement, from Element

Interactions:

  • LateralInhibitionInteraction, from Interaction
class ProneuralCellElement(Element):
    """Cell of an epithelium that may adopt the neural fate.

    It adopts the neural fate when the inhibition from its neighbours is weak.

    The state `a` runs from 0, the epidermal fate, to 1, the neural fate of a sensory bristle. The sigmoids of the
    lateral inhibition share the width `width`.

    Args:
        label:
            The label of the cell or of the group of cells.

        a:
            The initial neural state.

        width:
            The width of the sigmoids.

        size:
            The number of members, or `None` for one.

    Examples:
        >>> from skcomplex.systems.biology.systems_biology import ProneuralCellElement
        >>> ProneuralCellElement('cell', a=0.1).a
        0.1
    """

    def __init__(
        self,
        label: str,
        *,
        a: Annotated[float | Array, RealSet.closed(0, 1)] = 0.0,
        width: Annotated[float | Array, RealSet.open(0, oo)] = 0.127,
        size: int | None = None,
    ) -> None:
        super().__init__(label, size=size)
        self.a = a
        self.width = width

class LateralInhibitionInteraction(Interaction):
    """Lateral inhibition of the neural fate of cells by their neighbours.

    It acts through a kernel of the distance.

    Following Eq. (2) of Rand et al. (2021), `da_i/dt = sigma(a_i - h_i) - a_i` with the inhibition `h_i = sum_{j != i}
    K_ij d(a_j)`, where `sigma(u) = 1 / (1 + exp(-u / width))` and `d(a) = sigma(a - 1 / 2)`. A cell under an
    inhibition below 0.37 can only turn neural, above 0.63 only epidermal, and in between it is bistable.

    Args:
        label:
            The label of the interaction.

        cells:
            The path of the group of cells.

        kernel:
            The inhibition `K_ij` of every cell by every other, with a zero diagonal.

    Examples:
        >>> from skcomplex.systems.biology.systems_biology import LateralInhibitionInteraction
        >>> LateralInhibitionInteraction('inhibition', cells='cells', kernel=((0.0, 1.0), (1.0, 0.0))).kernel
        ((0.0, 1.0), (1.0, 0.0))
    """

    law_classes = (RateLaw,)

    def __init__(
        self,
        label: str,
        *,
        cells: Role,
        kernel: Sequence[Sequence[float]] = ((0.0,),),
    ) -> None:
        super().__init__(label)
        self.cells = cells
        self.kernel = kernel

    def _prepare(self, context: SimpleNamespace) -> None:
        """Set the relaxation of every cell towards the fate its inhibition allows.

        Args:
            context:
                The namespace of the symbols the laws can use.
        """
        super()._prepare(context)
        s = context
        cell = s.cells
        inhibition = total(self._get_sigmoid(cell.a - 1 / 2, cell.width), weights=np.asarray(self.kernel, dtype=float))
        self.laws_: list[BaseLaw] = [RateLaw(cell.a, self._get_sigmoid(cell.a - inhibition, cell.width) - cell.a)]

    def _get_sigmoid(self, u: Expression, width: Expression) -> Expression:
        """Return the logistic sigmoid `1 / (1 + exp(-u / width))`."""
        return 1 / (1 + exp(-u / width))

Equations

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

cells.a[i]: diff(a_cells(t), t) == 1/(e^((_reduced_0 - a_cells(t))/width_cells) + 1) - a_cells(t)