Datatypes

This module contains storage solutions for information about cellular history and their relations.

Cellular History and Relations

Method

Description

CellContainer.get_cells()

All simulation snapshots

CellContainer.get_cells_at_iteration()

Simulation snapshot at iteration

CellContainer.get_cell_history()

History of one particular cell

CellContainer.get_all_identifiers()

Get all identifiers of all cells

CellContainer.get_all_identifiers_unsorted()

Get all identifiers (unsorted)

CellContainer.get_parent_map()

Maps a cell to its parent.

CellContainer.get_child_map()

Maps each cell to its children.

CellContainer.get_parent()

Get parent of a cell

CellContainer.get_children()

Get all children of a cell

CellContainer.cells_are_siblings()

Check if two cells have the same parent

class CellContainer(all_cells)

Bases: object

Manages all information resulting from an executed simulation

cell_identifier_to_counter(identifier)

Get the CellIdentifier associated to the given counter. Used in cr_mech_coli.imaging techniques.

cells_are_siblings(ident1, ident2)

Determines if two cells share a common parent

counter_to_cell_identifier(counter)

Obtains the cell corresponding to the given counter of this simulation Used in cr_mech_coli.imaging techniques.

Parameters:

counter (int) – Counter of some cell

Returns:

The unique identifier associated with this counter

Return type:

CellIdentifier

get_all_identifiers()

Returns all CellIdentifier used in the simulation sorted in order.

get_all_identifiers_unsorted()

Identical to CellContainer.get_all_identifiers() but returns unsorted list.

get_all_iterations()

Obtain all iterations as a sorted list.

get_cell_from_color(color)

Obtains the cell which had been assigned this color

Parameters:

color (tuple[int, int, int]) – A tuple (or list) with 3 8bit values

Returns:

The identifier of the cell

Return type:

CellIdentifier | None

get_cell_history(identifier)

Load the history of a single cell

Parameters:

identifier (CellIdentifier) – The identifier of the cell in question

Returns:

A dictionary with all timespoints and the cells confiruation at this time-point. Also returns the parent CellIdentifier if present.

Return type:

tuple[dict[int, PyObject], CellIdentifier | None]

get_cells()

Get all cells at all iterations

Returns:

A dictionary containing all cells with their identifiers, values and possible parent identifiers for every iteration.

Return type:

dict[int, dict[CellIdentifier, tuple[PyObject, CellIdentifier | None]]

get_cells_at_iteration(iteration)

Get cells at a specific iteration.

Parameters:

iteration (int) – Positive integer of simulation step iteration.

Returns:

A dictionary mapping identifiers to the cell and its possible parent.

Return type:

cells (dict)

Raises:
  • SimulationError – Generic error related to cellular_raza

  • if any of the internal methods returns an error.

get_child_map()

A dictionary mapping each cell to its children

get_children(identifier)

Obtains all children of a given cell

Parameters:

identifier (CellIdentifier) – The cells unique identifier

Returns:

All children of the given cell

Return type:

list[CellIdentifier]

get_color(identifier)

Obtains the color assigned to the cell

Parameters:

identifier (CellIdentifier) – The cells unique identifier

Returns:

The assigned color

Return type:

tuple[int, int, int] | None

get_parent(identifier)

Obtains the parent identifier of a cell if it had a parent.

Parameters:

identifier (CellIdentifier) – The cells unique identifier

Returns:

The parents identifier or None

Return type:

CellIdentifier | None

get_parent_map()

A dictionary mapping each cell to its parent

cell_to_color

Maps each cell to its color

cells

Contains snapshots of all cells at each saved step

child_map

Maps each cell to its children

color_to_cell

Maps each color back to its cell

parent_map

Maps each cell to its parent if existent

class CellIdentifier(voxel_plain_index, counter)

Bases: object

Unique identifier which is given to every cell in the simulation

The identifier is comprised of the [VoxelPlainIndex] in which the cell was first spawned. This can be due to initial setup or due to other methods such as division in a cell cycle. The second parameter is a counter which is unique for each voxel. This ensures that each cell obtains a unique identifier over the course of the simulation.

copy()

Returns an identical clone of the identifier