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:
objectClass 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':Selectorof typetx_cellstateaddressing the origin state.'b':Selectorof typetx_cellstateaddressing 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':Selectorof typecytokineaddressing the cytokine being linked.'states': list[Selector] of typetx_cellstateaddressing 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':Selectorof type ‘cells’'killer_states'list[Selector] of type ‘tx_cellstate’
- BioLinkdict
Dictionary describing a generic, custom linkage between two
Selectorobjects. BioLink has the following structure:'a':Selectoraddressing the origin entity.'b':Selectoraddressing 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
dictobjects 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]
- List describing the ordinary celltypes as
- 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
BioLayerlevel selector into aSysLayerlevel 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 substituteIf 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
Selectoraddressing 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
Selectorof type ‘tx_cellstate’
- get_tx_celltype(name)¶
Get a
Selectoraddressing a therapeutic celltype.- Parameters
name (str) – Name of the tx_celltype.
- Returns
Selector addressing the desired therapeutic celltype.
- Return type
Selectorof type tx_celltype
- link_compartments(a, b)¶
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.