vivarium.processes.death module

Model of Conditional Cell Death

Fully-capitalized words and phrases have the meanings specified in RFC 2119.

This module holds machinery for modeling cell death that is conditioned on the state of the cell. This machinery consists of death detector classes and death process classes.

Death Detector Classes

Death detector classes encode a model (which may be configured upon instantiation) for when a cell should die. These classes can be instantiated to give death detectors, which are used by the death processes we describe below.

Death detector classes MUST subclass DetectorInterface and implement DetectorInterface.check_can_survive() as specified in its documentation.

Death Process Classes

During a simulation, death is executed by a death process, whose model is declared in a death process class. Each of these process classes SHOULD use a death detector, as detailed above, to determine when the cell should die. The mechanism by which the cell’s death is modeled depends on the form of death being modeled. For an example, see DeathFreezeState.

class vivarium.processes.death.AntibioticDetector(antibiotic_threshold=0.9, antibiotic_key='antibiotic')[source]

Bases: vivarium.processes.death.DetectorInterface

Death detector for antibiotics

Checks whether the cell can survive the current internal antibiotic concentrations.

Parameters
  • antibiotic_threshold (float) – The maximum internal antibiotic concentration the cell can survive.

  • antibiotic_key (str) – The name of the variable storing the cell’s internal antibiotic concentration.

check_can_survive(states)[source]

Checks if the current antibiotic concentration is survivable

The internal antibiotic concentration MUST be stored in a variable of a port named internal.

Returns

False if the antibiotic concentration is strictly

greater than the the threshold. True otherwise.

Return type

bool

vivarium.processes.death.DETECTOR_CLASSES = {'antibiotic': <class 'vivarium.processes.death.AntibioticDetector'>}

Map from detector class names to detector classes

class vivarium.processes.death.DeathFreezeState(initial_parameters=None)[source]

Bases: vivarium.core.process.Process

Model Death by Removing Processes

This process class models death by, with a few exceptions, freezing the internal state of the cell. We implement this by removing from this process’s compartment all processes, specified with the targets configuration.

Configuration:

  • ``detectors``: A list of the names of the detector classes to include. Death will be triggered if any one of these triggers death. Names are specified in DETECTOR_CLASSES.

  • ``targets``: A list of the names of the processes that will be removed when the cell dies. The names are specified in the compartment’s topology.

Ports:

  • ``internal``: The internal state of the cell.

  • ``global``: Should be linked to the global store.

  • ``processes``: Should be linked to the store that has the processes as children.

name = 'death'
next_update(timestep, states)[source]

If any detector triggers death, kill the cell

When we kill the cell, we convey this by setting the dead variable in the global port to 1 instead of its default 0.

ports_schema()[source]
class vivarium.processes.death.DetectorInterface[source]

Bases: object

Interface that MUST be subclassed by all death detectors

Each subclass SHOULD check for a condition that might kill the cell.

For an example of a death detector class, see AntibioticDetector.

check_can_survive(states)[source]

Check whether the current state is survivable by the cell

Each subclass MUST implement this method. The implementation SHOULD check whether the cell can survive given its current state.

Parameters

states (dict) – The states of each port in the cell, as a dictionary.

Returns

True if the cell can survive, False if it cannot.

Return type

bool

class vivarium.processes.death.ToyAntibioticInjector(initial_parameters=None)[source]

Bases: vivarium.core.process.Process

name = 'toy_antibiotic_injector'
next_update(timestep, states)[source]
ports_schema()[source]
class vivarium.processes.death.ToyDeath(config)[source]

Bases: vivarium.core.process.Generator

generate_processes(config)[source]
generate_topology(config)[source]
vivarium.processes.death.plot_death_freeze_state_test()[source]
vivarium.processes.death.test_death_freeze_state(end_time=10, asserts=True)[source]