celltx.biolayer package

Submodules

celltx.biolayer.biolayer module

Specify the architecture of a biological system at molecular, cellular, and tissue-level scales.

class celltx.biolayer.biolayer.BioLayer

Bases: object

Class which enables specification and storage of multiscale models of cell therapies in a biologically intuitive fashion.

celltx currently uses a variety of pseudo-classes which are currently implemented as ``dict``s. Their specifications are provided here.

StateLinkdict

Dictionary describing a linkage between two states of a tx_celltype (e.g. [(primed, 0)] and [(primed, 1)]. StateLink has the following structure:

  • 'a' : Selector of type tx_cellstate addressing the origin state.

  • 'b' : Selector of type tx_cellstate addressing the destination state.

  • 'func' : sympy.core.expr.Expr expression of constants and selectors describing the linkage.

CytokineLinkdict

Dictionary describing a linkage between a tx_cell and a cytokine (e.g. for secretion or sinking) CytokineLink has the following structure:

  • 'target_cytokine' : Selector of type cytokine addressing the cytokine being linked.

  • 'states' : list[Selector] of type tx_cellstate addressing the tx_cellstates being linked.

  • 'action' : str either ‘sink’ or ‘secrete’ describing the action of the linkage.

KillLinkdict

Dictionary describing a linkage between some tx_cellstates and a cell killed by those tx_cellstates. KillLink has the following structure:

  • 'target' : Selector of type ‘cells’

  • 'killer_states' list[Selector] of type ‘tx_cellstate’

BioLinkdict

Dictionary describing a generic, custom linkage between two Selector objects. BioLink has the following structure:

  • 'a' : Selector addressing the origin entity.

  • 'b' : Selector addressing the destination entity.

  • 'func' : sympy.core.expr.Expr in terms of constants and selectors.

compartments

List of unique compartment names. Linkages specified by compartment_linkages.

Type

list[str]

compartment_linkages

List of 2-tuples of strings each describing a linkage between two compartments in compartments

Type

list[tuple[str]]

tx_cells

List containing specifications of each therapeutic celltype in the model (e.g. CAR-T cells). Each dictionary contains the following keys and structure:

  • 'name' (str) unique name.

  • 'states' (list[str]) list of names of binary states (e.g. ‘primed’, ‘activated’)

  • 'state_linkages' (list[StateLink]) list describing linkages between states.

  • 'daughter_state' (list[tuple[str]]) list of 2-tuples addressing the cellstate yielded by proliferation.

  • 'cytokine_linkages' (list[CytokineLink]) list describing linkages with cytokines.

  • 'killing_linkages' (list[KillLink]) list describing what the tx cell can kill.

  • 'growth_type' (str) type of term governing proliferation of the cells (e.g., linear, logistic).

Type

list[dict]

cells
List describing the ordinary celltypes as dict objects with structure:
  • 'name' : Unique name

  • 'compartment' : Name of the compartment in which the cells reside.

  • 'growth_type': Type of term governing growth of the cells (e.g. linear, logistic).

Type

list[dict]

cytokines

List describing the cytokines in the model by unique names.

Type

list[str]

interactions

List of custom interactions to add to the model.

Type

list[SingleSelector]

add_cells(name, compartment, growth_type=None)

Add a type of non-therapeutic cell to the model (e.g. tumor or normal cells).

add_compartment(name)

Add a compartment to the model.

add_cytokine(name)

Add a type of cytokine to the model.

add_interaction(a, b, func)

Add a custom interaction to the model.

add_tx_cell_killtarget(tx_cell_name, target_cells, killer_states)
add_tx_cells(name, states, state_linkages=None, daughter_state=None, cytokine_linkages=None, killing_linkages=None, growth_type=None)
add_tx_cytokine_interaction(tx_cell_name, cytokine, states, action)
add_tx_state_linkage(tx_cell_name, a, b, func)
compose()
constant(name, value)
convert_bio_func_to_sys(sys, func, compartment_context=None)

Convert a BioLayer level selector into a SysLayer level selector.

Parameters
  • sys (SysLayer) – SysLayer that has been initialized and populated with elements that will be used to validate selectors.

  • func (sympy.core.expr.Expr) – Expr in terms of BioLayer Selectors and Constants

  • compartment_context (bool) – Override the compartment context while converting the function

Returns

  • Sympy.core.expr.Expr – The converted expression

  • Algorithm

  • ———

  • For each term in func.args

    • if it’s a constant, leave it alone

    • If it’s a selector, convert it via convert_bio_sel_to_sys() and substitute

    • If it’s an expr, recurse and substitute.

convert_bio_sel_to_sys(sys, selector, compartment_override=None)

Convert a BioLayer selector into a SysLayer compartible one

gen_states_for_tx_cell(tx_cell)
get_adjacent_compartments(compartment)
get_cells(name, compartment=None)
get_cytokine(name, compartment=None)
get_species(kind, name)
get_tx_cellstate(name, state)

Get a Selector addressing a therapeutic cellstate.

Parameters
  • name (str) – Name of the tx_celltype

  • state (list[tuple]) – List of 2-tuples addressing a unique state of the tx_celltype

Returns

Selector addressing the desired state of the desired therapeutic celltype.

Return type

Selector of type ‘tx_cellstate’

get_tx_celltype(name)

Get a Selector addressing a therapeutic celltype.

Parameters

name (str) – Name of the tx_celltype.

Returns

Selector addressing the desired therapeutic celltype.

Return type

Selector of type tx_celltype

Add a compartment linkage to the model.

set_tx_cell_daughter_state(tx_cell_name, daughter_state)
validate_selector(selector)

Validate that a selector actually addresses something in the BioLayer.

Module contents