cellsium.model package

Cell model package.

class cellsium.model.AutoMesh3D

Bases: Shape3D

Mixin adding automatic solid-of-revolution generation.

points3d_on_canvas(steps: int = 16, simplify: bool = False) Tuple[ndarray, ndarray]
raw_points3d(steps: int = 16, simplify: bool = False) Tuple[ndarray, ndarray]
class cellsium.model.BentRod

Bases: RodShaped

Bent rod shaped cell geometry.

bend(points: ndarray) ndarray
static defaults() Dict[str, Union[Callable[[], Any], float]]
get_approximation_circles() Iterator[Tuple[float, Tuple[float, float]]]
raw_points(simplify: bool = False) ndarray
raw_points3d(steps: int = 16, simplify: bool = False) Tuple[ndarray, ndarray]
class cellsium.model.CellGeometry

Bases: WithAngle, WithPosition, AutoMesh3D

Cell geometry base by combining multiple mixins.

points_on_canvas() ndarray
class cellsium.model.Coccoid

Bases: Shape

Coccoid (spherical) cell geometry.

static defaults() Dict[str, Union[Callable[[], Any], float]]
get_approximation_circles() Iterator[Tuple[float, Tuple[float, float]]]
raw_points(simplify: bool = False) ndarray
class cellsium.model.Copyable

Bases: object

Mixin for copyable objects.

copy() Copyable
class cellsium.model.Ellipsoid

Bases: Coccoid

Ellipsoid cell geometry.

static defaults() Dict[str, Union[Callable[[], Any], float]]
raw_points(simplify: bool = False) ndarray
class cellsium.model.IdCounter

Bases: object

Id provider singleton class.

id_counter: int = 0
classmethod next_cell_id() int
classmethod reset() None
class cellsium.model.InitializeWithParameters(**kwargs)

Bases: object

Mixin for objects with defaults.

class cellsium.model.PlacedCell(**kwargs)

Bases: WithLineageHistory, WithLineage, WithTemporalLineage, WithProperDivisionBehavior, InitializeWithParameters, Copyable, Representable, WithRandomSequences, RandomWidthLength, RandomBentRod, RandomPosition, RandomAngle, CellGeometry, BentRod

class cellsium.model.Rectangle

Bases: Shape

Rectangular cell geometry.

static defaults() Dict[str, Union[Callable[[], Any], float]]
get_approximation_circles() Iterator[Tuple[float, Tuple[float, float]]]
raw_points(simplify: bool = False) Dict[str, Union[Callable[[], Any], float]]
class cellsium.model.Representable

Bases: object

Mixins for adding a repr implementation.

class cellsium.model.RodShaped

Bases: Shape

Rod shaped cell geometry.

static defaults() Dict[str, Union[Callable[[], Any], float]]
get_approximation_circles() Iterator[Tuple[float, Tuple[float, float]]]
raw_points(simplify: bool = False) ndarray
rod_raw_points(simplify: bool = False) Tuple[ndarray, ndarray, ndarray, ndarray]
class cellsium.model.Shape

Bases: object

Base class for implementing cell shapes.

static defaults() Dict[str, Union[Callable[[], Any], float]]
get_approximation_circles() Iterator[Tuple[float, Tuple[float, float]]]
raw_points(simplify: bool = False) ndarray
class cellsium.model.Shape3D

Bases: Shape

Base class for implementing 3D cell shapes.

raw_points3d(steps: int = 32, simplify: bool = False) ndarray
class cellsium.model.SimulatedCell

Bases: object

Base class for simulated cells, allowing for division behavior.

birth(parent: Optional[SimulatedCell] = None, ts: Optional[Timestep] = None) None

Called when a cell is “born”.

Parameters:
  • parent – Parent cell

  • ts – Timestep

Returns:

None

divide(ts: Timestep) Iterable[SimulatedCell]

Called when a cell should divide, creates the daughter cells.

Parameters:

ts – Timestep

Returns:

None

grow(ts: Timestep) None

Called each timestep to grow cell.

Parameters:

ts – Timestep

Returns:

None

step(ts: Timestep) None

Timestep function of the cell object, called by the simulator.

Parameters:

ts – Timestep

Returns:

None

class cellsium.model.SizerCell

Bases: SimulatedCell

Example cell implementing a simple sizer growth mechanism.

birth(parent: Optional[SizerCell] = None, ts: Optional[Timestep] = None) None

Called when a cell is “born”.

Parameters:
  • parent – Parent cell

  • ts – Timestep

Returns:

None

grow(ts: Timestep) None

Called each timestep to grow cell.

Parameters:

ts – Timestep

Returns:

None

static random_sequences(sequence: Any) Mapping[str, Any]
class cellsium.model.Square

Bases: Rectangle

Square cell geometry.

raw_points(simplify: bool = False) ndarray
class cellsium.model.TimerCell

Bases: SimulatedCell

Example cell implementing a simple timer growth mechanism.

birth(parent: Optional[TimerCell] = None, ts: Optional[Timestep] = None) None

Called when a cell is “born”.

Parameters:
  • parent – Parent cell

  • ts – Timestep

Returns:

None

grow(ts: Timestep) None

Called each timestep to grow cell.

Parameters:

ts – Timestep

Returns:

None

static random_sequences(sequence: Any) Mapping[str, Any]
class cellsium.model.Timestep(timestep: float, simulation: Simulation, simulator: Simulator)

Bases: object

Timestep is an auxiliary class combining a certain timepoint, simulation and simulator.

property hours: float

The hours passed within this timestep.

Returns:

Hours

simulation
simulator
property time: float

Total simulation time passed in seconds.

Returns:

Seconds

property time_hours: float

Total simulation time passed in hours.

Returns:

Hours

timestep
property world: World
class cellsium.model.WithAngle

Bases: object

Mixin adding a cell angle.

static defaults() Dict[str, Union[Callable[[], Any], float]]
class cellsium.model.WithFluorescence

Bases: object

Mixin adding a fluorescence value.

static defaults() Dict[str, Union[Callable[[], Any], float]]
class cellsium.model.WithLineage

Bases: object

Mixin providing lineage tracking.

copy() WithLineage
static defaults() Dict[str, Union[Callable[[], Any], float]]
next_cell_id() None
class cellsium.model.WithLineageHistory

Bases: object

Mixin providing lineage history.

static defaults() Dict[str, Union[Callable[[], Any], float]]
class cellsium.model.WithPosition

Bases: object

Mixin adding a cell position.

static defaults() Dict[str, Union[Callable[[], Any], float]]
class cellsium.model.WithProperDivisionBehavior

Bases: object

Mixin adding division angle calculation.

get_division_positions(count: int = 2) List[List[float]]
class cellsium.model.WithRandomSequences

Bases: object

Mixin for objects with random sequences.

all_random_sequences_generated_for = {}
classmethod get_random_sequences(sequence: Optional[Any] = None) Any
property random: Any
class cellsium.model.WithTemporalLineage

Bases: object

Mixing providing temporal lineage history.

static defaults() Dict[str, Union[Callable[[], Any], float]]
cellsium.model.assemble_cell(simulated_model: type, *additional_classes, placed_cell: type = <class 'cellsium.model.PlacedCell'>, name: str = 'Cell')

Assembles a cell class from parent classes. Necessary as the cell class needs the right level of inheritance.

Parameters:
  • simulated_model – Model class

  • additional_classes – Classes to create a cell type, or

  • placed_cell – A prepared cell

  • name – Optional name

Returns:

Cell class

cellsium.model.generate_cell(*additional_classes: type, name: str = 'PlacedCell')

Generates a cell class using the standard classes, and possible additional classes.

Parameters:
  • additional_classes – Additional classes to inherit the cell from.

  • name – Name of the class

Returns:

Class

cellsium.model.h_to_s(hours: Union[float, ndarray]) Union[float, ndarray]

Convert hours to seconds.

Parameters:

hours – Hours

Returns:

Seconds

cellsium.model.s_to_h(seconds: Union[float, ndarray]) Union[float, ndarray]

Convert seconds to hours.

Parameters:

seconds – Seconds

Returns:

Hours

cellsium.model.initialization module

Cell parameter random initializations.

class cellsium.model.initialization.RandomAngle

Bases: object

Random initializations for cell angles.

static random_sequences(sequence: RRF) Dict[str, Any]
class cellsium.model.initialization.RandomBentRod

Bases: object

Random initializations for cell bent radii.

static random_sequences(sequence: RRF) Dict[str, Any]
class cellsium.model.initialization.RandomFluorescence

Bases: object

Random initializations for fluorescences.

static random_sequences(sequence: RRF) Dict[str, Any]
class cellsium.model.initialization.RandomPosition

Bases: object

Random initializations for cell positions.

static random_sequences(sequence: RRF) Dict[str, Any]
class cellsium.model.initialization.RandomWidthLength

Bases: object

Random initializations for cell width/lengths.

static random_sequences(sequence: RRF) Dict[str, Any]

cellsium.model.agent module

Cell model classes and routines, general.

class cellsium.model.agent.Copyable

Bases: object

Mixin for copyable objects.

copy() Copyable
class cellsium.model.agent.IdCounter

Bases: object

Id provider singleton class.

id_counter: int = 0
classmethod next_cell_id() int
classmethod reset() None
class cellsium.model.agent.InitializeWithParameters(**kwargs)

Bases: object

Mixin for objects with defaults.

class cellsium.model.agent.Representable

Bases: object

Mixins for adding a repr implementation.

class cellsium.model.agent.WithLineage

Bases: object

Mixin providing lineage tracking.

copy() WithLineage
static defaults() Dict[str, Union[Callable[[], Any], float]]
next_cell_id() None
class cellsium.model.agent.WithLineageHistory

Bases: object

Mixin providing lineage history.

static defaults() Dict[str, Union[Callable[[], Any], float]]
class cellsium.model.agent.WithRandomSequences

Bases: object

Mixin for objects with random sequences.

all_random_sequences_generated_for = {}
classmethod get_random_sequences(sequence: Optional[Any] = None) Any
property random: Any
class cellsium.model.agent.WithTemporalLineage

Bases: object

Mixing providing temporal lineage history.

static defaults() Dict[str, Union[Callable[[], Any], float]]

cellsium.model.geometry module

Cell geometry model classes and routines.

class cellsium.model.geometry.AutoMesh3D

Bases: Shape3D

Mixin adding automatic solid-of-revolution generation.

points3d_on_canvas(steps: int = 16, simplify: bool = False) Tuple[ndarray, ndarray]
raw_points3d(steps: int = 16, simplify: bool = False) Tuple[ndarray, ndarray]
class cellsium.model.geometry.BentRod

Bases: RodShaped

Bent rod shaped cell geometry.

bend(points: ndarray) ndarray
static defaults() Dict[str, Union[Callable[[], Any], float]]
get_approximation_circles() Iterator[Tuple[float, Tuple[float, float]]]
raw_points(simplify: bool = False) ndarray
raw_points3d(steps: int = 16, simplify: bool = False) Tuple[ndarray, ndarray]
class cellsium.model.geometry.CellGeometry

Bases: WithAngle, WithPosition, AutoMesh3D

Cell geometry base by combining multiple mixins.

points_on_canvas() ndarray
class cellsium.model.geometry.Coccoid

Bases: Shape

Coccoid (spherical) cell geometry.

static defaults() Dict[str, Union[Callable[[], Any], float]]
get_approximation_circles() Iterator[Tuple[float, Tuple[float, float]]]
raw_points(simplify: bool = False) ndarray
class cellsium.model.geometry.Ellipsoid

Bases: Coccoid

Ellipsoid cell geometry.

static defaults() Dict[str, Union[Callable[[], Any], float]]
raw_points(simplify: bool = False) ndarray
class cellsium.model.geometry.Rectangle

Bases: Shape

Rectangular cell geometry.

static defaults() Dict[str, Union[Callable[[], Any], float]]
get_approximation_circles() Iterator[Tuple[float, Tuple[float, float]]]
raw_points(simplify: bool = False) Dict[str, Union[Callable[[], Any], float]]
class cellsium.model.geometry.RodShaped

Bases: Shape

Rod shaped cell geometry.

static defaults() Dict[str, Union[Callable[[], Any], float]]
get_approximation_circles() Iterator[Tuple[float, Tuple[float, float]]]
raw_points(simplify: bool = False) ndarray
rod_raw_points(simplify: bool = False) Tuple[ndarray, ndarray, ndarray, ndarray]
class cellsium.model.geometry.Shape

Bases: object

Base class for implementing cell shapes.

static defaults() Dict[str, Union[Callable[[], Any], float]]
get_approximation_circles() Iterator[Tuple[float, Tuple[float, float]]]
raw_points(simplify: bool = False) ndarray
class cellsium.model.geometry.Shape3D

Bases: Shape

Base class for implementing 3D cell shapes.

raw_points3d(steps: int = 32, simplify: bool = False) ndarray
class cellsium.model.geometry.Square

Bases: Rectangle

Square cell geometry.

raw_points(simplify: bool = False) ndarray
class cellsium.model.geometry.WithAngle

Bases: object

Mixin adding a cell angle.

static defaults() Dict[str, Union[Callable[[], Any], float]]
class cellsium.model.geometry.WithFluorescence

Bases: object

Mixin adding a fluorescence value.

static defaults() Dict[str, Union[Callable[[], Any], float]]
class cellsium.model.geometry.WithPosition

Bases: object

Mixin adding a cell position.

static defaults() Dict[str, Union[Callable[[], Any], float]]
class cellsium.model.geometry.WithProperDivisionBehavior

Bases: object

Mixin adding division angle calculation.

get_division_positions(count: int = 2) List[List[float]]