CompuCell3D Workshop: Module 4.1: MultiScale Network Modeling with in CC3D
James A. Glazier
Biocomplexity Institute and Dept of Intelligent Systems Engineering
Indiana University
Bloomington, IN 47408
USA
Thursday, August 4, 2022
Support: NIH NIBIB-U24EB028887, NIGMS-R01GM122424, NSF-2120200, 2000281, NSF-1720625, NIGMS-R01GM076692, NIGMS-R01GM077138
Workshop is live-streamed, recorded and distributed
Learning Objectives
Resources for Network Modeling and Antimony
There are MANY textbooks on dynamical systems, network modeling and the basic mathematical biology
Wikipedia is a great resource
Today we will very briefly review a few key ideas and start exploring some very simple models in CC3D
Reminder of Antimony Syntax and Usage in CC3D
Chemical reactions are fundamental in Antimony
Reminder—Loading and Stepping Antimony Models
For an Antimony models in a String Model = ”””…”””
Add free floating Antimony Model
self.add_free_floating_antimony_model(model_string=Model, model_name=Name, step_size=Step)
Add Antimony Model to a cell
self.add_antimony_model_to_cell(model_string=Model, model_name=Name, cell=cell, step_size=Step)
model_name specifies how to refer to this model from CC3D Python
step_size specifies the conversion from Antimony time units to MCS
Instead of cell= can use ids=[…], cell_types=[…],
To read an Antimony model from a file, replace model_string=Model with model_file=Path
To use stochastic Gillespie solver add the attribute “integrator=“Gillespie”
To time-step Antimony models
self.timestep_sbml()
Use the Twedit++ code snippets or manuals to see all the options
Delta-Notch Patterning
Hair cells of Drosophila inner ear
Eddison et al. PNAS (2000)
Human intestinal crypt cup. Chen et al. MSB (2017)
Zebrafish photoreceptors
Bernardos et al. Dev Biol (2005)
One of the most important mechanisms of cell signaling is mediated by Notch, a transmembrane receptor that coordinates a signaling system known as the Notch pathway
Notch signaling regulates cell fates and pattern formation
For a review of Delta-Notch Patterning see: “Notch signaling: control of cell communication and cell fate,” Eric C. Lai
Delta-Notch Molecular Switch
Delta and Notch are transmembrane proteins.
Delta is the ligand of Notch
Delta in the signaling cell works as the ligand for Notch in the signal-receiving cell.
Notch activation leads to downstream inhibition of Delta activation in the the signal-receiving cell
Mathematical Model of Delta-Notch
Model published by Collier et al. in 1996:
Example – Delta-Notch Patterning
Example – Delta-Notch Patterning
You can load the completed model Exercise4_1_1_Delta_Notch
Exercise 4.1.1—Implementing Delta-Notch �in CC3D
Exercise 4.1.1—Implementing Delta-Notch �in CC3D—Step 1—Create Domain
Exercise 4.1.1—Implementing Delta-Notch �in CC3D—Step 1—Create Domain
Exercise 4.1.1—Implementing Delta-Notch �in CC3D—Step 2—Write Antimony
2. Write the Antimony string corresponding to the ODE equations of the Delta-Notch mathematical model
Exercise 4.1.1—Implementing Delta-Notch in CC3D—Step 2—Write Antimony—Result
2. Write the Antimony string corresponding to the ODE equations of the Delta-Notch mathematical model
Exercise 4.1.1—Implementing Delta-Notch �in CC3D—Step 3—Load Antimony String
3. Load the antimony model to all cells of type A (look in Twedit++ code snippets)
Use a time step of 0.2 and name the model DN
Remember basic syntax self.add_free_floating_antimony_model(model_string = Model, model_name = Name, step_size=Step)
Exercise 4.1.1—Implementing Delta-Notch �in CC3D—Step 3—Load Antimony String—Result
3. Load the antimony model to all cells of type A (look in Twedit++ code snippets)
Use a time step of 0.2 and name the model DN
def start(self):
self.add_antimony_to_cell_types(model_string=model_string, model_name='DN’, cell_types=[self.CELLA], step_size=0.2)
You will have to import numpy as np at the beginning of the Python code
Exercise 4.1.1—Implementing Delta-Notch �in CC3D—Step 4—Initialize Antimony Model and Timestep it in Step
4. In start initialize the values of Delta and Notch on each cell from a uniform random distribution between 0.9 and 1.0
Remember that we reference D and N using
cell.sbml.DN['D’]
cell.sbml.DN[‘N’]
Uniform random syntax is np.random.uniform(min,max)
You will have to import numpy as np at the beginning of the Python code
import numpy as np
Add timestep to step function (look in Twedit++)
Exercise 4.1.1—Implementing Delta-Notch �in CC3D—Step 4—Initialize Antimony Model and Timestep it in Step—Result
4. In start initialize the values of Delta and Notch on each cell from a uniform random distribution between 0.9 and 1.0.
Add timestep to step function
def start(self):
self.add_antimony_to_cell_types(model_string=model_string, model_name='DN’, cell_types=[self.CELLA], step_size=0.2)
for cell in self.cell_list:
cell.sbml.DN['D'] = np.random.uniform(0.9,1.0)
cell.sbml.DN['N'] = np.random.uniform(0.9,1.0)
Def step(self,mcs):
self.timestep_sbml()
You will have to import numpy as np at the beginning of the Python code
Exercise 4.1.1—Implementing Delta-Notch �in CC3D—Step 5—Read and Average Delta Signal Over Neighbors
5. Loop over all cells
Read the Delta level over neighbors and average
Create a placeholder for the average
Use the iterate over neighbors function to loop over neighbors of each cell
Check “if neighbor” to rule out medium
Add the value of ‘D’ from the neighboring cell (neighbor.sbml.DN[‘D’])
Keep track of the number of neighbors
Normalize by number of neighbors
Upadate the value of Davg for your cell
Extension: Keep track of the contact area and weight the signal by the contact area for each neghbor of the cell
Exercise 4.1.1—Implementing Delta-Notch �in CC3D—Step 5—Read and Average Delta Signal Over Neighbors—Result
5. Read the Delta level over neighbors and average
def step(self,mcs):
for cell in self.cell_list:
Davg = 0
nn = 0.0
for (neighbor,common_surface_area) in self.get_cell_neighbor_data_list(cell):
if neighbor:
Davg += neighbor.sbml.DN['D']
nn += 1.0
if nn:
cell.sbml.DN['Davg’] = Davg/nn
Exercise 4.1.1—Delta-Notch �in CC3D—Step 6—Create Tracking Fields
6. Create tracking fields to display the values of Delta and Notch in each cell
(use twedit++ code snippets)
Put the tracking field initialization in the init after the Steppable declaration
Copy the value from cell.sbml.DN[‘N’] to cell.dict[‘N’]
And similarly for ‘D’
Exercise 4.1.1—Delta-Notch �in CC3D—Step 6—Create Tracking Fields—Result
5. Create tracking fields to display the values of Delta and Notch in each cell
Exercise 4.1.1—Implementing Delta-Notch �in CC3D—Results
Run the simulation
Set the Player to display both Delta and Notch fields
What do you see?
If you had trouble with the steps load Exercise4_1_1_Delta_Notch
Extension: Keep track of the contact area and weight the signal by the contact area for each neghbor of the cell
Exercise 4.1.1—Implementing Delta-Notch �in CC3D—Results
Run the simulation
Using Steering Panels in CC3D
CompuCell3D lets you change Python variables from a pop-up window
This functionality is especially useful for nanoHUB applications where the user will not be able to edit the model code and the parameter values are not specified in the CC3DML
Steering is EVENT DRIVEN so the syntax may be a bit unfamiliar
Steps:
1) Create a steering panel window and define the parameters/variables to be modified
2) Define a function that watches for panel updates and reports them
3) Change the values of the updated parameters
Sample Steering Panel Syntax in CC3D—Creating a Steering Panel and Defining Its Elements
CC3D has two kinds of steering menu options (combobox—lists and sliders)
To create a steering panel:
Between the __init__ and the start function add
a function def add_steering_panel(self):
Inside the function add the variables you want to control (specify the name to display, the default, min and max values, the number of digits and the type of widget
def add_steering_panel(self):
self.add_steering_param(name='a', val=0.01, min_val=0.0, max_val =0.02, decimal_precision = 3, widget_name='slider')
self.add_steering_param(name='b', val=100.0, min_val=0.0, max_val=200, decimal_precision = 0,widget_name='slider')
Sample Steering Panel Syntax in CC3D—Catching Steering Panel Changes and Applying them
To trap changes in the steering panel define a function after the add_steering_panel(self) function
def process_steering_panel_data(self):
a = self.get_steering_param(‘a')
b = self.get_steering_param(‘b')
Note that these are local values and need to be transferred to a cell attribute or a global to be accessible outside the function
Sample Steering Panel Syntax in CC3D—Tricks for nanoHUB apps
You can put calls to the steering panel in the step function to delay the simulation until the user selects an option to run, or to set initial conditions;
def step(self, mcs):
#Hold until the simulation type is determined
while self.get_steering_param('simulation_type')=="Select Simulation to Run":
pass
simulation_type=self.get_steering_param('simulation_type')
#At the start of the simulation read the sliders for initialization
if mcs == 0:
# Default is 0.1, Probability of mutation in stemness coefficient per division
Prob_P_Mutation = self.get_steering_param("Prob_P_Mutation")
Exercise 4.1.2—Steering Delta-Notch
You can find the completed exercise in Exercise4_1_2_Delta_Notch_Steering
Exercise 4.1.2—Steering Delta-Notch—Part 1—Add Steering Panel
def add_steering_panel(self):
self.add_steering_param(name='a', val=0.01, min_val=0.0, max_val =0.02, decimal_precision = 3, widget_name='slider')
self.add_steering_param(name='b', val=100.0, min_val=0.0, max_val=200, decimal_precision = 0,widget_name='slider')
def add_steering_panel(self):
self.add_steering_param(name='a', val=0.01, min_val=0.0, max_val =0.02, decimal_precision = 3, widget_name='slider')
self.add_steering_param(name='b', val=100.0, min_val=0.0, max_val=200, decimal_precision = 0,widget_name='slider')
Exercise 4.1.2—Steering Delta-Notch—Part 1—Add Steering Panel—Result
Exercise 4.1.2: Steering Delta-Notch—Part 2 Read and Update the Values of a and b
2. Update the values of the parameters in the antimony model inside each cell with the values passed on to the steering panel
Run it
What happens when you change a and b?
def process_steering_panel_data(self):
a = self.get_steering_param('a')
b = self.get_steering_param('b')
for cell in self.cell_list:
cell.sbml.DN['a'] = a
cell.sbml.DN['b'] = b
Exercise 4.1.2—Steering Delta-Notch—Results
2. Update the values of the parameters in the antimony model inside each cell with the values passed on to the steering panel
You can find the completed exercise in Exercise4_1_2_Delta_Notch_Steering
Using Twedit++ to Add Steppables
If we need to add a steppable to a simulation, we can do this in Twedit++
Select the steppable file (1) and right click
Select “Add Steppable” (2)
Name the steppable (3) and
select the type you want (4)
2
3
4
1
Exercise 4.1.3 – Delta-Notch Patterning and Growth—Delta-Notch Dependence on Growth
Notch can act as a promoter of cell growth
Change your initial condition to start with 2 cells
Have the cells grow slowly at a constant rate and divide at a constant doubling volume grow
How does the pattern evolve?
Finished exercise is available as Exercise4_1_3_Growth_1
Exercise 4.1.3 – Delta-Notch Patterning and Growth—Delta-Notch Dependence on Growth—Add Mitosis Steppable
Notch can act as a promoter of cell growth
Have the cells grow slowly at a constant rate and divide at a constant doubling volume grow
How does the pattern evolve?
First change the CC3ML uniform initializer to draw just two cells
Use Twedit++ to add a mitosis steppable (Call it GrowthandMitosis)
Edit the Steppable so cells grow at a constant rate of 0.1 voxels per MCS and divide when they reach a volume of 50
Have the daughter cell identical to the parent (each inherits half the parent target volume)
Exercise 4.1.3 – Delta-Notch Patterning and Growth—Delta-Notch Dependence on Growth—Add Mitosis Steppable—Code
First change the CC3ML uniform initializer to draw just two cells
Use Twedit++ to add a mitosis steppable (Call it GrowthandMitosis)
Edit the Steppable so cells grow at a constant rate of 0.1 voxels per MCS and divide when they reach a volume of 50
Have the daughter cell identical to the parent (each inherits half the parent target volume)
Run it. What do you see?
Exercise 4.1.3 – Delta-Notch Patterning and Growth—Delta-Notch Dependence on Growth—Add Mitosis Steppable—Results
Notch can act as a promoter of cell growth
Finished exercise is available as Exercise4_1_3_Growth_1
Exercise 4.1.4—Delta-Notch Patterning and Growth—Growth Dependence on Delta-Notch
Notch can act as a promoter of cell growth
Starting with 2 cells, repeat the simulation, but now only have Notch-rich cells grow and divide
Have the growth rate be proportional to the square of the notch level (look at the range of notch levels and have the growth rate be 0.1 when the notch level is near its maximum)
Hint—you only need to change one line of your code
Run it. What do you see?
Extension: Have the growth rate be proportional to the level of Delta squared instead. How are the results different?
Finished exercise available as Exercise4_1_4_Growth_2
Finished exercise is available as Exercise4_1_4_Growth_3_Delta
Exercise 4.1.4—Delta-Notch Patterning and Growth—Growth Dependence on Delta-Notch—Results
Notch can act as a promoter of cell growth
Starting with 2 cells, repeat the simulation, but now only have Notch-rich cells grow and divide
Have the growth rate be a linear function of the notch level (look at the range of notch levels and have the growth rate be 0.1 when the notch level is near its maximum)
Extension
Exercise/Homework 4.1.5—Delta-Notch Patterning and Growth
Repeat the simulation again, but this time, turn off the DN pattern for all cells away from the center of the lattice by 3 cell diameters to simulate differentiation (you probably want to use a larger cell lattice)
Exercise/Homework 4.1.6—Delta-Notch Patterning and Dependence on System Behaviors
Pick one of the following to try
CompuCell3D and Systems Biology Markup Language (SBML)
CompuCell3D Allows you to load and run network models specified in the SBML modeling language
There are many thousands of such models available
However, they require the use of separate model editors to read and write
Regulation of the Cell Cycle
Intracellular molecules that regulate the cell cycle. These regulatory molecules either promote progress of the cell to the next phase (positive regulation) or halt the cycle (negative regulation).
Proteins called cyclins are responsible for the progress of the cell through the various checkpoints. The levels of the four cyclin proteins fluctuate throughout the cell cycle in a predictable pattern.
After the cell moves to the next stage of the cell cycle, the cyclins that were active in the previous stage are degraded
Mathematical Model of Cell Cycle
Model published by Tyson and Novak, 2001:
Has 5 variables, of which the first 2 form the core of the cell cycle oscillations:
An important feature of this model is the presence of the parameter “m”, which is the normalized total mass of the cell:
In this model mitosis occur when the level of CycB drops below 0.1
Simulating the Mathematical Model of Cell Cycle
In the simulation, the ‘m’ parameter varies between ~0.5 (right after mitosis) and ~1 (at normal size) and corresponds in CC3D to the ratio of volume to the resting volume (initial volume):
Mathematical Model of Cell Cycle
Mathematical Model Parameter
CC3D Parameter
Exercise 4.1.7—Download SBML Model�from BioModels
The website www.biomodels.org contains a repository of published models in SBML format.
Search for:�BIOMD0000000195
(7 zeroes)
Exercise 4.1.7—Download SBML Model�from BioModels
Select the Tyson2001_Cell_Cycle_Regulation Model
Exercise 4.1.7—Download SBML Model�from BioModels
Select the Tyson2001_Cell_Cycle_Regulation Model
Exercise 4.1.7—Download SBML Model�from BioModels
Select the Tyson2001_Cell_Cycle_Regulation Model
Loading SBML Models in CC3D
You can load an SBML model into cells just the way we loaded the Antimony model
You reference the variables and parameters through dictionaries, just the way you do with an Antimony model
We won’t have time to work through this model here, but I will show you the SBML and leave you with a Homework Assignment
model_file = './Simulation/BIOMD0000000195_url.xml'
self.add_sbml_to_cell_ids(model_file=model_file, model_name='cellcycle', cell_ids=[1], step_size=0.2)
cell.dict['lastCycB']
Exercise 4.1.8—Open the SBML Model�You Just Downloaded
Use notepad or another editor
SBML is an exchange language—it isn’t designed to be human readable (it is, barely). Fortunately, there are translators that convert SBML to Antimony and back (see cheat sheet)
Homework 4.1.9—Implement the Cell �Cycle in CC3D
56
Building a Simulation of Ca++ Waves in Drosophila Wing Imaginal Disks
Calcium Oscillations in Drosophila Wing Imaginal Disks
57
Soundarrajan, Dharsan K., et al. "From spikes to intercellular waves: Tuning intercellular calcium signaling dynamics modulates organ size control." PLoS computational biology 17.11 (2021): e1009543.
Running and Analyzing the Zartmann Calcium Spiking Model
Soundarrajan, Dharsan K., et al. "From spikes to intercellular waves: Tuning intercellular calcium signaling dynamics modulates organ size control." PLoS Comp Bio 17 (2021): e1009543.
Decoding Calcium Signaling Dynamics during Drosophila Wing Disc Development, PA Brodskiy, …, JJ Zartman, Biophysical Journal 116 (2019) https://doi.org/10.1016/j.bpj.2019.01.007.
Zartmann Calcium Spiking Model Parameters
Zartmann Calcium Spiking Model Parameters
Exercise 4.1.10—Load and Run the Zartmann Model
We don’t have time to derive the Zartman model here
Load the Exercise4_1_10_Zartman_Simple from the email or the Workshop Directory https://drive.google.com/file/d/1lQRssdyGO8WVErN3mXQ8aFXUXir5PKr_/view?usp=sharing
And run it
Exercise 4.1.10—Load and Run the Zartmann Model—Results
We don’t have time to derive the Zartman model here
Load the Exercise4_1_10_Zartman_Simple.zip from the email or Workshop Directory: https://drive.google.com/drive/folders/1m1AHosct2F7xlVCZf9da57eCRfbf7elM?usp=sharing
And run it
Steady oscillations of Ca++
Oscillations
Steady State
Find peaks
Measure mean interval
Find amplitude
Exercise 4.1.11—Wing Disk Geometry—Defining a Rectangle of Cells to Represent the Imaginal Disk
65
Competed exercise is Exercise4_1_11_Zartman_Initial or https://drive.google.com/file/d/1leGtsYI56iu136Slj9KYDB-hI1XZl_rZ/view?usp=sharing
Exercise 4.1.11—Wing Disk Geometry—Initial Simulation Specification—Part 2
66
Exercise 4.1.11—Wing Disk Geometry—Define Cell Types, No Chemical Fields
67
Exercise 4.1.11—Wing Disk Geometry—Plug-in Selection
68
Exercise 4.1.11—Wing Disk Geometry—Initial Configuration
69
Exercise 4.1.11—Wing Disk Geometry—Cell Volume Specification
70
Exercise 4.1.11—Wing Disk Geometry—Contact Energy Specification
71
Exercise 4.1.11—Wing Disk Geometry—Define Simulation Units
Run the simulation. What do you see?
72
Exercise 4.1.11—Wing Disk Geometry—Results
73
Competed exercise is Exercise4_1_11_Zartman_Initial or https://drive.google.com/file/d/1leGtsYI56iu136Slj9KYDB-hI1XZl_rZ/view?usp=sharing
Exercise 4.1.12—Implementing the Subcellular Model of Ca++ Oscillations
74
Completed exercise is Exercise4_1_12_Zartman_Oscillators.zip
Copy and paste the Antimony specification for the ODE model in a multi-line string from your previous Exercise4_1_10_Zartman_Simple
75
Exercise 4.1.12—Implementing the Subcellular Model of Ca++ Oscillations—Define the Subcelluar Model
Completed exercise is Exercise4_1_12_Zartman_Oscillators.zip
76
Exercise 4.1.12—Implementing the Subcellular Model of Ca++ Oscillations—Load the Subcelluar Model in the Cells
Completed exercise is Exercise4_1_12_Zartman_Oscillators.zip
Exercise 4.1.12—Implementing the Subcellular Model of Ca++ Oscillations—Update the Cell Parameters
77
Exercise 4.1.12—Implementing the Subcellular Model of Ca++ Oscillations—Update the Cell Parameters
78
Completed exercise is Exercise4_1_12_Zartman_Oscillators.zip
Exercise 4.1.12—Implementing the Subcellular Model of Ca++ Oscillations—Add Tracking Fields for c, p and r
79
Exercise 4.1.12—Implementing the Subcellular Model of Ca++ Oscillations
80
Completed exercise is Exercise4_1_12_Zartman_Oscillators.zip
Exercise 4.1.12—Implementing the Subcellular Model of Ca++ Oscillations
81
Everything oscillates together and no waves
Completed exercise is Exercise4_1_12_Zartman_Oscillators.zip
Exercise 4.1.13—Subcellular Model of Ca++ Oscillations—Coupling Cells
82
Completed Exercise is Exercise4_1_13_CalciumWaves_Random_Coupled.zip
Exercise 4.1.13—Subcellular Model of Ca++ Oscillations—Coupling Cells
83
Completed Exercise is Exercise4_1_13_CalciumWaves_Random_Coupled.zip
Exercise 4.1.13—Subcellular Model of Ca++ Oscillations—Coupling Cells—1
84
Completed Exercise is Exercise4_1_13_CalciumWaves_Random_Coupled.zip
Exercise 4.1.13—Subcellular Model of Ca++ Oscillations—Coupling Cells—2
85
Completed Exercise is Exercise4_1_13_CalciumWaves_Random_Coupled.zip
Exercise 4.1.13—Subcellular Model of Ca++ Oscillations—Coupling Cells—Flux Calculation
Run the model.
What happens? You may have to wait a while
86
Completed Exercise is Exercise4_1_13_CalciumWaves_Random_Coupled.zip
Exercise 4.1.13—Subcellular Model of Ca++ Oscillations—Coupling Cells--Results
Run the model
What happens? You may have to wait a while
After about 1000 MCS you should see Ca++ waves!
Extension: Explore the effect of the fraction of initiator cells, the high and low VPLC levels, random initial CA++ levels and/or different flucex
87
Completed Exercise is Exercise4_1_13_CalciumWaves_Random_Coupled.zip
Exercise 4.1.14—Subcellular Model of Ca++ Oscillations—Coupling Ca++ to Apical Contractility
88
Completed Exercise is Exercise4_1_14_CalciumWaves_Contraction.zip
Exercise 4.1.14—Subcellular Model of Ca++ Oscillations—Coupling Ca++ to Apical Contractility
89
Exercise 4.1.14—Subcellular Model of Ca++ Oscillations—Coupling Ca++ to Apical Contractility—Results
90
Completed Exercise is Exercise4_1_14_CalciumWaves_Contraction.zip
Exercise 4.1.14—Subcellular Model of Ca++ Oscillations—Coupling Ca++ to Apical Contractility—Results—2
91
Completed Exercise is Exercise4_1_14_CalciumWaves_Contraction.zip
Ideas for Further Exploration
92
Completed Exercise is Exercise4_1_14_CalciumWaves_Contraction.zip
Module 4.1 Questionnaire
Support: NIH NIBIB-U24EB028887, NIGMS-R01GM122424, NSF-188553, NSF-186890, NSF-1720625, NIGMS-R01GM076692, NIGMS-R01GM077138
Please take a minute or two to let us know about your experience with this module by filling out the brief zoom survey
Feel free to provide additional comments and suggestions in the slack or by email to us as well (hfennel@iu.edu)