From 29d2fe61cfa93e9d3e09455d39cda88d2d566c3b Mon Sep 17 00:00:00 2001 From: Eran Date: Sun, 29 Oct 2023 12:48:34 -0400 Subject: [PATCH] final touches to cell agent diagram --- jupyter_notebooks/diagrams.ipynb | 1681 +++++++++++++-------------- tumor_tcell/processes/lymph_node.py | 11 +- 2 files changed, 830 insertions(+), 862 deletions(-) diff --git a/jupyter_notebooks/diagrams.ipynb b/jupyter_notebooks/diagrams.ipynb index 2c4e407..c322f2e 100644 --- a/jupyter_notebooks/diagrams.ipynb +++ b/jupyter_notebooks/diagrams.ipynb @@ -10,7 +10,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 32, "id": "7538b3a8-e11c-4771-87ab-d83b077b70ed", "metadata": {}, "outputs": [], @@ -42,7 +42,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 33, "id": "e87c3aa6-acb0-452c-8256-268eb583400a", "metadata": {}, "outputs": [ @@ -74,10 +74,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 25, + "execution_count": 33, "metadata": {}, "output_type": "execute_result" } @@ -93,7 +93,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 34, "id": "6712dec8-7a5f-4c4d-b9db-763bf401e57c", "metadata": {}, "outputs": [ @@ -137,10 +137,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 26, + "execution_count": 34, "metadata": {}, "output_type": "execute_result" } @@ -160,7 +160,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 35, "id": "731e6c49-cd43-4246-a4e5-f8267fbfefdf", "metadata": {}, "outputs": [ @@ -262,10 +262,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 27, + "execution_count": 35, "metadata": {}, "output_type": "execute_result" } @@ -296,7 +296,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 36, "id": "b2f091b4-82df-4dc5-936c-bfddbf807a50", "metadata": {}, "outputs": [ @@ -468,10 +468,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 28, + "execution_count": 36, "metadata": {}, "output_type": "execute_result" } @@ -503,7 +503,7 @@ }, { "cell_type": "code", - "execution_count": 66, + "execution_count": 37, "id": "8166389b-a006-490a-8e84-9e67e49591ed", "metadata": {}, "outputs": [ @@ -511,7 +511,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Initializing experiment tumor_tcell_20231026.222910\n" + "Initializing experiment tumor_tcell_20231029.114658\n" ] }, { @@ -569,7 +569,7 @@ }, { "cell_type": "code", - "execution_count": 67, + "execution_count": 38, "id": "589648aa-b5b8-497c-b937-366c87dae3de", "metadata": {}, "outputs": [], @@ -599,7 +599,7 @@ }, { "cell_type": "code", - "execution_count": 68, + "execution_count": 39, "id": "10df1f44-fd56-46b9-8806-a959c071978f", "metadata": {}, "outputs": [ @@ -1313,10 +1313,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 68, + "execution_count": 39, "metadata": {}, "output_type": "execute_result" } @@ -1354,7 +1354,7 @@ }, { "cell_type": "code", - "execution_count": 69, + "execution_count": 40, "id": "122b14d5-bed9-4502-94bd-1ad27ac0e16b", "metadata": {}, "outputs": [ @@ -1367,224 +1367,224 @@ "\n", "\n", - "\n", - "\n", + "\n", + "\n", "bigraph\n", - "\n", + "\n", "\n", "\n", "('in_transit',)\n", - "\n", - "in_transit\n", + "\n", + "in_transit\n", "\n", "\n", "\n", "('lymph_node',)\n", - "\n", - "lymph_node\n", + "\n", + "lymph_node\n", "\n", "\n", "\n", - "\n", + "\n", "('lymph_node_transfer',)\n", - "\n", - "lymph_node_transfer\n", + "\n", + "lymph_node_transfer\n", "\n", "\n", - "\n", + "\n", "('in_transit',)->('lymph_node_transfer',)\n", - "\n", - "\n", - "in_transit\n", + "\n", + "\n", + "in_transit\n", "\n", "\n", - "\n", + "\n", "('lymph_node',)->('lymph_node_transfer',)\n", - "\n", - "\n", - "lymph_node\n", + "\n", + "\n", + "lymph_node\n", "\n", "\n", "\n", "\n", "('tumor_environment',)\n", - "\n", - "tumor_environment\n", + "\n", + "tumor_environment\n", "\n", "\n", "\n", "\n", "('tumor_environment', 'agents')\n", - "\n", - "agents\n", + "\n", + "agents\n", "\n", "\n", - "\n", + "\n", "('tumor_environment',)->('tumor_environment', 'agents')\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'dimensions')\n", - "\n", - "dimensions\n", + "\n", + "dimensions\n", "\n", "\n", - "\n", + "\n", "('tumor_environment',)->('tumor_environment', 'dimensions')\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'fields')\n", - "\n", - "fields\n", + "\n", + "fields\n", "\n", "\n", - "\n", + "\n", "('tumor_environment',)->('tumor_environment', 'fields')\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'neighbors_multibody')\n", - "\n", - "neighbors_multibody\n", + "\n", + "neighbors_multibody\n", "\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'diffusion_field')\n", - "\n", - "diffusion_field\n", + "\n", + "diffusion_field\n", "\n", "\n", "\n", - "\n", + "\n", "('tumor_environment',)->('lymph_node_transfer',)\n", - "\n", - "\n", - "cells\n", + "\n", + "\n", + "cells\n", "\n", "\n", "\n", "('tumor_environment', 'agents', 'tcell_0')\n", - "\n", - "tcell_0\n", + "\n", + "tcell_0\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents')->('tumor_environment', 'agents', 'tcell_0')\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents', 'tumor_0')\n", - "\n", - "tumor_0\n", + "\n", + "tumor_0\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents')->('tumor_environment', 'agents', 'tumor_0')\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents', 'dendritic_0')\n", - "\n", - "dendritic_0\n", + "\n", + "dendritic_0\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents')->('tumor_environment', 'agents', 'dendritic_0')\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents', 'tcell_0', 'division')\n", - "\n", - "division\n", + "\n", + "division\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents')->('tumor_environment', 'agents', 'tcell_0', 'division')\n", - "\n", - "\n", - "agents\n", + "\n", + "\n", + "agents\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents', 'tcell_0', 'death')\n", - "\n", - "death\n", + "\n", + "death\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents')->('tumor_environment', 'agents', 'tcell_0', 'death')\n", - "\n", - "\n", - "agents\n", + "\n", + "\n", + "agents\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents')->('tumor_environment', 'neighbors_multibody')\n", - "\n", - "\n", - "cells\n", + "\n", + "\n", + "cells\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents')->('tumor_environment', 'diffusion_field')\n", - "\n", - "\n", - "cells\n", + "\n", + "\n", + "cells\n", "\n", "\n", "\n", "('tumor_environment', 'agents', 'tcell_0', 'boundary')\n", - "\n", - "boundary\n", + "\n", + "boundary\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents', 'tcell_0')->('tumor_environment', 'agents', 'tcell_0', 'boundary')\n", - "\n", + "\n", "\n", "\n", "\n", "('tumor_environment', 'agents', 'tcell_0', 'neighbors')\n", - "\n", - "neighbors\n", + "\n", + "neighbors\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents', 'tcell_0')->('tumor_environment', 'agents', 'tcell_0', 'neighbors')\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents', 'tcell_0', 'internal')\n", - "\n", - "internal\n", + "\n", + "internal\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents', 'tcell_0')->('tumor_environment', 'agents', 'tcell_0', 'internal')\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents', 'tcell_0', 't_cell')\n", - "\n", - "t_cell\n", + "\n", + "t_cell\n", "\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents', 'tcell_0', 'local_field')\n", - "\n", - "local_field\n", + "\n", + "local_field\n", "\n", "\n", "\n", @@ -1592,185 +1592,229 @@ "\n", "\n", "('tumor_environment', 'agents', 'tcell_0', 'boundary', 'death')\n", - "\n", - "death\n", + "\n", + "death\n", "\n", "\n", "\n", "('tumor_environment', 'agents', 'tcell_0', 'boundary')->('tumor_environment', 'agents', 'tcell_0', 'boundary', 'death')\n", - "\n", + "\n", "\n", "\n", "\n", "('tumor_environment', 'agents', 'tcell_0', 'boundary', 'location')\n", - "\n", - "location\n", + "\n", + "location\n", "\n", "\n", "\n", "('tumor_environment', 'agents', 'tcell_0', 'boundary')->('tumor_environment', 'agents', 'tcell_0', 'boundary', 'location')\n", - "\n", + "\n", "\n", "\n", "\n", "('tumor_environment', 'agents', 'tcell_0', 'boundary', 'exchange')\n", - "\n", - "exchange\n", + "\n", + "exchange\n", "\n", "\n", "\n", "('tumor_environment', 'agents', 'tcell_0', 'boundary')->('tumor_environment', 'agents', 'tcell_0', 'boundary', 'exchange')\n", - "\n", + "\n", "\n", "\n", "\n", "('tumor_environment', 'agents', 'tcell_0', 'boundary', 'diameter')\n", - "\n", - "diameter\n", + "\n", + "diameter\n", "\n", "\n", "\n", "('tumor_environment', 'agents', 'tcell_0', 'boundary')->('tumor_environment', 'agents', 'tcell_0', 'boundary', 'diameter')\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents', 'tcell_0', 'boundary')->('tumor_environment', 'agents', 'tcell_0', 't_cell')\n", - "\n", - "\n", - "boundary\n", + "\n", + "\n", + "boundary\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents', 'tcell_0', 'boundary')->('tumor_environment', 'agents', 'tcell_0', 't_cell')\n", - "\n", - "\n", - "globals\n", + "\n", + "\n", + "globals\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents', 'tcell_0', 'boundary')->('tumor_environment', 'agents', 'tcell_0', 'division')\n", - "\n", - "\n", - "global\n", + "\n", + "\n", + "global\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents', 'tcell_0', 'boundary', 'death')->('tumor_environment', 'agents', 'tcell_0', 'death')\n", - "\n", - "\n", - "trigger\n", + "\n", + "\n", + "trigger\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents', 'tcell_0', 'boundary', 'location')->('tumor_environment', 'agents', 'tcell_0', 'local_field')\n", - "\n", - "\n", - "location\n", + "\n", + "\n", + "location\n", "\n", "\n", "\n", "('tumor_environment', 'agents', 'tcell_0', 'boundary', 'exchange', 'IFNg')\n", - "\n", - "IFNg\n", + "\n", + "IFNg\n", "\n", "\n", "\n", "('tumor_environment', 'agents', 'tcell_0', 'boundary', 'exchange')->('tumor_environment', 'agents', 'tcell_0', 'boundary', 'exchange', 'IFNg')\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents', 'tcell_0', 'boundary', 'exchange')->('tumor_environment', 'agents', 'tcell_0', 'local_field')\n", - "\n", - "\n", - "exchanges\n", + "\n", + "\n", + "exchanges\n", "\n", "\n", "\n", "('tumor_environment', 'agents', 'tcell_0', 'neighbors', 'present')\n", - "\n", - "present\n", + "\n", + "present\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents', 'tcell_0', 'neighbors')->('tumor_environment', 'agents', 'tcell_0', 'neighbors', 'present')\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "('tumor_environment', 'agents', 'tcell_0', 'neighbors', 'accept')\n", + "\n", + "accept\n", + "\n", + "\n", + "\n", + "('tumor_environment', 'agents', 'tcell_0', 'neighbors')->('tumor_environment', 'agents', 'tcell_0', 'neighbors', 'accept')\n", + "\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents', 'tcell_0', 'neighbors')->('tumor_environment', 'agents', 'tcell_0', 't_cell')\n", - "\n", - "\n", - "neighbors\n", + "\n", + "\n", + "neighbors\n", "\n", "\n", "\n", "('tumor_environment', 'agents', 'tcell_0', 'neighbors', 'present', 'PD1')\n", - "\n", - "PD1\n", + "\n", + "PD1\n", "\n", "\n", "\n", "('tumor_environment', 'agents', 'tcell_0', 'neighbors', 'present')->('tumor_environment', 'agents', 'tcell_0', 'neighbors', 'present', 'PD1')\n", - "\n", + "\n", + "\n", + "\n", + "\n", + "('tumor_environment', 'agents', 'tcell_0', 'neighbors', 'present', 'TCR')\n", + "\n", + "TCR\n", + "\n", + "\n", + "\n", + "('tumor_environment', 'agents', 'tcell_0', 'neighbors', 'present')->('tumor_environment', 'agents', 'tcell_0', 'neighbors', 'present', 'TCR')\n", + "\n", + "\n", + "\n", + "\n", + "('tumor_environment', 'agents', 'tcell_0', 'neighbors', 'accept', 'PDL1')\n", + "\n", + "PDL1\n", + "\n", + "\n", + "\n", + "('tumor_environment', 'agents', 'tcell_0', 'neighbors', 'accept')->('tumor_environment', 'agents', 'tcell_0', 'neighbors', 'accept', 'PDL1')\n", + "\n", + "\n", + "\n", + "\n", + "('tumor_environment', 'agents', 'tcell_0', 'neighbors', 'accept', 'MHCI')\n", + "\n", + "MHCI\n", + "\n", + "\n", + "\n", + "('tumor_environment', 'agents', 'tcell_0', 'neighbors', 'accept')->('tumor_environment', 'agents', 'tcell_0', 'neighbors', 'accept', 'MHCI')\n", + "\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents', 'tcell_0', 'internal', 'cell_state')\n", - "\n", - "cell_state\n", + "\n", + "cell_state\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents', 'tcell_0', 'internal')->('tumor_environment', 'agents', 'tcell_0', 'internal', 'cell_state')\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'agents', 'tcell_0', 'internal')->('tumor_environment', 'agents', 'tcell_0', 't_cell')\n", - "\n", - "\n", - "internal\n", + "\n", + "\n", + "internal\n", "\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'dimensions')->('tumor_environment', 'agents', 'tcell_0', 'local_field')\n", - "\n", - "\n", - "dimensions\n", + "\n", + "\n", + "dimensions\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'dimensions')->('tumor_environment', 'diffusion_field')\n", - "\n", - "\n", - "dimensions\n", + "\n", + "\n", + "dimensions\n", "\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'fields')->('tumor_environment', 'agents', 'tcell_0', 'local_field')\n", - "\n", - "\n", - "fields\n", + "\n", + "\n", + "fields\n", "\n", "\n", - "\n", + "\n", "('tumor_environment', 'fields')->('tumor_environment', 'diffusion_field')\n", - "\n", - "\n", - "fields\n", + "\n", + "\n", + "fields\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 69, + "execution_count": 40, "metadata": {}, "output_type": "execute_result" } @@ -1783,7 +1827,9 @@ "abm_experiment_spec2['tumor_environment']['agents']['tumor_0'] = {}\n", "internal_spec = {'cell_state': {}}\n", "boundary_spec = {'diameter': {}, 'exchange': {'IFNg': {}}}\n", - "neighbors_spec = {'present': {'PD1': {}}}\n", + "neighbors_spec = {\n", + " 'present': {'PD1': {}, 'TCR': {}}, \n", + " 'accept': {'PDL1': {}, 'MHCI': {}}}\n", "abm_experiment_spec2['tumor_environment']['agents']['tcell_0']['internal'] = internal_spec\n", "abm_experiment_spec2['tumor_environment']['agents']['tcell_0']['boundary'].update(boundary_spec)\n", "abm_experiment_spec2['tumor_environment']['agents']['tcell_0']['neighbors'].update(neighbors_spec)\n", @@ -1823,7 +1869,7 @@ }, { "cell_type": "code", - "execution_count": 70, + "execution_count": 41, "id": "b3ac3d11-c31c-4ad7-9353-bb7092cfdc3c", "metadata": {}, "outputs": [], @@ -1835,7 +1881,7 @@ }, { "cell_type": "code", - "execution_count": 71, + "execution_count": 42, "id": "b2bc6fd1-e992-409b-8a9d-ccb98254f296", "metadata": {}, "outputs": [ @@ -1902,10 +1948,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 71, + "execution_count": 42, "metadata": {}, "output_type": "execute_result" } @@ -1920,7 +1966,7 @@ }, { "cell_type": "code", - "execution_count": 72, + "execution_count": 43, "id": "f2909500-ef91-459f-9d29-56ceb3a44223", "metadata": {}, "outputs": [ @@ -2000,10 +2046,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 72, + "execution_count": 43, "metadata": {}, "output_type": "execute_result" } @@ -2032,8 +2078,8 @@ }, { "cell_type": "code", - "execution_count": 83, - "id": "b759be45-60a0-47b6-8622-571e0af6f18f", + "execution_count": 58, + "id": "a0c87e6c-ba24-410a-9f9b-85007de6627d", "metadata": {}, "outputs": [ { @@ -2045,157 +2091,580 @@ "\n", "\n", - "\n", - "\n", + "\n", + "\n", "bigraph\n", - "\n", - "\n", + "\n", + "\n", "\n", - "('agents',)\n", - "\n", - "agents\n", + "('t_cell',)\n", + "\n", + "t_cell\n", "\n", - "\n", + "\n", "\n", - "('agents', 't_cell')\n", - "\n", - "t_cell\n", + "('t_cell', 'boundary')\n", + "\n", + "boundary\n", "\n", - "\n", - "\n", - "('agents',)->('agents', 't_cell')\n", - "\n", + "\n", + "\n", + "('t_cell',)->('t_cell', 'boundary')\n", + "\n", "\n", - "\n", - "\n", - "('agents', 't_cell', 'division')\n", - "\n", - "division\n", + "\n", + "\n", + "('t_cell', 'neighbors')\n", + "\n", + "neighbors\n", "\n", - "\n", + "\n", "\n", - "('agents',)->('agents', 't_cell', 'division')\n", - "\n", - "\n", - "agents\n", - "\n", - "\n", - "\n", - "('agents', 't_cell', 'death')\n", - "\n", - "death\n", + "('t_cell',)->('t_cell', 'neighbors')\n", + "\n", "\n", - "\n", - "\n", - "('agents',)->('agents', 't_cell', 'death')\n", - "\n", - "\n", - "agents\n", - "\n", - "\n", - "\n", - "('agents', 't_cell', 'boundary')\n", - "\n", - "boundary\n", + "\n", + "\n", + "('t_cell', 'internal')\n", + "\n", + "internal\n", "\n", - "\n", - "\n", - "('agents', 't_cell')->('agents', 't_cell', 'boundary')\n", - "\n", + "\n", + "\n", + "('t_cell',)->('t_cell', 'internal')\n", + "\n", "\n", - "\n", - "\n", - "('agents', 't_cell', 'neighbors')\n", - "\n", - "neighbors\n", + "\n", + "\n", + "('t_cell', 't_cell')\n", + "\n", + "t_cell\n", "\n", - "\n", - "\n", - "('agents', 't_cell')->('agents', 't_cell', 'neighbors')\n", - "\n", + "\n", + "\n", + "\n", + "('t_cell', 'local_field')\n", + "\n", + "local_field\n", "\n", - "\n", - "\n", - "('agents', 't_cell', 'internal')\n", - "\n", - "internal\n", + "\n", + "\n", + "\n", + "('t_cell', 'division')\n", + "\n", + "division\n", "\n", - "\n", - "\n", - "('agents', 't_cell')->('agents', 't_cell', 'internal')\n", - "\n", + "\n", + "\n", + "\n", + "('t_cell', 'death')\n", + "\n", + "death\n", "\n", - "\n", - "\n", - "('agents', 't_cell', 't_cell')\n", - "\n", - "t_cell\n", + "\n", + "\n", + "\n", + "('t_cell', 'boundary', 'death')\n", + "\n", + "death\n", "\n", - "\n", - "\n", - "\n", - "('agents', 't_cell', 'local_field')\n", - "\n", - "local_field\n", + "\n", + "\n", + "('t_cell', 'boundary')->('t_cell', 'boundary', 'death')\n", + "\n", "\n", - "\n", - "\n", - "\n", - "\n", + "\n", "\n", - "('agents', 't_cell', 'boundary', 'death')\n", - "\n", - "death\n", + "('t_cell', 'boundary', 'location')\n", + "\n", + "location\n", "\n", - "\n", - "\n", - "('agents', 't_cell', 'boundary')->('agents', 't_cell', 'boundary', 'death')\n", - "\n", + "\n", + "\n", + "('t_cell', 'boundary')->('t_cell', 'boundary', 'location')\n", + "\n", "\n", - "\n", + "\n", "\n", - "('agents', 't_cell', 'boundary', 'location')\n", - "\n", - "location\n", - "\n", - "\n", - "\n", - "('agents', 't_cell', 'boundary')->('agents', 't_cell', 'boundary', 'location')\n", - "\n", - "\n", - "\n", - "\n", - "('agents', 't_cell', 'boundary', 'exchange')\n", - "\n", - "exchange\n", + "('t_cell', 'boundary', 'exchange')\n", + "\n", + "exchange\n", "\n", - "\n", - "\n", - "('agents', 't_cell', 'boundary')->('agents', 't_cell', 'boundary', 'exchange')\n", - "\n", + "\n", + "\n", + "('t_cell', 'boundary')->('t_cell', 'boundary', 'exchange')\n", + "\n", "\n", - "\n", + "\n", "\n", - "('agents', 't_cell', 'boundary', 'mass')\n", - "\n", - "mass\n", + "('t_cell', 'boundary', 'mass')\n", + "\n", + "mass\n", "\n", - "\n", - "\n", - "('agents', 't_cell', 'boundary')->('agents', 't_cell', 'boundary', 'mass')\n", - "\n", + "\n", + "\n", + "('t_cell', 'boundary')->('t_cell', 'boundary', 'mass')\n", + "\n", "\n", - "\n", + "\n", "\n", - "('agents', 't_cell', 'boundary', 'diameter')\n", - "\n", - "diameter\n", + "('t_cell', 'boundary', 'diameter')\n", + "\n", + "diameter\n", "\n", - "\n", - "\n", - "('agents', 't_cell', 'boundary')->('agents', 't_cell', 'boundary', 'diameter')\n", - "\n", + "\n", + "\n", + "('t_cell', 'boundary')->('t_cell', 'boundary', 'diameter')\n", + "\n", + "\n", + "\n", + "\n", + "('t_cell', 'boundary', 'velocity')\n", + "\n", + "velocity\n", + "\n", + "\n", + "\n", + "('t_cell', 'boundary')->('t_cell', 'boundary', 'velocity')\n", + "\n", + "\n", + "\n", + "\n", + "('t_cell', 'boundary', 'external')\n", + "\n", + "external\n", + "\n", + "\n", + "\n", + "('t_cell', 'boundary')->('t_cell', 'boundary', 'external')\n", + "\n", + "\n", + "\n", + "\n", + "('t_cell', 'boundary')->('t_cell', 't_cell')\n", + "\n", + "\n", + "boundary\n", + "\n", + "\n", + "\n", + "('t_cell', 'boundary')->('t_cell', 't_cell')\n", + "\n", + "\n", + "globals\n", + "\n", + "\n", + "\n", + "('t_cell', 'boundary')->('t_cell', 'division')\n", + "\n", + "\n", + "global\n", + "\n", + "\n", + "\n", + "('t_cell', 'boundary', 'death')->('t_cell', 'death')\n", + "\n", + "\n", + "trigger\n", + "\n", + "\n", + "\n", + "('t_cell', 'boundary', 'location')->('t_cell', 'local_field')\n", + "\n", + "\n", + "location\n", + "\n", + "\n", + "\n", + "('t_cell', 'boundary', 'exchange', 'IFNg')\n", + "\n", + "IFNg\n", + "\n", + "\n", + "\n", + "('t_cell', 'boundary', 'exchange')->('t_cell', 'boundary', 'exchange', 'IFNg')\n", + "\n", + "\n", + "\n", + "\n", + "('t_cell', 'boundary', 'exchange')->('t_cell', 'local_field')\n", + "\n", + "\n", + "exchanges\n", + "\n", + "\n", + "\n", + "('t_cell', 'boundary', 'external', 'IFNg')\n", + "\n", + "IFNg\n", + "\n", + "\n", + "\n", + "('t_cell', 'boundary', 'external')->('t_cell', 'boundary', 'external', 'IFNg')\n", + "\n", + "\n", + "\n", + "\n", + "('t_cell', 'boundary', 'external', 'tumor_debris')\n", + "\n", + "tumor_debris\n", + "\n", + "\n", + "\n", + "('t_cell', 'boundary', 'external')->('t_cell', 'boundary', 'external', 'tumor_debris')\n", + "\n", + "\n", + "\n", + "\n", + "('t_cell', 'neighbors', 'present')\n", + "\n", + "present\n", + "\n", + "\n", + "\n", + "('t_cell', 'neighbors')->('t_cell', 'neighbors', 'present')\n", + "\n", + "\n", + "\n", + "\n", + "('t_cell', 'neighbors', 'accept')\n", + "\n", + "accept\n", + "\n", + "\n", + "\n", + "('t_cell', 'neighbors')->('t_cell', 'neighbors', 'accept')\n", + "\n", + "\n", + "\n", + "\n", + "('t_cell', 'neighbors')->('t_cell', 't_cell')\n", + "\n", + "\n", + "neighbors\n", + "\n", + "\n", + "\n", + "('t_cell', 'neighbors', 'present', 'PD1')\n", + "\n", + "PD1\n", + "\n", + "\n", + "\n", + "('t_cell', 'neighbors', 'present')->('t_cell', 'neighbors', 'present', 'PD1')\n", + "\n", + "\n", + "\n", + "\n", + "('t_cell', 'neighbors', 'present', 'TCR')\n", + "\n", + "TCR\n", + "\n", + "\n", + "\n", + "('t_cell', 'neighbors', 'present')->('t_cell', 'neighbors', 'present', 'TCR')\n", + "\n", + "\n", + "\n", + "\n", + "('t_cell', 'neighbors', 'accept', 'PDL1')\n", + "\n", + "PDL1\n", + "\n", + "\n", + "\n", + "('t_cell', 'neighbors', 'accept')->('t_cell', 'neighbors', 'accept', 'PDL1')\n", + "\n", + "\n", + "\n", + "\n", + "('t_cell', 'neighbors', 'accept', 'MHCI')\n", + "\n", + "MHCI\n", + "\n", + "\n", + "\n", + "('t_cell', 'neighbors', 'accept')->('t_cell', 'neighbors', 'accept', 'MHCI')\n", + "\n", + "\n", + "\n", + "\n", + "('t_cell', 'internal', 'cell_state')\n", + "\n", + "cell_state\n", + "\n", + "\n", + "\n", + "('t_cell', 'internal')->('t_cell', 'internal', 'cell_state')\n", + "\n", + "\n", + "\n", + "\n", + "('t_cell', 'internal')->('t_cell', 't_cell')\n", + "\n", + "\n", + "internal\n", + "\n", + "\n", + "\n", + "\n", + "('t_cell', 'local_field', 'fields')->('t_cell', 'local_field')\n", + "\n", + "\n", + "fields\n", + "\n", + "\n", + "\n", + "\n", + "('t_cell', 'local_field', 'dimensions')->('t_cell', 'local_field')\n", + "\n", + "\n", + "dimensions\n", + "\n", + "\n", + "\n", + "\n", + "('t_cell', 'division', 'agents')->('t_cell', 'division')\n", + "\n", + "\n", + "agents\n", + "\n", + "\n", + "\n", + "\n", + "('t_cell', 'death', 'agents')->('t_cell', 'death')\n", + "\n", + "\n", + "agents\n", + "\n", + "\n", + "\n" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 58, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "tcell0 = copy.deepcopy(tumor_agents_spec['tcell_0'])\n", + "tcell0['local_field']['_ports'] = {\n", + " 'fields': '', 'dimensions': '', 'location': '', 'exchanges': ''}\n", + "del tcell0['local_field']['wires']['fields']\n", + "del tcell0['local_field']['wires']['dimensions']\n", + "\n", + "\n", + "boundary_spec = {'mass': {}, 'diameter': {}, 'velocity': {}, \n", + " 'exchange': {\n", + " 'IFNg': {}}, \n", + " 'external': {\n", + " 'IFNg': {}, 'tumor_debris': {}}}\n", + "internal_spec = {'cell_state': {}}\n", + "neighbors_spec = {\n", + " 'present': {'PD1': {}, 'TCR': {}}, \n", + " 'accept': {'PDL1': {}, 'MHCI': {}}}\n", + "\n", + "tcell0['boundary'].update(boundary_spec)\n", + "tcell0['internal'].update(internal_spec)\n", + "tcell0['neighbors'] = neighbors_spec\n", + "\n", + "# remove division and death connection to agents\n", + "tcell0['division']['_ports'] = {'global': '', 'agents': ''}\n", + "tcell0['death']['_ports'] = {'trigger': '', 'agents': ''}\n", + "del tcell0['division']['wires']['agents']\n", + "del tcell0['death']['wires']['agents']\n", + "\n", + "nodec1 = {\n", + " # ('agents',): c2,\n", + " ('t_cell',): c3,\n", + " ('t_cell', 'boundary',): c4,\n", + " ('t_cell', 'internal',): c4,\n", + " ('t_cell', 'neighbors',): c4,\n", + "}\n", + "node_border_colors = {\n", + " ('t_cell', 't_cell'): 'red',\n", + "}\n", + "\n", + "plot_bigraph({'t_cell': tcell0}, \n", + " node_fill_colors={**nodec1},\n", + " node_border_colors=node_border_colors,\n", + " **plot_settings,\n", + " filename='tcell_composite',\n", + " remove_process_place_edges=True,\n", + " # **{'out_dir': 'out','dpi': '250'}\n", + " )" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "id": "b759be45-60a0-47b6-8622-571e0af6f18f", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "bigraph\n", + "\n", + "\n", + "\n", + "('agents',)\n", + "\n", + "agents\n", + "\n", + "\n", + "\n", + "('agents', 't_cell')\n", + "\n", + "t_cell\n", + "\n", + "\n", + "\n", + "('agents',)->('agents', 't_cell')\n", + "\n", + "\n", + "\n", + "\n", + "('agents', 't_cell', 'division')\n", + "\n", + "division\n", + "\n", + "\n", + "\n", + "('agents',)->('agents', 't_cell', 'division')\n", + "\n", + "\n", + "agents\n", + "\n", + "\n", + "\n", + "('agents', 't_cell', 'death')\n", + "\n", + "death\n", + "\n", + "\n", + "\n", + "('agents',)->('agents', 't_cell', 'death')\n", + "\n", + "\n", + "agents\n", + "\n", + "\n", + "\n", + "('agents', 't_cell', 'boundary')\n", + "\n", + "boundary\n", + "\n", + "\n", + "\n", + "('agents', 't_cell')->('agents', 't_cell', 'boundary')\n", + "\n", + "\n", + "\n", + "\n", + "('agents', 't_cell', 'neighbors')\n", + "\n", + "neighbors\n", + "\n", + "\n", + "\n", + "('agents', 't_cell')->('agents', 't_cell', 'neighbors')\n", + "\n", + "\n", + "\n", + "\n", + "('agents', 't_cell', 'internal')\n", + "\n", + "internal\n", + "\n", + "\n", + "\n", + "('agents', 't_cell')->('agents', 't_cell', 'internal')\n", + "\n", + "\n", + "\n", + "\n", + "('agents', 't_cell', 't_cell')\n", + "\n", + "t_cell\n", + "\n", + "\n", + "\n", + "\n", + "('agents', 't_cell', 'local_field')\n", + "\n", + "local_field\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "('agents', 't_cell', 'boundary', 'death')\n", + "\n", + "death\n", + "\n", + "\n", + "\n", + "('agents', 't_cell', 'boundary')->('agents', 't_cell', 'boundary', 'death')\n", + "\n", + "\n", + "\n", + "\n", + "('agents', 't_cell', 'boundary', 'location')\n", + "\n", + "location\n", + "\n", + "\n", + "\n", + "('agents', 't_cell', 'boundary')->('agents', 't_cell', 'boundary', 'location')\n", + "\n", + "\n", + "\n", + "\n", + "('agents', 't_cell', 'boundary', 'exchange')\n", + "\n", + "exchange\n", + "\n", + "\n", + "\n", + "('agents', 't_cell', 'boundary')->('agents', 't_cell', 'boundary', 'exchange')\n", + "\n", + "\n", + "\n", + "\n", + "('agents', 't_cell', 'boundary', 'mass')\n", + "\n", + "mass\n", + "\n", + "\n", + "\n", + "('agents', 't_cell', 'boundary')->('agents', 't_cell', 'boundary', 'mass')\n", + "\n", + "\n", + "\n", + "\n", + "('agents', 't_cell', 'boundary', 'diameter')\n", + "\n", + "diameter\n", + "\n", + "\n", + "\n", + "('agents', 't_cell', 'boundary')->('agents', 't_cell', 'boundary', 'diameter')\n", + "\n", "\n", "\n", "\n", @@ -2295,10 +2764,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 83, + "execution_count": 48, "metadata": {}, "output_type": "execute_result" } @@ -2347,7 +2816,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": null, "id": "9ed5943a-f5f9-48b9-875a-dc91014edc85", "metadata": {}, "outputs": [], @@ -2370,75 +2839,11 @@ ] }, { - "cell_type": "code", - "execution_count": 38, - "id": "63ea9b11-c757-4728-8149-c991567ce7eb", - "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('t_cell',)\n", - "\n", - "t_cell\n", - "\n", - "\n", - "\n", - "\n", - "('t_cell', 'internal')->('t_cell',)\n", - "\n", - "\n", - "internal\n", - "\n", - "\n", - "\n", - "\n", - "('t_cell', 'boundary')->('t_cell',)\n", - "\n", - "\n", - "boundary\n", - "\n", - "\n", - "\n", - "\n", - "('t_cell', 'globals')->('t_cell',)\n", - "\n", - "\n", - "globals\n", - "\n", - "\n", - "\n", - "\n", - "('t_cell', 'neighbors')->('t_cell',)\n", - "\n", - "\n", - "neighbors\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 38, - "metadata": {}, - "output_type": "execute_result" - } - ], + "cell_type": "code", + "execution_count": null, + "id": "63ea9b11-c757-4728-8149-c991567ce7eb", + "metadata": {}, + "outputs": [], "source": [ "t_cell_spec = {'t_cell': {'_ports': tcell_topology['t_cell']}}\n", "plot_bigraph(t_cell_spec, **plot_settings, filename='tcell_process')" @@ -2446,74 +2851,10 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": null, "id": "d1acbc97-e303-40fa-a6d2-4e47555e98ab", "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('tumor',)\n", - "\n", - "tumor\n", - "\n", - "\n", - "\n", - "\n", - "('tumor', 'internal')->('tumor',)\n", - "\n", - "\n", - "internal\n", - "\n", - "\n", - "\n", - "\n", - "('tumor', 'boundary')->('tumor',)\n", - "\n", - "\n", - "boundary\n", - "\n", - "\n", - "\n", - "\n", - "('tumor', 'globals')->('tumor',)\n", - "\n", - "\n", - "globals\n", - "\n", - "\n", - "\n", - "\n", - "('tumor', 'neighbors')->('tumor',)\n", - "\n", - "\n", - "neighbors\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 39, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "tumor_spec = {'tumor': {'_ports': tumor_topology['tumor']}}\n", "plot_bigraph(tumor_spec, **plot_settings, filename='tumor_process')" @@ -2521,74 +2862,10 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": null, "id": "569ccfea-ec94-4e8d-8af8-5be0e509a044", "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('dendritic_cell',)\n", - "\n", - "dendritic_cell\n", - "\n", - "\n", - "\n", - "\n", - "('dendritic_cell', 'internal')->('dendritic_cell',)\n", - "\n", - "\n", - "internal\n", - "\n", - "\n", - "\n", - "\n", - "('dendritic_cell', 'boundary')->('dendritic_cell',)\n", - "\n", - "\n", - "boundary\n", - "\n", - "\n", - "\n", - "\n", - "('dendritic_cell', 'globals')->('dendritic_cell',)\n", - "\n", - "\n", - "globals\n", - "\n", - "\n", - "\n", - "\n", - "('dendritic_cell', 'neighbors')->('dendritic_cell',)\n", - "\n", - "\n", - "neighbors\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 40, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "dendritic_spec = {'dendritic_cell': {'_ports': dendritic_topology['dendritic_cell']}}\n", "plot_bigraph(dendritic_spec, **plot_settings, filename='dendritic_process')" @@ -2604,74 +2881,10 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": null, "id": "88451f47-8c93-4143-9289-40198968b3f5", "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('local_field',)\n", - "\n", - "local_field\n", - "\n", - "\n", - "\n", - "\n", - "('local_field', 'exchanges')->('local_field',)\n", - "\n", - "\n", - "exchanges\n", - "\n", - "\n", - "\n", - "\n", - "('local_field', 'location')->('local_field',)\n", - "\n", - "\n", - "location\n", - "\n", - "\n", - "\n", - "\n", - "('local_field', 'fields')->('local_field',)\n", - "\n", - "\n", - "fields\n", - "\n", - "\n", - "\n", - "\n", - "('local_field', 'dimensions')->('local_field',)\n", - "\n", - "\n", - "dimensions\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 41, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "local_field_spec = {'local_field': {'_ports': tcell_topology['local_field']}}\n", "plot_bigraph(local_field_spec, **plot_settings, filename='local_field_process')" @@ -2679,58 +2892,10 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": null, "id": "05697c8e-cd0d-4a4c-b291-d867d5205532", "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('division',)\n", - "\n", - "division\n", - "\n", - "\n", - "\n", - "\n", - "('division', 'global')->('division',)\n", - "\n", - "\n", - "global\n", - "\n", - "\n", - "\n", - "\n", - "('division', 'agents')->('division',)\n", - "\n", - "\n", - "agents\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 42, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "division_spec = {'division': {'_ports': tcell_topology['division']}}\n", "plot_bigraph(division_spec, **plot_settings, filename='division_process')" @@ -2738,58 +2903,10 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": null, "id": "8bd9c850-5b79-4676-88e0-b8218762a03d", "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('death',)\n", - "\n", - "death\n", - "\n", - "\n", - "\n", - "\n", - "('death', 'trigger')->('death',)\n", - "\n", - "\n", - "trigger\n", - "\n", - "\n", - "\n", - "\n", - "('death', 'agents')->('death',)\n", - "\n", - "\n", - "agents\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 43, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "death_spec = {'death': {'_ports': tcell_topology['death']}}\n", "plot_bigraph(death_spec, **plot_settings, filename='death_process')" @@ -2805,52 +2922,12 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": null, "id": "e911f343-f60f-4a4f-a8f4-a38550d305e0", "metadata": { "scrolled": true }, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('neighbors',)\n", - "\n", - "neighbors\n", - "\n", - "\n", - "\n", - "\n", - "('neighbors', 'cells')->('neighbors',)\n", - "\n", - "\n", - "cells\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 44, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "neighbors_spec = {'neighbors': {'_ports': neighbors_topology}}\n", "plot_bigraph(neighbors_spec, **plot_settings, filename='neighbors_process')" @@ -2858,66 +2935,10 @@ }, { "cell_type": "code", - "execution_count": 45, + "execution_count": null, "id": "b0207969-ccdf-4e36-ac9c-e3d61754eb55", "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('diffusion_field',)\n", - "\n", - "diffusion_field\n", - "\n", - "\n", - "\n", - "\n", - "('diffusion_field', 'cells')->('diffusion_field',)\n", - "\n", - "\n", - "cells\n", - "\n", - "\n", - "\n", - "\n", - "('diffusion_field', 'fields')->('diffusion_field',)\n", - "\n", - "\n", - "fields\n", - "\n", - "\n", - "\n", - "\n", - "('diffusion_field', 'dimensions')->('diffusion_field',)\n", - "\n", - "\n", - "dimensions\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 45, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "diffusion_spec = {'diffusion_field': {'_ports': diffusion_topology}}\n", "plot_bigraph(diffusion_spec, **plot_settings, filename='diffusion_process')" @@ -2925,66 +2946,10 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": null, "id": "4ed30164-8d6a-490b-be7a-a7fd490878b6", "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "bigraph\n", - "\n", - "\n", - "\n", - "('lymph_node_transfer',)\n", - "\n", - "lymph_node_transfer\n", - "\n", - "\n", - "\n", - "\n", - "('lymph_node_transfer', 'cells')->('lymph_node_transfer',)\n", - "\n", - "\n", - "cells\n", - "\n", - "\n", - "\n", - "\n", - "('lymph_node_transfer', 'lymph_node')->('lymph_node_transfer',)\n", - "\n", - "\n", - "lymph_node\n", - "\n", - "\n", - "\n", - "\n", - "('lymph_node_transfer', 'in_transit')->('lymph_node_transfer',)\n", - "\n", - "\n", - "in_transit\n", - "\n", - "\n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 46, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "lymph_node_transfer_spec = {'lymph_node_transfer': {'_ports': lymph_node_transfer_topology}}\n", "plot_bigraph(lymph_node_transfer_spec, **plot_settings, filename='lymph_node_transfer_process')" diff --git a/tumor_tcell/processes/lymph_node.py b/tumor_tcell/processes/lymph_node.py index bc648d6..dcb1553 100644 --- a/tumor_tcell/processes/lymph_node.py +++ b/tumor_tcell/processes/lymph_node.py @@ -175,10 +175,13 @@ def next_update(self, timestep, states): else: # Calculate probability of finding/initializing interaction with dendritic cells # TODO -- this should depend on dendritic cell being present. Not interacting alone - prob_interaction = get_probability_timestep( # TODO -- ERAN -- why not probability_of_occurrence_within_interval? - self.parameters['tcell_find_dendritic_time'], - 14400, # 14400 6 hours (6*60*60 seconds) - timestep) # (Itano, 2003) + prob_interaction = probability_of_occurrence_within_interval( + timestep, # (Itano, 2003) + self.parameters['tcell_find_dendritic_time']) + # prob_interaction = get_probability_timestep( + # self.parameters['tcell_find_dendritic_time'], + # 14400, # 14400 6 hours (6*60*60 seconds) + # timestep) # (Itano, 2003) if random.uniform(0, 1) < prob_interaction: # this t-cell is now interacting lymph_node_update[cell_id] = {'internal': {'cell_state': 'interacting'}}