cellsystem.logging package

Submodules

cellsystem.logging.full module

class cellsystem.logging.full.FullLog(*args, **kwargs)[source]

Bases: cellsystem.logging.core.multi.MultiLog

A log that records geometric information, mutations, ancestry and prints the actions to the screen.

Each part can be accesed with:

log[{{logname}}]

where {{logname}} can be one of: ‘geometry’, ‘mutations’, ‘ancestry’ or ‘printer’.

also, each log can be (de)activated with:

# Deactivate log
log[{{logname}}].silence()

# Rectivate log
log[{{logname}}].activate()
ancestry(prune_death=False)[source]

Fetch information of the cells’ “family tree”.

mutations(prune_death=False)[source]

Fetch information of the cells’ mutational history.

worldlines(prune_death=False)[source]

Fetch information of the cells’ evolution in space and time.

cellsystem.logging.geometric module

Geometric Logging

This module defines functionality for following the geometric evolution of the cell blob through time.

The classes GeometricLog and WorldLines are defined here.

class cellsystem.logging.geometric.GeometricLog(*args, **kwargs)[source]

Bases: cellsystem.logging.core.weak.WeakLog

Registers the geometric positions of the cells.

iter_changes()[source]

Iterate through every action

iter_states()[source]

Generate the intermediate states.

log_death(cell)[source]

Register the disappeareance of the cell.

log_division(daughters)[source]
log_migration(cell)[source]
log_newcell(cell)[source]
preparefor_division(cell)[source]
worldlines(prune_death=False)[source]

Get the geometric evolution of individual cells in space and time.

class cellsystem.logging.geometric.WorldLines(initial_state=None, time=0)[source]

Bases: object

A class that represents the worldlines of a set of cells.

A worldline is the place in time and space that a cell occupies throughout it’s existence.

add_event(cell, event)[source]

Add an event (a spacetime coordinate) for the cell.

classmethod from_log(geometric_log, prune_death=False)[source]

Initialize from a geometric log.

last_state_of(cell)[source]

Return the last recorded event of the given cell.

remove(cell)[source]

Remove the given cell’s timeline.

show(div_marker='o', end_marker='', savefig=None)[source]

Render the 3D worldlines as a plot.

update(state, transition, time, prune_death=False)[source]

Add the event described by the transition, time and final state.

cellsystem.logging.simple module

cellsystem.logging.treelogs module

class cellsystem.logging.treelogs.AncestryLog(*args, **kwargs)[source]

Bases: cellsystem.logging.treelogs.TreeLog

A tree log that maintains a “family tree”.

Each leaf represents a cell. When that cell divides, the leaf branches into leaves representing the daughters.

add_child(*args, **kwargs)[source]
log_division(daughters)[source]

Add 2 new branches to the father of the cells.

log_newcell(cell)[source]
class cellsystem.logging.treelogs.MutationsLog(*args, **kwargs)[source]

Bases: cellsystem.logging.treelogs.TreeLog

A tree log that maintains a record of genome branching events.

Each leaf represents a genome that may be present in one or more cells. When one of those cells mutates, the new genome is added as a child of that leaf.

log_division(daughters)[source]

Remove the father from the alive cells.

log_mutation(cell)[source]

Add a new child to the parent genome.

log_newcell(cell)[source]
class cellsystem.logging.treelogs.TreeLog(*args, **kwargs)[source]

Bases: cellsystem.logging.core.weak.WeakLog

Base class for logs that grow trees.

add_child(parent=None, name=None)[source]
alive_nodes
fetch_tree(prune_death=False)[source]

Fetch a copy of the tree.

If prune_death is True, remove the leaves that correspond to death cells.

log_death(cell)[source]
preparefor_division(cell)[source]

Module contents

Logging classes.

Classes related to the recording of the simulation progress, analysis and history.

class cellsystem.logging.FullLog(*args, **kwargs)[source]

Bases: cellsystem.logging.core.multi.MultiLog

A log that records geometric information, mutations, ancestry and prints the actions to the screen.

Each part can be accesed with:

log[{{logname}}]

where {{logname}} can be one of: ‘geometry’, ‘mutations’, ‘ancestry’ or ‘printer’.

also, each log can be (de)activated with:

# Deactivate log
log[{{logname}}].silence()

# Rectivate log
log[{{logname}}].activate()
ancestry(prune_death=False)[source]

Fetch information of the cells’ “family tree”.

mutations(prune_death=False)[source]

Fetch information of the cells’ mutational history.

worldlines(prune_death=False)[source]

Fetch information of the cells’ evolution in space and time.

class cellsystem.logging.PrinterLog(*args, **kwargs)[source]

Bases: cellsystem.logging.core.log.Log

Simple logger that limits to print the action.

log_death(cell)[source]
log_division(daughters)[source]
log_migration(cell)[source]
log_mutation(cell)[source]
log_newcell(cell)[source]
preparefor_death(cell)[source]
preparefor_division(cell)[source]
preparefor_migration(cell)[source]
preparefor_mutation(cell)[source]
class cellsystem.logging.MutationsLog(*args, **kwargs)[source]

Bases: cellsystem.logging.treelogs.TreeLog

A tree log that maintains a record of genome branching events.

Each leaf represents a genome that may be present in one or more cells. When one of those cells mutates, the new genome is added as a child of that leaf.

log_division(daughters)[source]

Remove the father from the alive cells.

log_mutation(cell)[source]

Add a new child to the parent genome.

log_newcell(cell)[source]
class cellsystem.logging.AncestryLog(*args, **kwargs)[source]

Bases: cellsystem.logging.treelogs.TreeLog

A tree log that maintains a “family tree”.

Each leaf represents a cell. When that cell divides, the leaf branches into leaves representing the daughters.

add_child(*args, **kwargs)[source]
log_division(daughters)[source]

Add 2 new branches to the father of the cells.

log_newcell(cell)[source]
class cellsystem.logging.GeometricLog(*args, **kwargs)[source]

Bases: cellsystem.logging.core.weak.WeakLog

Registers the geometric positions of the cells.

iter_changes()[source]

Iterate through every action

iter_states()[source]

Generate the intermediate states.

log_death(cell)[source]

Register the disappeareance of the cell.

log_division(daughters)[source]
log_migration(cell)[source]
log_newcell(cell)[source]
preparefor_division(cell)[source]
worldlines(prune_death=False)[source]

Get the geometric evolution of individual cells in space and time.

cellsystem.logging.logged(action_name, prepare=True)[source]

Decorate an action with logging.

Allows to specify if a prelogging action is called.