| Literature DB >> 32155140 |
Rafael R Bravo1, Etienne Baratchart1, Jeffrey West1, Ryan O Schenck1,2, Anna K Miller1, Jill Gallaher1, Chandler D Gatenbee1, David Basanta1, Mark Robertson-Tessi1, Alexander R A Anderson1.
Abstract
The Hybrid Automata Library (HAL) is a Java Library developed for use in mathematical oncology modeling. It is made of simple, efficient, generic components that can be used to model complex spatial systems. HAL's components can broadly be classified into: on- and off-lattice agent containers, finite difference diffusion fields, a GUI building system, and additional tools and utilities for computation and data collection. These components are designed to operate independently and are standardized to make them easy to interface with one another. As a demonstration of how modeling can be simplified using our approach, we have included a complete example of a hybrid model (a spatial model with interacting agent-based and PDE components). HAL is a useful asset for researchers who wish to build performant 1D, 2D and 3D hybrid models in Java, while not starting entirely from scratch. It is available on GitHub at https://github.com/MathOnco/HAL under the MIT License. HAL requires the Java JDK version 1.8 or later to compile and run the source code.Entities:
Year: 2020 PMID: 32155140 PMCID: PMC7105119 DOI: 10.1371/journal.pcbi.1007635
Source DB: PubMed Journal: PLoS Comput Biol ISSN: 1553-734X Impact factor: 4.475
Comparison of HAL with other agent-based modeling frameworks commonly used in tissue modeling as of December 2019.
Features are marked according to whether there exists a built-in user accessible implementation.
| Feature | HAL | Cha | Rep | Mas | Net | Phy | Cel | Bio | Tim | Yal | Epi | Com | Mor | TST |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| On-Lattice ABMs | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ||||||||
| Off-Lattice Point ABMs | ✔ | ✔ | ✔ | ✔ | ✔ | |||||||||
| Off-Lattice Spherical ABMs | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ||||||
| Voronoi Tesselation ABMs | ✔ | ✔ | ||||||||||||
| Cellular Potts ABMs | ✔ | ✔ | ✔ | ✔ | ||||||||||
| Multinomial Population ABMs [ | ✔ | |||||||||||||
| Diffusion PDEs | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | |
| Advection PDEs | ✔ | ✔ | ✔ | ✔ | ✔ | |||||||||
| SBML Compatible [ | ✔ | ✔ | ✔ | ✔ | ||||||||||
| Real-Time Visualization | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ||||||
| Single-Model Parallelization | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | |||
| Windows Compatible | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ||
| Mac Compatible | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ||||
| Linux Compatible | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
| User-Facing Programming Language |
Framework Abbreviations: HAL:Hybrid Automata Library, Cha:Chaste, Rep:Repast, Mas:Mason, Net:Netlogo, Phy:Physicell, Cel:CellSys, Bio:Biocellion, Tim:Timothy, Yal:Yalla, Epi:Episim, Com:CompuCell3D, Mor:Morpheus, TST:Tissue Simulation Toolkit
* User-Facing Programming Languages: J: Java, C: C/C++, R: Relogo/Java/Groovy, N: NetLogo Programming Language, U: CUDA/C++, I: Graphical Interface, P: Python/XML, M: Morpheus model description language
Fig 1HAL’s decentralized design helps build complex models out of simple components.
The highlighted on-lattice agent in the topmost grid searches for local overlaps with several other grids and PDEs. These overlaps can be used in a model to generate spatial interactions.
Fig 2Off-lattice agent examples.
Each example contains 1000 agents. (A)Example of 2D Point Agents modeling Brownian motion. The Point Agents move freely and cannot collide. (B) Example of 2D Spherical Agents modeling a growing cell colony. The agents will push apart from each other to a uniform density. Agent radii are shown as gray circles around their centers. Examples Displayed using the OpenGL2DWindow object.
Fig 3An example of a 3D on-lattice hybrid model of tumor cells spreading through tissue (located in Examples/5Example3D).
The light red vertical lines represent vessels, and the blue dots represent tumor cells. The cell color goes from pink to blue depending on how much oxygen is locally available. The oxygen availability is also indicated via a heatmap on the floor of the display. With a cell radius of 10 μm, the domain has dimensions 1.6 × 1.6 × 0.4 mm. Displayed using the OpenGL3DWindow object.
The 10 base agent types in HAL.
The differences between them are displayed in each column. Stackable refers to whether multiple agents can exist on the same lattice position. The complete type heirarchy used in HAL is described in Fig D in S1 Text.
| Name | Spatial Dimension | Lattice Bound | Stackable |
|---|---|---|---|
| Agent0D | 0 | N/A | N/A |
| AgentSQ1D | 1 | yes | yes |
| AgentSQ1Dunstackable | 1 | yes | no |
| AgentPT1D | 1 | no | yes |
| AgentSQ2D | 2 | yes | yes |
| AgentSQ2Dunstackable | 2 | yes | no |
| AgentPT2D | 2 | no | yes |
| AgentSQ3D | 3 | yes | yes |
| AgentSQ3Dunstackable | 3 | yes | no |
| AgentPT3D | 3 | no | yes |
Fig 4An example PopulationGrid model of tumor growth and mutation in 2D (located in Examples/PopulationTumor).
At the start 1000 cells are placed in the center of the domain. Cells turn over and migrate over time. Two fitness-increasing mutations are possible, and can occur with probability 2 × 10−6 per cell division. The colors white, red, green, and blue indicate density of cells with no mutations, one mutation, the other mutation, and both mutations respectively. Each lattice position in the domain has a carrying capacity of 100,000 cells. If we assume that cells are growing in cubic volumes, then each position represents an overall area of 1 mm3 for a total domain size of 150 × 150 × 1 mm. Displayed using the GridWindow object.
Fig 5An example UIWindow GUI.
When the “Run” UIButton (bottom left) is clicked, the UIGrid component (right) displays a running model that is parameterized with the given UIInputField settings (left). In this example model based on [45], the red cells are stem cells, and the blue cells are differentiated cells. Differentiated cells have a limited number of divisions and therefore can only spread a limited distance from the stem cells. UILabels (top) show the current timestep and population size. With a cell radius of 10 μm, the domain has dimensions 4 × 4 mm.
Fig 6Example of a 10x10 Multi-Well experiment where evolutionary competition of two phenotypes (red,green) shows divergent results with different random seeds.
Models are separated with red lines. With a cell radius of 10 μm, each well has a domain size of 2 × 2 mm.
Fig 7An example of the InteractiveModel object, which allows the modeler to experiment with treatment strategies using a model by Robertson-Tessi et al. [17].
(A) A spatial visualization of the current model state. (B) A control panel of UIButtons allows the user to quickly restart the model, pause execution, clear all treatments, and undo previous changes. Hotkeys for these controls are in brackets. (C) A Speed Control option allows the user to easily adjust the execution speed of the model to range from evaluating as fast as possible to taking a second between timesteps, allowing for careful observation of model dynamics. (D) A timeline that will plot timestep information so that the user may observe aggregate changes over time in response to treatment. The user may also click anywhere in the timeline to backtrack to a previous time point and replay the model from there. The timeline will also automatically backtrack to recalculate any necessary frames when a treatment schedule change is made. (E) A set of sliders that allow the user to select different treatment intensities for each drug. (F) Each horizontal bar parallels the simulation timeline and displays the schedule of a different treatment. Modelers can click on regions within these bars to change regions to a new treatment intensity selected in (E). Modelers may also use the hotkeys presented in (E) to apply the selected intensities in real time as the model runs.
Fig 8(A) Example program flow diagram. Bold font indicates where coding example sections are first called. (B) CellStep function flow diagram.
HAL functions used in the example.
Each function is a method of a particular object, meaning that when the function is called it may use properties that pertain to the object that it is called from.
| Function | Object | Action |
|---|---|---|
| NewAgentSQ(INDEX) | AgentGrid2D | Returns a new agent, placed at the center of the square at the provided position INDEX. |
| ShuffleAgents(RNG) | AgentGrid2D | Usually called after every timestep to shuffle the order of agent iteration. |
| GetTick() | AgentGrid2D | Returns the current grid timestep. |
| ItoX(INDEX), ItoY(INDEX) | AgentGrid2D | Converts from a grid position INDEX into the x and y components that point to the same grid position. |
| MapHood(NEIGHBORHOOD,X,Y) | AgentGrid2D | Finds all position indices in the provided neighborhood, centered around X,Y that don’t fall out of bounds of the AgentGrid2D. Writes these indices into the NEIGHBORHOOD argument, and returns the number that were found. |
| MapEmptyHood(NEIGHBORHOOD) | AgentSQ2D | Finds all position indices in the provided neighborhood, centered around the agent, that do not have an agent occupying them. Writes these indices into the NEIGHBORHOOD argument, and returns the number that were found. |
| G | AgentSQ2D | Gets the grid that the agent occupies. |
| Isq() | AgentSQ2D | Gets the position index of the grid square that the agent occupies. |
| Dispose() | AgentSQ2D | Removes the agent from the grid and from iteration. |
| Get(INDEX) | PDEGrid2D | Returns the concentration of the PDE field at the given index. |
| Mul(INDEX, VALUE) | PDEGrid2D | Multiplies the concentration at the given INDEX by VALUE and adds the result to the current concentration when Update() is called |
| DiffusionADI(RATE) | PDEGrid2D | Applies diffusion using the ADI method with the rate constant provided. A reflective boundary is assumed. The result is applied when Update() is called. |
| DiffusionADI(RATE, BOUNDARY_COND) | PDEGrid2D | Applies diffusion using the ADI method with the RATE constant provided. The BOUNDARY_COND value diffuses from the grid borders. The result is applied when Update() is called. |
| Update() | PDEGrid2D | Applies all state changes simultaneously to the PDEGrid |
| SetPix(INDEX, COLOR) | GridWindow | Sets the color of a pixel. |
| TickPause(MILLISECONDS) | GridWindow | Pauses the program between calls to TickPause. The function automatically subtracts the time between calls from MILLISECONDS to ensure a consistent timestep rate for visualization. |
| ToPNG(FILENAME) | GridWindow | Writes out the current state of the UIWindow to a PNG image file. |
| Close() | GridWindow | Closes the GridWindow. |
| ProbScale(PROB, DURATION) | Util | Scales the probability that an event will occur in 1 unit of time to the probability that the event will occur at least once in the DURATION. |
| RGB(RED, GREEN, BLUE) | Util | Returns an integer with the requested color in RGB format. This value can be used for visualization. |
| HeatMapRGB(VALUE) | Util | Maps the VALUE argument (assumed to be between 0 and 1) to a color in the heat colormap. |
| CircleHood(INCLUDE_ORIGIN, RADIUS) | Util | Returns a set of coordinate pairs that define the neighborhood of all squares whose centers are within the RADIUS distance of the center (0, 0) origin square. The INCLUDE_ORIGIN argument specifies whether to include the origin in this set of coordinates. |
| MooreHood(INCLUDE_ORIGIN) | Util | Returns a set of coordinate pairs that define a Moore neighborhood around the (0, 0) origin square. The INCLUDE_ORIGIN Boolean specifies whether we intend to include the origin in this set of coordinates. |
| Write(STRING) | FileIO | Writes the STRING to the output file. |
| Close() | FileIO | Closes the output file. |
| Double() | Rand | Generates a random double value in the range [0 − 1) |
Fig 10Selected model visualizations.
Blue cells are drug sensitive, Green cells are drug resistant, background heatmap colors show drug concentration. The model domain size is 100 by 100 cells, or 4 mm2
Fig 9FileIO population output.
This plot summarizes the changes in tumor burden over time for each model. This plot was constructed using data accumulated in the program output populations.csv file. Displayed using the Java XChart package.