diff --git a/ECM_framework_schematic.png b/ECM_framework_schematic.png new file mode 100644 index 0000000..89318f7 Binary files /dev/null and b/ECM_framework_schematic.png differ diff --git a/README.md b/README.md index 174df54..3ecd141 100644 --- a/README.md +++ b/README.md @@ -1,73 +1,121 @@ -# Collective invasion and extracellular matrix modeling in an cell-based modeling framework +# A simple framework for agent-based modeling with extracellular matrix -### A model of collective invasion based on multicellular communication mediated through a novel extracellular matrix (ECM) model implemented in PhysiCell. + -## Overview -

NA

+## Framework overview +

NA

-The ECM model has three components: `anisotropy` (agreement of alignment), `fiber orientation` (overall orientation of the fibers), and `density` (relative volume filling of ECM fibers). The collective invasion models uses two different cell types: leader cells and follower cells. Leader cells move up chemotactic gradients and signal their paths by remodeling the ECM. Follower cells alter their motility in response to signals in the ECM as well as chemotaxing when on remodeled ECM and move randomly otherwise. The coupling of ECM signal generating phenotype with ECM signal reading phenotype enables collective behavior (both stigmery and collective invasion) in a range of parameter values. The model and results are explained in depth in [2](#references). See [3](#references) and [4](#references) for a partial biological background. +In this framework [[1](#references)] for modeling the ECM and cell-ECM interactions, we divide the ECM into volumetric elements that track local ECM density, alignment, and overall anisotropy (local microstructure). Individual cell agents can locally remodel each of these properties, while these properties can in turn influence cell behavior including changes in migration speed, chemotactic response, ECM contact guidance, proliferation, death, secretion, and differentiation. It is implemented as an extension of the open source package PhysiCell [[2]](#references) and can readily be used to incorporate local ECM effects into agent-based models, in particular through PhysiCell rules [[3]](#references). -The cell and ECM models are built using [PhysiCell](https://github.com/MathCancer/PhysiCell) v 1.4.1, an open source cell-based, multicellular 3-D modeling framework written in C++. If you are not already familiar with PhysiCell please start by reviewing it (see [1](#references) and [Install](#install) section below) prior to diving deeply into the modeling code here. +For additional details and background on the components of this framework, see [[1](#references)] -A cloud-based, executable version of this model is available at [nanoHUB](https://nanohub.org/tools/physicellecm). A free login is required to access this resource. +## Overview of repository structure and key files -### ECM and leader-follower models and emergent results +### ECM and cell-ECM core files -The ECM is conceived of as being composed of a set of small ECM units, the properties of which can be described by 3 components representing the average value of each component over the small unit. These ECM components impact the motility of ECM sensitive cells and in turn can be altered by cells. +All the examples use the same core source code files. These are the core of the framework and its extension to PhysiCell. They are: -- `Density` (a scalar ranging from 0-1) represents how much overall fiber is present relative to how much space is available to be filled with fibers -- `Fiber orientation` (numerically given as a unit vector) represents the overall (mean) fiber orientations -- `Anisotropy` (0-1) represents how aligned the ECM fibers. +- `extracellular_matrix.h/extracellular_matrix.cpp` + - Contains the ECM element and ECM mesh class definitions and other initilization routine +- `cell_ECM_interactions.h/cell_ECM_matrix.cpp` + - Contains functions for the bidirectional cell-ECM interactions, generating a default ECM compatible agent, and custom output routines -An `anisotropy` value closer to 0 means the fibers are less aligned, producing little signal, and values closer to 1 indicatd highly aligned fibers that produce a strong signal. `Density` influences cell speed as the cell gets stuck if the fibers are too thick and if the fibers are too sparse then the cells have nothing to "grab". The `fiber orientation` influences the motility vector of the cells and the amount of influence is controlled by the `anisotropy`. ECM modifying cells can align the fibers in the direction of their movement (changing `fiber orientation`), increase the `anisotropy` in proportion to the cell's speed, and modify `density` up or down to a target density. +These files are currently located in `custom_modules`. -In our example, leader cells are endowed with ECM modification abilities while follower cells "read" the ECM with accompanying changes in cell motility. Instantiating both cell phenotypes in one simulation and altering the rates of ECM modification and ratios of cell speed to cell-cell adhesion produce a range of multicellular behaviors - including stigmergy, collective invasion, uncoupled behavior of the two populations, or a homestatis like pattern. +### Model files -The models and computational experiments were conceived of and developed by John Metzcar, Ben Duggan, Brandon Fischer, Matthew Murphy and Paul Macklin. Significant help was provided by Randy Heiland and the overall AMIGOS Team. Work was funded by a joint (AMIGOS) JKTGF and BCRF grant. +There are three example models, several variants of the leader-follower model, and simple test models. See the below `Compling and running sample models` below for details on those models. -## Installing PhysiCell +There is one makefile for all compilation. It is located in the `root`. -PhysiCell has a small number of dependencies. Before trying to run the code, you should ensure that your computer can run PhysiCell. Read the PhysiCell [Quick Start Guide](https://github.com/MathCancer/PhysiCell/blob/master/documentation/Quickstart.md) to begin working with PhysiCell and ensure that your system has the proper dependencies installed or follow the [Mac install](https://www.youtube.com/watch?v=Sq9nfKS5U0E&list=PL1fyIV-yPAYzzOVxfGsL90a5KTTh8gSW2&index=2) or [Windows install](https://www.youtube.com/watch?v=hIP4JUrViRA) videos. Note that the videos include more than is required to run the ECM and collective invasion models. Following the install videos through around the half way point of each video is sufficient. SBML and the PhysiCell Model Builder are not required. Python, Matplotlib and other basic Python packages are required to produce visualizations behind the SVGs produced by core PhysiCell. +Each base model has a main_XXX.cpp (in `root`), custom source code (in `custom_code`), and one to several additional model specficifcation files in `config` - always including an XML-based model config file and sometimes including PhysiCell rules and initial cell position files (both .csv's). The config directory also contains special XML-bassed model files for testing and making stochastic replicates. -Additional install support (and otherwise) can be found be generating an issue at [SourceForge](https://sourceforge.net/projects/physicell/) or on the [PhysiCell Slack workspace](https://join.slack.com/t/physicellcomm-sf93727/shared_invite/zt-qj1av6yd-yVeer8VkQaNDjDz7fF00jA). -Note that we recommend downloading the model [release](https://github.com/MathCancer/AMIGOS-invasion/releases). However, you could download or clone the main branch for the most up to date, stable version of the code. +## Using the framework -## How to run +The cell-ECM interaction framework is built as an extension to [PhysiCell](https://github.com/MathCancer/PhysiCell) v 1.12, an open source cell-based, multicellular 3-D modeling framework written in C++. If you are not already familiar with PhysiCell we suggest begining by reviewing it (see [2](#references)). Note, that the ECM framework stands alone - coming with all necessary source code to compile and execute the sample models and develop new models. However, as the ECM framework is a direct extension of PhysiCell, we suggest using the PhysiCell install guides for your system - with current guides [here](https://github.com/physicell-training/ws2023/blob/main/agenda.md) and more generally at the [PhysiCell training repository](https://github.com/physicell-training). -This model runs similarly to most other PhysiCell projects, however, there are some differences that are noted below. +### Compiling and running sample models -After navigating to the root directory, run `make`. This will compile the PhysiCell code and create an executable named `AMIGOS-invasion`. If you have issues compiling or running the code, begin by consulting the PhysiCell [Quick Start Guide](https://github.com/MathCancer/PhysiCell/blob/master/documentation/Quickstart.md) and other documentation. +There are 3 main sample models as well as a series of simple tests. Listed below are instructions for making and running each model and its variants, grouped by which executable is required. -Please submit issues specific to the collective invasion and ECM models as an [issue](https://github.com/PhysiCell-Models/collective-invasion/issues) on this repo. +#### _Simple tests_: -## Settings and exploring the collective invasion model +`make` - compiles the AMIGOS-invasion executable -Many model settings can be edited in the [PhysiCell_settings.xml](config/PhysiCell_settings.xml). While you don't have to edit this file you can get different behavior by changing the settings in the file. +The following output directories will need made to run the simulations below: `simple_test0`, `simple_test1`, `simple_test3`, and `simple_test4`. `simple_test2` is already in the repository. -You can follow these suggestions to familiarize yourself with the model. +Simple tests - demonstrating the main cell-ECM interactions as one way (either ECM remodeling or ECM following) experiments: -1) Run this model using the default parameters. This will be produce the right hand side of the figure at the beginning of this README (Figure 5 of Reference [2]). +- `./AMIGOS-invasion config/simple_test0_straight_ECM.xml` - ECM following: random 1-D motion along vertically oriented ECM +- `./AMIGOS-invasion config/simple_test1_cell_march.xml` - ECM remodeling: realignment of randomly oriented fiber orientations (Figure 2a from [[1](#references)]) +- `./AMIGOS-invasion config/simple_test2_random_1_D_circles.xml` - ECM following: random 1-D motion along circularly oriented ECM (Figure 2b from [[1](#references)]) +- `./AMIGOS-invasion config/simple_test3_directed_circular_motion.xml` - ECM following: combining a second direction, a chemotactic gradient, with ECM following on circularly oriented ECM (Figure 2c from [[1](#references)]) +- `./AMIGOS-invasion config/simple_test4_split_ECM.xml` - ECM following: combining a second direction, a chemotactic gradient, with ECM following on split, diagnoally oriented ECM (SM Figure 3 from [[1](#references)]) -2) Change anisotropy_increase_rate to 0.001 and fiber_realignment_rate to 1. This will decrease the collective behavior - eliminating collective invasion and leaving many followers in the center of the domain. +#### _Wound headling and fibrosis model_: -3) Change discrete_ECM_remodeling to 0. Note now the ECM is instantly remodeled - generating strong, clear signals for followers to read (view the anisotropy field). This will recover behavior similar to the default parameters and produce the left side of the figure included above. +`make fibrosis` - compiles fibrosis executable -4) Change default_cell_speed to 1.0 and then 0.25 - producing stigmergy and a non-changing morphology. +- `./fibrosis config/fibrosis.xml` - simulated tissue insult is cleared by macrophages, which recruit fibroblasts that increase ECM density in the presence of macrophages, leading to hyperdense ECM that is relatively impenetrable cells surrounding a region of relatively less dense ECM where the tissue insult occurred (Figure 3 from [[1](#references)]). -5) Now, you can enjoy yourself changing other parameters and creating new responses. +Output will go to `fibrosis_test` + +#### _Basement membrane degradation and stromal invasion_: + +`make invasive_carcinoma` - compiles invasive carcinoma executable + +- `./invasive_carcinoma config/invasive_carcinoma.xml` - simulation of basement membrane degradation by tumor recruited fibroblasts, leading to invasion of stroma by previously _in situ_ tumor (Figure 4 from [[1](#references)]). + +Output will go to `invasive_carcinoma_output` + +#### _Leader-follower and collective migration model_: + +`make` - compiles the AMIGOS-invasion executable + +The following output directories will need made to run the simulations below: `adh_0_repulsion_0_speed_10_no_reading`, `adh_0_repulsion_0_speed_10_no_writing`, `adh_0_repulsion_0_speed_10`, `adh_10_replusion_25_speed_080`, `adh_10_replusion_25_speed_050`, `adh_10_replusion_25_speed_010`, and `leader_follower_decreased_remodeling`. `leader_follower` is already in the repository. + +- `./AMIGOS-invasion writing_only.xml`- No contact guidance in the follower cell population - notably lacks outward migration of fiber following cells ("followers") (Figure 5a from [[1](#references)]) +- `./AMIGOS-invasion reading_only.xml` - No production of directional cues in ECM for followers to follow - notably lacks outward migration of fiber following cells (Figure 5b from [[1](#references)]) +- `./AMIGOS-invasion writing_and_reading.xml` - Enables the two cell populations (leader and follower), with leaders producing paths in the ECM that followers follow (stigmergy) (Figure 5c from [[1](#references)]) +- `./AMIGOS-invasion leader_follower_instant_speed_080.xml` - Produces stigmery (Figure 6a from [[1](#references)]) +- `./AMIGOS-invasion leader_follower_instant_speed_050.xml` - Produces leader-follower collective migration (Figure 6b from [[1](#references)]) +- `./AMIGOS-invasion leader_follower_instant_speed_010.xml` - Produces no change in cell arrangement/pattern (Figure 6c from [[1](#references)]) +- `./AMIGOS-invasion leader_follower_model.xml` - Demonstrates leader-follower collective migration, even in the case of non-instant ECM remodeling (Figure 7b from [[1](#references)]) +- `./AMIGOS-invasion leader_follower_model_decreased_remodeling_rates.xml` - Demonstrates that leader-follower collective migration is relatively senstive to remodeling rate parameters (SM Figure 4b from [[1](#references)]) + +### Running through the Studio + +All the above models (and in general any PhysiCell model) can be run via the PhysiCell Studio ([User Guide](https://github.com/PhysiCell-Tools/Studio-Guide/blob/main/README.md) and reference [[4]](#references)). + +Briefly, to run an ECM-based model AND enable visualization of the ECM variables (anisotropy, density, and orientation), use the following pattern to start the Studio: + +`python path_to_studio_directory/studio_ecm.py -e [executable_name] -c [config/config_file_name]` + +This assumes you are invoking python in the same directory as the executable and that your config file is in `config`. Note that in the command above, we use `studio_ecm.py` NOT `studio.py`. Using `studio_ecm.py` will add built-in ECM field visualization to the Studio. However, this is not an officially supported feature of the Studio, so it may at some point be deprecated without notice. We will attempt to maintain compatiability. + +Note that the ECM-based models are modifiable in the regular version of the studio, but the ECM visualization is not. Please see the PhysiCell Studio Guide and preprint for general information and details on the Studio. + +### nanoHUB + +A cloud-based, executable version of the leader-follower model is available at [nanoHUB](https://nanohub.org/tools/physicellecm). A free login is required to access this resource. -Note that code does not need recompiled in between parameter changes; the executable will parse the changes to the xml. ## ECM Specific Outputs In addition to the standard PhysiCell outputs, our model outputs an ECM specific MATLAB file at each save time. The file is saved to the `output` folder with the form `outputxxxxxxxx_ECM.mat` where `xxxxxxxx` is the _i_ th simulation output. The MATLAB file contains one array named `ECM_Data` with each column representing a voxel (indexed using voxel id) and rows representing the x, y, and z voxel coordinates, ECM anisotropy, ECM density, and fiber orientation x, y, and z components. -This data can be visualized using the scripts in [python_imaging](python_imaging/). We provide general image production through a general template script [image_processing_script.py](python_imaging/image_processing_script.py) which accesses the *PhysiCellPlotter* class in the module *Image processing for PhysiCell* in [image_processing_for_physicell.py](python_imaging/image_processing_for_physicell.py). For image production settings optimzied for the default parameter settings, see [partial_history_multilevel_contour_still.py](python_imaging/partial_history_multilevel_contour_still.py) and [partial_history_multilevel_contour_movie.py](python_imaging/partial_history_multilevel_contour_movie.py). This script will make an overlaying composite plot of cells (leaders are blue and followers are yellow), a contour plot showing oxygen (in red) and a quiver plots showing cell movement history. +ECM anisotropy and density can also be output to non-diffusing fields through the function `copy_ECM_data_to_BioFVM` in `cell_ECM_interactions.cpp`. Currently, this is enabled by uncommenting the line `// copy_ECM_data_to_BioFVM();` in each models main file. Note that to use this feature, the model needs to have the fields `ECM_anisotropy` and `ECM_density` in the model config file (xml file) and the ECM element size has to match the diffusion voxel size. These fields can be added to any model config file through the Studio - make a new field, change the field name to match the above exactly and accept the defaults (0 for everything). Do this twice. + +## ECM visualization + +This data can be visualized using the README and scripts in [python_imaging](python_imaging/). We provide general image production through a general template script [image_processing_script.py](python_imaging/image_processing_script.py) which accesses the *PhysiCellPlotter* class in the module *Image processing for PhysiCell* in [image_processing_for_physicell.py](python_imaging/image_processing_for_physicell.py). For image production settings optimzied for the default parameter settings, see [partial_history_multilevel_contour_still.py](python_imaging/partial_history_multilevel_contour_still.py) and [partial_history_multilevel_contour_movie.py](python_imaging/partial_history_multilevel_contour_movie.py). This script will make an overlaying composite plot of cells (leaders are blue and followers are yellow), a contour plot showing oxygen (in red) and a quiver plots showing cell movement history. Note that we do our best to ensure that all code and scripts in `python_imaging` work without alteration and as expected - and please consider it to be a preliminary release that is not guanteed to work and that may change in the future. + +For rapid visualization, the Studio can be used - in either regular or ECM mode. Note that if ECM anisotropy and density are output to the standard microenvironment outputs, they can visualized with regular version of the Studio. ## Running PhysiCell simulations across a team -PhysiCell can be run in a distributed fashion across a team using DAPT: Distributed Automated Parameter Testing [5]. See the coder [here](https://github.com/BenSDuggan/DAPT) including a [detailed PhysiCell example](https://github.com/PhysiCell-Tools/DAPT-example). +PhysiCell can be run in a distributed fashion across a team using DAPT: Distributed Automated Parameter Testing [5]. See the code [here](https://github.com/BenSDuggan/DAPT) including a [detailed PhysiCell example](https://github.com/PhysiCell-Tools/DAPT-example). ## Some key makefile rules @@ -85,18 +133,35 @@ make zip-source : compresses all files required to reproduce simulation See makefile for additional rules. +## Future work + +- Remove deprecated user_parameters from all model files and code base. +- Add "Exploration of leader-follower collective migration model" into README (using previous, but currently out of date material). + - Could include several model walk throughs by video + - Could include more in depth context for the leader-follower collective migration + - Could include more on the ECM model details (again out of date material is available for updating) +- Review optimal way to include `copy_ECM_data_to_BioFVM` + - Will possibly add an XML parameter for this + - Will review possibly calling at mechanics or phenotype time step (currently being called at diffusion time step) +- Additonal future work is included in [[1](#references)] + +## Acknowledgements + +This work was funded in part by a joint (AMIGOS) JKTGF and BCRF grant. We thank Margherita Botticelli for many productive conversations on the cell-ECM interaction code. + ## References -[1] Ghaffarizadeh, A, Heiland, R, Friedman, SH, Mumenthaler, SM, and Macklin, P. PhysiCell: an Open Source Physics-Based Cell Simulator for Multicellular Systems, PLoS Comput. Biol. 14(2): e1005991, 2018. DOI: [10.1371/journal.pcbi.1005991](https://dx.doi.org/10.1371/journal.pcbi.1005991) +[1] Metzcar, J., Duggan, B.S., Fischer, B., Murphy, M., Heiland, R., Macklin, P, 2024. A simple framework for agent-based modeling with extracellular matrix. bioRxiv 2022.11.21.514608; https://doi.org/10.1101/2022.11.21.514608 + +[2] Ghaffarizadeh, A., Heiland, R., Friedman, S.H., Mumenthaler, S.M., and Macklin, P. PhysiCell: an Open Source Physics-Based Cell Simulator for Multicellular Systems, PLoS Comput. Biol. 14(2): e1005991, 2018. https://dx.doi.org/10.1371/journal.pcbi.1005991 + +[3] Johnson, J.A.I., Stein-O’Brien, G.L., Booth, M., Heiland, R., Kurtoglu, F., Bergman, D.R., Bucher, E., Deshpande, A., Forjaz, A., Getz, M., Godet, I., Lyman, M., Metzcar, J., Mitchell, J., Raddatz, A., Rocha, H., Solorzano, J., Sundus, A., Wang, Y., Gilkes, D., Kagohara, L.T., Kiemen, A.L., Thompson, E.D., Wirtz, D., Wu, P.-H., Zaidi, N., Zheng, L., Zimmerman, J.W., Jaffee, E.M., Chang, Y.H., Coussens, L.M., Gray, J.W., Heiser, L.M., Fertig, E.J., Macklin, P.. Digitize your Biology! Modeling multicellular systems through interpretable cell behavior. bioRxiv, 2023. https://doi.org/10.1101/2023.09.17.557982 -[2] Metzcar, J, Duggan, BS, Fischer, B, Murphy, M, Macklin, P. A novel model of multicellular communication through extracellular matrix microstructure. bioRxiv 2022.11.21.514608; doi: [https://doi.org/10.1101/2022.11.21.514608](https://doi.org/10.1101/2022.11.21.514608) -[3] Cheung KJ, Gabrielson E, Werb Z, Ewald AJ. Collective invasion in breast cancer requires a conserved basal epithelial program. Cell 2013; 155(7):1639-51. [10.1016/j.cell.2013.11.029](10.1016/j.cell.2013.11.029) +[4] Heiland, R., Bergman, D., Lyons, B., Cass, J., Rocha, H.L., Ruscone, M., Noël, V., Macklin, P.. PhysiCell Studio: a graphical tool to make agent-based modeling more accessible. bioRxiv, 2023 https://doi.org/10.1101/2023.10.24.563727 -[4] Nguyen-Ngoc KV\*, Cheung KJ*, Brenot A, Shamir ER, Gray RS, Hines WC, Yaswen P, Werb Z, Ewald AJ. The ECM microenvironment regulates collective migration and local dissemination in normal and malignant mammary epithelium. Proceedings of the National Academy of Science 2012; [10.1073/pnas.1212834109](10.1073/pnas.1212834109) *Co-First Authors. PMCID: PMC3465416 +[5] Duggan, B.S., Metzcar, J., and Macklin, P. DAPT: A package enabling distributed automated parameter testing. Gigabyte 2021, 1–10, 2021. https://doi.org/10.46471/gigabyte.22 -[5] Duggan, BS, Metzcar, J, and Macklin, P (2021). DAPT: A package enabling distributed automated parameter testing. Gigabyte 2021, 1–10. [10.46471/gigabyte.22](10.46471/gigabyte.22). -**Latest PhysiCell info:** follow [@PhysiCell](https://twitter.com/PhysiCell) on Twitter (http://twitter.com/PhysiCell) - +**Latest PhysiCell info:** follow [@PhysiCell](https://twitter.com/PhysiCell) on Twitter (http://twitter.com/PhysiCell) \ No newline at end of file diff --git a/config/fibrosis.xml b/config/fibrosis.xml index c6cada4..106f90f 100644 --- a/config/fibrosis.xml +++ b/config/fibrosis.xml @@ -169,8 +169,6 @@ 1.8 15.12 - 4.0 - 10.0 0.01 0.0 0.0 @@ -320,8 +318,6 @@ 1.8 15.12 - 4.0 - 10.0 0.01 0.0 0.0 @@ -471,8 +467,6 @@ 1.8 15.12 - 4.0 - 10.0 0.01 0.0 0.0 @@ -575,27 +569,27 @@ None 175 0 - 10 - 0.5 - 10.0 - 10.0 - 25.0 - 0.95 - 0.004 - 4.0 - 0.5 - 0.001 + 10 + 0.5 + 10.0 + 10.0 + 25.0 + 0.95 + 0.004 + 4.0 + 0.5 + 0.001 11 - 10.0 - 25.0 - 0.05 - 1.0 - 0.0 - 1.0 - 0.5 + 10.0 + 25.0 + 0.05 + 1.0 + 0.0 + 1.0 + 0.5 1.0 - true - true + true + true 0.1 none 45.0 diff --git a/config/invasive_carcinoma.xml b/config/invasive_carcinoma.xml index 710f180..f74aca3 100644 --- a/config/invasive_carcinoma.xml +++ b/config/invasive_carcinoma.xml @@ -169,8 +169,6 @@ 1.8 15.12 - 4.0 - 10.0 0.01 0.0 0.0 @@ -321,8 +319,6 @@ 1.8 15.12 - 4.0 - 10.0 0.01 0.0 0.0 @@ -473,8 +469,6 @@ 1.8 15.12 - 4.0 - 10.0 0.01 0.0 0.0 @@ -578,27 +572,27 @@ invasive_spheroid 250 0.0 - 10 - 0.5 - 10.0 - 10.0 - 25.0 - 0.95 - 0.004 - 4.0 - 0.5 - 0.001 + 10 + 0.5 + 10.0 + 10.0 + 25.0 + 0.95 + 0.004 + 4.0 + 0.5 + 0.001 0 - 10.0 - 25.0 - 0.05 - 1.0 - 0.0 - 1.0 - 0.5 - 1.0 - true - true + 10.0 + 25.0 + 0.05 + 1.0 + 0.0 + 1.0 + 0.5 + 1.0 + true + true 0.1 none 45.0 diff --git a/config/leader_follower_instant_speed_010.xml b/config/leader_follower_instant_speed_010.xml index 5cdb25c..a4616eb 100644 --- a/config/leader_follower_instant_speed_010.xml +++ b/config/leader_follower_instant_speed_010.xml @@ -152,8 +152,6 @@ 1.8 15.12 - 4.0 - 10.0 0.01 0.0 0.0 @@ -290,8 +288,6 @@ 1.8 15.12 - 4.0 - 10.0 0.01 0.0 0.0 @@ -382,25 +378,25 @@ lesion 175 0.05 - 10 - 0.5 - 10.0 - 10.0 - 25.0 - 0.95 - 0.004 - 4.0 - 0.5 - 10.0 - 25.0 - 0.05 - 1.0 - 0.0 - 1.0 - 0.5 + 10 + 0.5 + 10.0 + 10.0 + 25.0 + 0.95 + 0.004 + 4.0 + 0.5 + 10.0 + 25.0 + 0.05 + 1.0 + 0.0 + 1.0 + 0.5 1.0 - true - true + true + true 0.1 none 45.0 diff --git a/config/leader_follower_instant_speed_050.xml b/config/leader_follower_instant_speed_050.xml index a4eaea7..6e69d42 100644 --- a/config/leader_follower_instant_speed_050.xml +++ b/config/leader_follower_instant_speed_050.xml @@ -152,8 +152,6 @@ 1.8 15.12 - 4.0 - 10.0 0.01 0.0 0.0 @@ -290,8 +288,6 @@ 1.8 15.12 - 4.0 - 10.0 0.01 0.0 0.0 @@ -382,25 +378,25 @@ lesion 175 0.05 - 10 - 0.5 - 10.0 - 10.0 - 25.0 - 0.95 - 0.004 - 4.0 - 0.5 - 10.0 - 25.0 - 0.05 - 1.0 - 0.0 - 1.0 - 0.5 + 10 + 0.5 + 10.0 + 10.0 + 25.0 + 0.95 + 0.004 + 4.0 + 0.5 + 10.0 + 25.0 + 0.05 + 1.0 + 0.0 + 1.0 + 0.5 1.0 - true - true + true + true 0.1 none 45.0 diff --git a/config/leader_follower_instant_speed_080.xml b/config/leader_follower_instant_speed_080.xml index 1ac0169..781b8f1 100644 --- a/config/leader_follower_instant_speed_080.xml +++ b/config/leader_follower_instant_speed_080.xml @@ -23,7 +23,7 @@ - 14400 + 7200 min micron 0.01 @@ -38,11 +38,11 @@ adh_10_replusion_25_speed_080 - 30 + 6 true - 30 + 6 true oxygen @@ -152,8 +152,6 @@ 1.8 15.12 - 4.0 - 10.0 0.01 0.0 0.0 @@ -290,8 +288,6 @@ 1.8 15.12 - 4.0 - 10.0 0.01 0.0 0.0 @@ -382,25 +378,25 @@ lesion 175 0.05 - 10 - 0.5 - 10.0 - 10.0 - 25.0 - 0.95 - 0.004 - 4.0 - 0.5 - 10.0 - 25.0 - 0.05 - 1.0 - 0.0 - 1.0 - 0.5 + 10 + 0.5 + 10.0 + 10.0 + 25.0 + 0.95 + 0.004 + 4.0 + 0.5 + 10.0 + 25.0 + 0.05 + 1.0 + 0.0 + 1.0 + 0.5 1.0 - true - true + true + true 0.1 none 45.0 diff --git a/config/leader_follower_model.xml b/config/leader_follower_model.xml index f02a03f..61723de 100644 --- a/config/leader_follower_model.xml +++ b/config/leader_follower_model.xml @@ -152,8 +152,6 @@ 1.8 15.12 - 4.0 - 10.0 0.01 0.0 0.0 @@ -290,8 +288,6 @@ 1.8 15.12 - 4.0 - 10.0 0.01 0.0 0.0 @@ -382,25 +378,25 @@ lesion 175 0.05 - 10 - 0.5 - 10.0 - 10.0 - 25.0 - 0.95 - 0.004 - 4.0 - 0.5 - 10.0 - 25.0 - 0.05 - 1.0 - 0.0 - 1.0 - 0.5 - 1.0 - true - true + 10 + 0.5 + 10.0 + 10.0 + 25.0 + 0.95 + 0.004 + 4.0 + 0.5 + 10.0 + 25.0 + 0.05 + 1.0 + 0.0 + 1.0 + 0.5 + 1.0 + true + true 0.1 none 45.0 diff --git a/config/leader_follower_model_decreased_remodeling_rates.xml b/config/leader_follower_model_decreased_remodeling_rates.xml new file mode 100644 index 0000000..f3018f0 --- /dev/null +++ b/config/leader_follower_model_decreased_remodeling_rates.xml @@ -0,0 +1,419 @@ + + + + + + + + + + + + + -800 + 800 + -800 + 800 + -10 + 10 + 20 + 20 + 20 + true + + + + 14400.0 + min + micron + 0.01 + 0.1 + 6 + + + + 6 + + + + leader_follower_decreased_remodeling + + 6 + true + + + 6 + true + + oxygen + + + + + + false + + + + + false + true + true + + + + + + 100000.0 + 0.1 + + 0 + 38 + + 38 + 38 + 38 + 38 + 38 + 38 + + + + true + true + + ./config/initial.mat + + + ./config/dirichlet.mat + + + + + + + + + + 0.0 + + + + + 0.0 + + 516 + + + 0.05 + 0 + 1.66667e-02 + 5.83333e-03 + 0 + 2.0 + + + + 0.0 + + 0 + 86400 + + + 1.11667e-2 + 8.33333e-4 + 5.33333e-5 + 2.16667e-3 + 0 + 2.0 + + + + + 2494 + 0.75 + 540 + 0.05 + 0.0045 + 0.0055 + 0 + 0 + 2.0 + + + 10.0 + 25.0 + 1.25 + + 1.0 + 1.0 + + + 1.8 + 15.12 + + 0.01 + 0.0 + 0.0 + + + 0.5 + 10 + 0.95 + + true + true + + true + oxygen + 1 + + + false + false + + 0.0 + + + + + + + 0 + 38 + 10 + 0 + + + + 0.0 + + 0.0 + 0.0 + + + 0.0 + 0.0 + + 1.0 + + 0.0 + 0.0 + + + + + 0.0 + 0.0 + + + + + 0.0 + 1.0 + 0.5 + 0.5 + 0.05 + 0.0 + 38 + 0.5 + 1.0 + 0 + 0.001 + 1.0 + 1.0 + 0.0 + 1.0 + 1.0 + + + + + + + 0.0 + + + + + 0 + + 516 + + + 0.05 + 0 + 1.66667e-02 + 5.83333e-03 + 0 + 2.0 + + + + 0.0 + + 0 + 86400 + + + 1.11667e-2 + 8.33333e-4 + 5.33333e-5 + 2.16667e-3 + 0 + 2.0 + + + + + 2494 + 0.75 + 540 + 0.05 + 0.0045 + 0.0055 + 0 + 0 + 2.0 + + + 10.0 + 25.0 + 1.25 + + 1.0 + 1.0 + + + 1.8 + 15.12 + + 0.01 + 0.0 + 0.0 + + + .5 + 10 + 0.05 + + true + true + + true + oxygen + 1 + + + false + false + + 0.0 + + + + + + + 0 + 38 + 10 + 0 + + + + 0.0 + + 0.0 + 0.0 + + + 0.0 + 0.0 + + 1.0 + + 0.0 + 0.0 + + + + + 0.0 + 0.0 + + + + + 0.0 + 1.0 + 0.5 + 0.5 + 1.0 + 1.0 + 38 + 0.5 + 1.0 + 0 + 0.000 + 0.0 + 0.0 + 0.0 + 1.0 + 1.0 + + + + + + + ./config + cells.csv + + + + + 0.0 + 0.5 + lesion + 175 + 0.05 + 10 + 0.5 + 10.0 + 10.0 + 25.0 + 0.95 + 0.004 + 4.0 + 0.5 + 10.0 + 25.0 + 0.05 + 1.0 + 0.0 + 1.0 + 0.5 + 1.0 + true + true + 0.1 + none + 45.0 + random + 20 + 20 + 20 + follower chemotaxis/no follower hysteresis + 1 + 0 + ecm_update_from_cell_motility_vector + false + 10 + false + 0 + 0 + none + true + + \ No newline at end of file diff --git a/config/reading_only.xml b/config/reading_only.xml index 9a5a652..dc4fdcc 100644 --- a/config/reading_only.xml +++ b/config/reading_only.xml @@ -44,6 +44,11 @@ 6 true + + oxygen + + + false @@ -147,8 +152,6 @@ 1.8 15.12 - 4.0 - 10.0 0.01 0.0 0.0 @@ -285,8 +288,6 @@ 1.8 15.12 - 4.0 - 10.0 0.01 0.0 0.0 @@ -377,25 +378,25 @@ lesion 175 0.05 - 10 - 0.5 - 10.0 - 10.0 - 25.0 - 0.95 - 0.004 - 4.0 - 0.5 - 10.0 - 25.0 - 0.05 - 1.0 - 0.0 - 1.0 - 0.5 + 10 + 0.5 + 10.0 + 10.0 + 25.0 + 0.95 + 0.004 + 4.0 + 0.5 + 10.0 + 25.0 + 0.05 + 1.0 + 0.0 + 1.0 + 0.5 1.0 - true - true + true + true 0.1 none 45.0 diff --git a/config/simple_test1_cell_march.xml b/config/simple_test1_cell_march.xml index de5291e..a7b6571 100644 --- a/config/simple_test1_cell_march.xml +++ b/config/simple_test1_cell_march.xml @@ -44,6 +44,11 @@ 6 true + + oxygen + + + false @@ -147,8 +152,6 @@ 1.8 15.12 - 0.0 - 0.0 0.01 0.0 0.0 @@ -284,8 +287,6 @@ 1.8 15.12 - 0.0 - 0.0 0.01 0.0 0.0 @@ -394,11 +395,11 @@ true 1 100 - 25.0 - 25.0 - 10.0 - 10.0 + 25.0 + 25.0 + 10.0 + 10.0 0.95 - 0.95 + 0.95 \ No newline at end of file diff --git a/config/writing_and_reading.xml b/config/writing_and_reading.xml index 6ebe9cb..3a43a50 100644 --- a/config/writing_and_reading.xml +++ b/config/writing_and_reading.xml @@ -44,6 +44,11 @@ 6 true + + oxygen + + + false @@ -147,8 +152,6 @@ 1.8 15.12 - 4.0 - 10.0 0.01 0.0 0.0 @@ -285,8 +288,6 @@ 1.8 15.12 - 4.0 - 10.0 0.01 0.0 0.0 @@ -377,25 +378,25 @@ lesion 175 0.05 - 10 - 0.5 - 10.0 - 10.0 - 25.0 - 0.95 - 0.004 - 4.0 - 0.5 - 10.0 - 25.0 - 0.05 - 1.0 - 0.0 - 1.0 - 0.5 + 10 + 0.5 + 10.0 + 10.0 + 25.0 + 0.95 + 0.004 + 4.0 + 0.5 + 10.0 + 25.0 + 0.05 + 1.0 + 0.0 + 1.0 + 0.5 1.0 - true - true + true + true 0.1 none 45.0 diff --git a/config/writing_only.xml b/config/writing_only.xml index e4c7022..5af1093 100644 --- a/config/writing_only.xml +++ b/config/writing_only.xml @@ -44,6 +44,11 @@ 6 true + + oxygen + + + false @@ -147,8 +152,6 @@ 1.8 15.12 - 4.0 - 10.0 0.01 0.0 0.0 @@ -285,8 +288,6 @@ 1.8 15.12 - 4.0 - 10.0 0.01 0.0 0.0 @@ -377,25 +378,25 @@ lesion 175 0.05 - 10 - 0.5 - 10.0 - 10.0 - 25.0 - 0.95 - 0.004 - 4.0 - 0.5 - 10.0 - 25.0 - 0.05 - 1.0 - 0.0 - 1.0 - 0.5 + 10 + 0.5 + 10.0 + 10.0 + 25.0 + 0.95 + 0.004 + 4.0 + 0.5 + 10.0 + 25.0 + 0.05 + 1.0 + 0.0 + 1.0 + 0.5 1.0 - true - true + true + true 0.1 none 45.0 diff --git a/custom_modules/cell_ECM_interactions.cpp b/custom_modules/cell_ECM_interactions.cpp index c706293..80e90b9 100644 --- a/custom_modules/cell_ECM_interactions.cpp +++ b/custom_modules/cell_ECM_interactions.cpp @@ -8,7 +8,7 @@ extern ECM ecm; -void copy_ECM_data_to_BioFVM( Cell* pCell, Phenotype& phenotype, double dt ) +void copy_ECM_data_to_BioFVM( void ) { @@ -25,12 +25,20 @@ void copy_ECM_data_to_BioFVM( Cell* pCell, Phenotype& phenotype, double dt ) if (ECM_anisotropy_index < 0) { std::cout << " static int ECM_anisotropy_index = " <& v , const std::vector& w ); diff --git a/custom_modules/extracellular_matrix.h b/custom_modules/extracellular_matrix.h index 2e731a8..bbf4437 100644 --- a/custom_modules/extracellular_matrix.h +++ b/custom_modules/extracellular_matrix.h @@ -68,7 +68,7 @@ class ECM_options }; -void copy_ECM_data_to_BioFVM( void ); +// void copy_ECM_data_to_BioFVM( void ); // extern ECM_options default_ecm_options; // extern ECM ecm; diff --git a/leader_follower/empty.txt b/leader_follower/empty.txt new file mode 100644 index 0000000..e69de29 diff --git a/main-ecm.cpp b/main-ecm.cpp index 9a93000..a02491e 100644 --- a/main-ecm.cpp +++ b/main-ecm.cpp @@ -305,6 +305,8 @@ int main( int argc, char* argv[] ) { microenvironment.simulate_diffusion_decay( diffusion_dt ); } + + // copy_ECM_data_to_BioFVM(); // run PhysiCell ((Cell_Container *)microenvironment.agent_container)->update_all_cells( PhysiCell_globals.current_time ); diff --git a/main_fibrosis.cpp b/main_fibrosis.cpp index 8f18470..7484cc2 100755 --- a/main_fibrosis.cpp +++ b/main_fibrosis.cpp @@ -262,6 +262,8 @@ int main( int argc, char* argv[] ) // if(parameters.bools("freeze_uE_profile")==true) microenvironment.simulate_diffusion_decay( diffusion_dt ); + + // copy_ECM_data_to_BioFVM(); // run PhysiCell ((Cell_Container *)microenvironment.agent_container)->update_all_cells( PhysiCell_globals.current_time ); diff --git a/main_invasive_carcinoma.cpp b/main_invasive_carcinoma.cpp index 122d38b..564a9bf 100755 --- a/main_invasive_carcinoma.cpp +++ b/main_invasive_carcinoma.cpp @@ -258,6 +258,8 @@ int main( int argc, char* argv[] ) { microenvironment.simulate_diffusion_decay( diffusion_dt ); } + + // copy_ECM_data_to_BioFVM(); // run PhysiCell ((Cell_Container *)microenvironment.agent_container)->update_all_cells( PhysiCell_globals.current_time ); diff --git a/python_imaging/README.md b/python_imaging/README.md index a0fc19a..e784d12 100644 --- a/python_imaging/README.md +++ b/python_imaging/README.md @@ -26,3 +26,7 @@ Basic scripts. Original basis for integrated plotter in `image_processing_for_ph * `cell_track_plotter.py`: Plots still of cells and cell positional histories. * `cell_tracker_movie.py`: Generates a movie of cells and cell positional histories. * `finished-combined-plot.py`: Generates a layered plot combining cell positions and multiple aspcts of the microenvironment. + +## Future work + +Future work in python_imaging includes changes from pyMCDS based-parsing to [pcdl-based](https://github.com/PhysiCell-Tools/python-loader) data handling and reading. \ No newline at end of file diff --git a/python_imaging/image_processing_for_physicell.py b/python_imaging/image_processing_for_physicell.py index 0634682..2a9ac0d 100644 --- a/python_imaging/image_processing_for_physicell.py +++ b/python_imaging/image_processing_for_physicell.py @@ -223,9 +223,10 @@ def generic_plotter(self, starting_index: int = 0, sample_step_interval: int = 1 self.plot_figure(title_str, plot_x_extend, plot_y_extend, file_name, output_path, options) - #rwh - decreasing memory usage - del self.mcds.data - del self.mcds + #rwh - decreasing memory usage - BUT causes errors in stills if you invoke it twice in row (AttributeError: 'PhysiCellPlotter' object has no attribute 'mcds' + # in the generic plotting ojbect in for exampl - simple_test_stills_cells_and_environment_only)... hum ... #jpm + # del self.mcds.data + # del self.mcds def plot_cells_from_physicell_data(self): cell_df = self.mcds.get_cell_df() diff --git a/python_imaging/partial_history_multilevel_contour_movie_fibrosis.py b/python_imaging/partial_history_multilevel_contour_movie_fibrosis.py new file mode 100644 index 0000000..4582786 --- /dev/null +++ b/python_imaging/partial_history_multilevel_contour_movie_fibrosis.py @@ -0,0 +1,56 @@ +import sys +import matplotlib.pyplot as plt +sys.path.append(r'../python_imaging') + +from image_processing_for_physicell import * + +options_for_figure4_movie = {} + +options_for_figure4_movie = {"output_plot" : True, + "show_plot" : False, + "produce_for_panel" : False, + "plot_ECM_anisotropy" : True, + "plot_ECM_orientation" : False, + "plot_ECM_density" : True, + "retrieve_ECM_data": True, + "load_full_physicell_data" : True, + "plot_cells_from_SVG" : True, + "load_SVG_data": True, + 'plot_cells_from_physicell_data': False, + "produce_for_movie" : True, + "contour_options" : {'lowest_contour': 0.5, ### I woud like this to be cleaner - but it does work!!! + 'upper_contour': 1.0, + 'number_of_levels': 25, + 'color_map_name': 'YlOrRd', + 'color_bar': False + }, + } + +movie_options_for_figure_4 = {} + +movie_options_for_figure_4 = {'INCLUDE_ALL_SVGs': True, + 'INCLUDE_FULL_HISTORY': False + } + +#### Right now, if you don't have None or the full contour and quiver options, it will break in the plotting . + +mf = PhysiCellPlotter() + +mf.produce_movie(save_name='multi_color_movie', trail_length=6, movie_options=movie_options_for_figure_4, image_options=options_for_figure4_movie) + +# generic_plotter (start, intervnal, finish, save_filename, data_path, save_path, options) +# +# All based on options/logic- function +# load_cell_positiondata +# load_uE_data_chemical +# load_uE_data_ECM +# +# process data into plots - functions +# - cell tracks (might be loaded by just be plotted???) +# - cell positions +# - ECM layer +# - chemical layer +# +# complete plot presentaiont and save (maybe functions) +# - title +# - axes \ No newline at end of file diff --git a/python_imaging/partial_history_multilevel_contour_movie_invasive_carcinoma.py b/python_imaging/partial_history_multilevel_contour_movie_invasive_carcinoma.py new file mode 100644 index 0000000..51dad1e --- /dev/null +++ b/python_imaging/partial_history_multilevel_contour_movie_invasive_carcinoma.py @@ -0,0 +1,57 @@ +import sys +import matplotlib.pyplot as plt +sys.path.append(r'../python_imaging') + +from image_processing_for_physicell import * + +options_for_figure4_movie = {} + +options_for_figure4_movie = {"output_plot" : True, + "show_plot" : False, + "produce_for_panel" : False, + "plot_ECM_anisotropy" : True, + "plot_ECM_orientation" : True, + "plot_ECM_density" : True, + "retrieve_ECM_data": True, + "load_full_physicell_data" : True, + "plot_cells_from_SVG" : True, + "load_SVG_data": True, + 'plot_cells_from_physicell_data': False, + "produce_for_movie" : True, + "contour_options" : {'lowest_contour': 0.0, ### I woud like this to be cleaner - but it does work!!! + 'upper_contour': 1.0, + 'number_of_levels': 25, + 'color_map_name': 'YlOrRd', + 'color_bar': True, + 'alpha': 0.5 + }, + } + +movie_options_for_figure_4 = {} + +movie_options_for_figure_4 = {'INCLUDE_ALL_SVGs': True, + 'INCLUDE_FULL_HISTORY': False + } + +#### Right now, if you don't have None or the full contour and quiver options, it will break in the plotting . + +mf = PhysiCellPlotter() + +mf.produce_movie(save_name='multi_color_movie', trail_length=6, movie_options=movie_options_for_figure_4, image_options=options_for_figure4_movie) + +# generic_plotter (start, intervnal, finish, save_filename, data_path, save_path, options) +# +# All based on options/logic- function +# load_cell_positiondata +# load_uE_data_chemical +# load_uE_data_ECM +# +# process data into plots - functions +# - cell tracks (might be loaded by just be plotted???) +# - cell positions +# - ECM layer +# - chemical layer +# +# complete plot presentaiont and save (maybe functions) +# - title +# - axes \ No newline at end of file diff --git a/python_imaging/pyMCDS_ECM.py b/python_imaging/pyMCDS_ECM.py index d4733e2..a272fe2 100644 --- a/python_imaging/pyMCDS_ECM.py +++ b/python_imaging/pyMCDS_ECM.py @@ -207,7 +207,7 @@ def get_concentrations(self, species_name, z_slice=None): a plane of voxel centers in the z-axis. Returns ------- - conc_arr : array (np.float) shape=[nx_voxels, ny_voxels, nz_voxels] + conc_arr : array (float) shape=[nx_voxels, ny_voxels, nz_voxels] Contains the concentration of the specified chemical in each voxel. The array spatially maps to a meshgrid of the voxel centers. """ @@ -530,7 +530,7 @@ def get_ECM_field(self, field_name, z_slice=None): a plane of voxel centers in the z-axis. Returns ------- - conc_arr : array (np.float) shape=[nx_voxels, ny_voxels, nz_voxels] + conc_arr : array (float) shape=[nx_voxels, ny_voxels, nz_voxels] Contains the quantitity of interest at each voxel. The array spatially maps to a meshgrid of the voxel centers. """ @@ -603,15 +603,15 @@ def _read_xml(self, xml_file, output_path='.'): # while we're at it, find the mesh coord_str = mesh_node.find('x_coordinates').text delimiter = mesh_node.find('x_coordinates').get('delimiter') - x_coords = np.array(coord_str.split(delimiter), dtype=np.float) + x_coords = np.array(coord_str.split(delimiter), dtype=float) coord_str = mesh_node.find('y_coordinates').text delimiter = mesh_node.find('y_coordinates').get('delimiter') - y_coords = np.array(coord_str.split(delimiter), dtype=np.float) + y_coords = np.array(coord_str.split(delimiter), dtype=float) coord_str = mesh_node.find('z_coordinates').text delimiter = mesh_node.find('z_coordinates').get('delimiter') - z_coords = np.array(coord_str.split(delimiter), dtype=np.float) + z_coords = np.array(coord_str.split(delimiter), dtype=float) # reshape into a mesh grid xx, yy, zz = np.meshgrid(x_coords, y_coords, z_coords) @@ -766,8 +766,8 @@ def _read_xml(self, xml_file, output_path='.'): # print(self.data['ecm']['mesh']['y_coordinates']) # print(self.data['ecm']['mesh']['z_coordinates']) # if flat == False: - # # x_coords = np.array(ecm_arr[0,:], dtype=np.float) #I need something like what is in load_ecm - I wish I oculd just explore the structure ... - # # y_coords = np.array(ecm_arr[1,:], dtype=np.float) + # # x_coords = np.array(ecm_arr[0,:], dtype=float) #I need something like what is in load_ecm - I wish I oculd just explore the structure ... + # # y_coords = np.array(ecm_arr[1,:], dtype=float) # x_coords, y_coords = np.unique(ecm_arr[0,:]), np.unique(ecm_arr[1,:])#, np.unique(zz) # # ecm_arr[1,:] # print('Shape of x_coords') diff --git a/python_imaging/simple_test_stills_cells_and_environment_only.py b/python_imaging/simple_test_stills_cells_and_environment_only.py index a51967a..6c9b824 100644 --- a/python_imaging/simple_test_stills_cells_and_environment_only.py +++ b/python_imaging/simple_test_stills_cells_and_environment_only.py @@ -24,15 +24,13 @@ #### is a better/more robust way to do it (kwargs???, lots of "trapping"??) but this will be handled later ... and I can ask Randy etc ### What is up with scaling - hum ... -# oof - I got different results on the two runs when I did and didn't scale by anistoropy ... yikes! How do I manage that!! - mf = PhysiCellPlotter() mf.generic_plotter(starting_index=0, number_of_samples=1, options=options_for_figure2d, file_name='still_initial_step') -image_list_for_figure2c = [] - -image_list_for_figure2d = [150, 417] +image_list_for_figure2d = [] +image_list_for_figure2d = [int(sys.argv[1]), int(sys.argv[2])] +# image_list_for_figure2d = [150, 417] options_for_figure2d['plot_ECM_orientation'] = False options_for_figure2d['retrieve_ECM_data'] = False diff --git a/shell_scripts/make_all_executables.sh b/shell_scripts/make_all_executables.sh new file mode 100644 index 0000000..cbb8e74 --- /dev/null +++ b/shell_scripts/make_all_executables.sh @@ -0,0 +1,4 @@ +#!/bin/bash +make -j4 +make fibrosis -j4 +make invasive_spheroid -j4 diff --git a/shell_scripts/make_continous_remodeling_leader_follower_movies_and_stills.sh b/shell_scripts/make_continous_remodeling_leader_follower_movies_and_stills.sh new file mode 100644 index 0000000..819202e --- /dev/null +++ b/shell_scripts/make_continous_remodeling_leader_follower_movies_and_stills.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# Script for making leader-follower movies and stills. Assumes data is already run!!! + +# leader follower +cp python_imaging/partial_history_multilevel_contour_movie.py leader_follower/ +cp python_imaging/partial_history_multilevel_contour_still.py leader_follower/ +cd leader_follower +python partial_history_multilevel_contour_movie.py +cp multi_color_movie.mp4 ../1_images_for_paper/leader_follower.mp4 +python partial_history_multilevel_contour_still.py 480 1920 +cp multi_contour_still_480.png ../1_images_for_paper/continous_remodeling_speed_050_2880_minutes.png +cp multi_contour_still_1920.png ../1_images_for_paper/continous_remodeling_speed_050_11520_minutes.png + +cd .. +cp python_imaging/partial_history_multilevel_contour_movie.py leader_follower_decreased_remodeling/ +cp python_imaging/partial_history_multilevel_contour_still.py leader_follower_decreased_remodeling/ +cd leader_follower_decreased_remodeling +python partial_history_multilevel_contour_movie.py +cp multi_color_movie.mp4 ../1_images_for_paper/leader_follower_decreased_remodeling.mp4 +python partial_history_multilevel_contour_still.py 480 1920 +cp multi_contour_still_480.png ../1_images_for_paper/continous_remodeling_decreased_remodeling_2880_minutes.png +cp multi_contour_still_1920.png ../1_images_for_paper/continous_remodeling_decreased_remodeling_11520_minutes.png + + + + + + + + diff --git a/shell_scripts/make_fibrosis_stills_and_movie.sh b/shell_scripts/make_fibrosis_stills_and_movie.sh new file mode 100644 index 0000000..745baba --- /dev/null +++ b/shell_scripts/make_fibrosis_stills_and_movie.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# Script for making fibrosis movies and stills. Assumes data is already run!!! + +# fibrosis +cp python_imaging/partial_history_multilevel_contour_movie_fibrosis.py fibrosis_test/ +cp python_imaging/partial_history_multilevel_contour_movie_fibrosis.py fibrosis_test/ +cd fibrosis_test +# show denisty instead of anisotropy +# python partial_history_multilevel_contour_movie_fibrosis.py +# cp multi_color_movie.mp4 ../1_images_for_paper/fibrosis.mp4 + +# doing two at a time because thats how the script is set up +python partial_history_multilevel_contour_still_density.py --snapshot_IDs 0 30 60 120 240 360 --contour_range 0.5 1.0 +cp multi_contour_still_0.png ../1_images_for_paper/fibrosis_0.png +cp multi_contour_still_30.png ../1_images_for_paper/fibrosis_30.png + +# python partial_history_multilevel_contour_still_density.py 60 120 0.5 1.0 +cp multi_contour_still_60.png ../1_images_for_paper/fibrosis_60.png +cp multi_contour_still_120.png ../1_images_for_paper/fibrosis_120.png + +# python partial_history_multilevel_contour_still_density.py 240 360 0.5 1.0 +cp multi_contour_still_240.png ../1_images_for_paper/fibrosis_240.png +cp multi_contour_still_360.png ../1_images_for_paper/fibrosis_360.png + +cp just_colorbar.png ../1_images_for_paper/fibrosis_colorbar.png diff --git a/shell_scripts/make_instant_remodeling_leader_follower_movies_and_stills.sh b/shell_scripts/make_instant_remodeling_leader_follower_movies_and_stills.sh new file mode 100644 index 0000000..9cef14c --- /dev/null +++ b/shell_scripts/make_instant_remodeling_leader_follower_movies_and_stills.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# Script for making simple leader-follower movies and stills. Assumes data is already run!!! + +# 0.1 um/min Output every 120 minutes +cp python_imaging/partial_history_2_level_contour_movie.py adh_10_replusion_25_speed_010/ +cp python_imaging/partial_history_2_level_contour_still.py adh_10_replusion_25_speed_010/ +cd adh_10_replusion_25_speed_010 +python partial_history_2_level_contour_movie.py +cp two_contour_movie.mp4 ../1_images_for_paper/adh_10_replusion_25_speed_010.mp4 +python partial_history_2_level_contour_still.py 24 24 # code requires two inputs - so just putting in the same number twice (only need one) +cp two_contour_still_24.png ../1_images_for_paper/discrete_remodeling_speed_010_discrete_model_figure_2880_minutes.png + +cd .. + +# 0.5 um/min Output every 30 minutes +cp python_imaging/partial_history_2_level_contour_movie.py adh_10_replusion_25_speed_050/ +cp python_imaging/partial_history_2_level_contour_still.py adh_10_replusion_25_speed_050/ +cd adh_10_replusion_25_speed_050 +python partial_history_2_level_contour_movie.py +cp two_contour_movie.mp4 ../1_images_for_paper/adh_10_replusion_25_speed_050.mp4 +python partial_history_2_level_contour_still.py 96 384 +cp two_contour_still_96.png ../1_images_for_paper/discrete_remodeling_speed_050_discrete_model_figure_2880_minutes.png +cp two_contour_still_384.png ../1_images_for_paper/discrete_remodeling_speed_050_discrete_model_figure_11520_minutes.png + +cd .. + +# 0.8 um/min Output every 6 minutes +cp python_imaging/partial_history_2_level_contour_movie.py adh_10_replusion_25_speed_080/ +cp python_imaging/partial_history_2_level_contour_still.py adh_10_replusion_25_speed_080/ +cd adh_10_replusion_25_speed_080 +python partial_history_2_level_contour_movie.py +cp two_contour_movie.mp4 ../1_images_for_paper/adh_10_replusion_25_speed_080.mp4 +python partial_history_2_level_contour_still.py 150 150 # code requires two inputs - so just putting in the same number twice (only need one) +cp two_contour_still_150.png ../1_images_for_paper/discrete_remodeling_speed_080_discrete_model_figure_900_minutes.png + + + diff --git a/shell_scripts/make_invasive_carcinoma_stills_and_movie.sh b/shell_scripts/make_invasive_carcinoma_stills_and_movie.sh new file mode 100644 index 0000000..2e25482 --- /dev/null +++ b/shell_scripts/make_invasive_carcinoma_stills_and_movie.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Script for making invasive carcinoma movies and stills. Assumes data is already run!!! + +# fibrosis +cp python_imaging/partial_history_multilevel_contour_movie_invasive_carcinoma.py invasive_carcinoma_output/ +cp python_imaging/partial_history_multilevel_contour_still_density.py invasive_carcinoma_output/ +cd invasive_carcinoma_output +# show denisty instead of anisotropy +# python partial_history_multilevel_contour_movie_invasive_carcinoma.py +# cp multi_color_movie.mp4 ../1_images_for_paper/invasive_carcinoma.mp4 + +# doing two at a time because thats how the script is set up +python partial_history_multilevel_contour_still_density.py --snapshot_IDs 0 5 10 15 30 60 120 240 --contour_range 0.0 1.0 +cp multi_contour_still_0.png ../1_images_for_paper/invasive_carcinoma_0.png +cp multi_contour_still_5.png ../1_images_for_paper/invasive_carcinoma_5.png +cp multi_contour_still_10.png ../1_images_for_paper/invasive_carcinoma_10.png +cp multi_contour_still_15.png ../1_images_for_paper/invasive_carcinoma_15.png +cp multi_contour_still_30.png ../1_images_for_paper/invasive_carcinoma_30.png +cp multi_contour_still_60.png ../1_images_for_paper/invasive_carcinoma_60.png +cp multi_contour_still_120.png ../1_images_for_paper/invasive_carcinoma_120.png +cp multi_contour_still_240.png ../1_images_for_paper/invasive_carcinoma_240.png + +cp just_colorbar.png ../1_images_for_paper/invasive_carcinoma_colorbar.png \ No newline at end of file diff --git a/shell_scripts/make_simple_leader_follower_movies_and_stills.sh b/shell_scripts/make_simple_leader_follower_movies_and_stills.sh new file mode 100644 index 0000000..7dd92dd --- /dev/null +++ b/shell_scripts/make_simple_leader_follower_movies_and_stills.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +# Script for making simple leader-follower movies and stills. Assumes data is already run!!! + +# Writing only (no reading) +cp python_imaging/partial_history_2_level_contour_movie.py adh_0_repulsion_0_speed_10_no_reading/ +cp python_imaging/partial_history_2_level_contour_still.py adh_0_repulsion_0_speed_10_no_reading/ +cd adh_0_repulsion_0_speed_10_no_reading +python partial_history_2_level_contour_movie.py +cp two_contour_movie.mp4 ../1_images_for_paper/adh_0_repulsion_0_speed_10_no_reading.mp4 +python partial_history_2_level_contour_still.py 60 160 +cp two_contour_still_60.png ../1_images_for_paper/adh_0_repulsion_0_speed_10_no_reading_60.png +cp two_contour_still_160.png ../1_images_for_paper/adh_0_repulsion_0_speed_10_no_reading_160.png + +cd .. + +# Reading only (no writing) +cp python_imaging/partial_history_2_level_contour_movie.py adh_0_repulsion_0_speed_10_no_writing/ +cp python_imaging/partial_history_2_level_contour_still.py adh_0_repulsion_0_speed_10_no_writing/ +cd adh_0_repulsion_0_speed_10_no_writing +python partial_history_2_level_contour_movie.py +cp two_contour_movie.mp4 ../1_images_for_paper/adh_0_repulsion_0_speed_10_no_writing.mp4 +python partial_history_2_level_contour_still.py 60 160 +cp two_contour_still_60.png ../1_images_for_paper/adh_0_repulsion_0_speed_10_no_writing_60.png +cp two_contour_still_160.png ../1_images_for_paper/adh_0_repulsion_0_speed_10_no_writing_160.png + +cd .. + +# Both reading and writing +cp python_imaging/partial_history_2_level_contour_movie.py adh_0_repulsion_0_speed_10/ +cp python_imaging/partial_history_2_level_contour_still.py adh_0_repulsion_0_speed_10/ +cd adh_0_repulsion_0_speed_10 +python partial_history_2_level_contour_movie.py +cp two_contour_movie.mp4 ../1_images_for_paper/adh_0_repulsion_0_speed_10.mp4 +python partial_history_2_level_contour_still.py 60 160 +cp two_contour_still_60.png ../1_images_for_paper/adh_0_repulsion_0_speed_10_60.png +cp two_contour_still_160.png ../1_images_for_paper/adh_0_repulsion_0_speed_10_160.png + + + diff --git a/shell_scripts/make_simple_movies_and_stills.sh b/shell_scripts/make_simple_movies_and_stills.sh new file mode 100644 index 0000000..d8fec21 --- /dev/null +++ b/shell_scripts/make_simple_movies_and_stills.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +# Script for making simple test movies and images. Assumes data is already run!!! + +# Simple test 0 +cp python_imaging/simple_test_movies_cells_only.py simple_test0/ +cp python_imaging/simple_test_stills_cells_and_environment_only.py simple_test0/ +cd simple_test0 +python simple_test_movies_cells_only.py +cp simple_test_cells.mp4 ../1_images_for_paper/simple_test0_straight_ECM.mp4 +python simple_test_stills_cells_and_environment_only.py +cp still_initial_step.png ../1_images_for_paper/one_way_interactions_straight_ECM_no_cues_0.png +cp still_150.png ../1_images_for_paper/one_way_interactions_straight_ECM_no_cues_150.png +cp still_417.png ../1_images_for_paper/one_way_interactions_straight_ECM_no_cues_417.png + +# Simple test 1 +cd .. + +cp python_imaging/simple_test_march_movie.py simple_test1/ +cp python_imaging/simple_test_stills_march.py simple_test1/ +cd simple_test1 +# try making in studio: python simple_test_march_movie.py +# try making in studio: cp simple_test_cells.mp4 ../1_images_for_paper/simple_test1_march.mp4 +python simple_test_stills_march.py +cp march_90.png ../1_images_for_paper/one_way_interactions_march_90.png +cp march_500.png ../1_images_for_paper/one_way_interactions_march_500.png +cp march_1200.png ../1_images_for_paper/one_way_interactions_march_1200.png + + +# Simple test 2 +cd .. + +cp python_imaging/simple_test_movies_cells_only.py simple_test2/ +cp python_imaging/simple_test_stills_cells_and_environment_only.py simple_test2/ +cd simple_test2 +python simple_test_movies_cells_only.py +cp simple_test_cells.mp4 ../1_images_for_paper/simple_test2_random_1_D_circles.mp4 +python simple_test_stills_cells_and_environment_only.py 150 417 +cp still_initial_step.png ../1_images_for_paper/one_way_interactions_circular_ECM_no_cues_0.png +cp still_150.png ../1_images_for_paper/one_way_interactions_circular_ECM_no_cues_150.png +cp still_417.png ../1_images_for_paper/one_way_interactions_circular_ECM_no_cues_417.png + +# Simple test 3 +cd .. + +cp python_imaging/simple_test_movies_cells_only.py simple_test3/ +cp python_imaging/simple_test_stills_cells_and_environment_only.py simple_test3/ +cd simple_test3 +python simple_test_movies_cells_only.py +cp simple_test_cells.mp4 ../1_images_for_paper/simple_test3_directed_circular_motion.mp4 +python simple_test_stills_cells_and_environment_only.py 150 417 +cp still_initial_step.png ../1_images_for_paper/one_way_interactions_circular_ECM_w_chemical_cue_0.png +cp still_150.png ../1_images_for_paper/one_way_interactions_circular_ECM_w_chemical_cue_150.png +cp still_417.png ../1_images_for_paper/one_way_interactions_circular_ECM_w_chemical_cue_417.png + +# Simple test 4 +cd .. + +cp python_imaging/simple_test_movies_cells_only.py simple_test4/ +cp python_imaging/simple_test_stills_cells_and_environment_only.py simple_test4/ +cd simple_test4 +python simple_test_movies_cells_only.py +cp simple_test_cells.mp4 ../1_images_for_paper/simple_test4_split_ECM.mp4 +python simple_test_stills_cells_and_environment_only.py 60 150 +cp still_initial_step.png ../1_images_for_paper/one_way_interactions_split_ECM_w_chemical_cue_0.png +cp still_60.png ../1_images_for_paper/one_way_interactions_split_ECM_w_chemical_cue_060.png +cp still_150.png ../1_images_for_paper/one_way_interactions_split_ECM_w_chemical_cue_150.png + diff --git a/shell_scripts/make_videos_detailed_models.sh b/shell_scripts/make_videos_detailed_models.sh new file mode 100644 index 0000000..c2defcb --- /dev/null +++ b/shell_scripts/make_videos_detailed_models.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# call from PhysiCell root directory +# Leader follower + +# makes videos straigh from the SVGs + +cd leader_follower/ +ffmpeg -r 24 -f image2 -i frame%04d.png -vcodec libx264 -pix_fmt yuv420p -vf pad="width=ceil(iw/2)*2:height=ceil(ih/2)*2" -strict -2 -tune animation -crf 15 -acodec none leader_follower.mp4 +cp leader_follower.mp4 ../1_images_for_paper/leader_follower_SVG.mp4 + +# Ductal invasion +cd .. + +cd invasive_spheroid_output/ +ffmpeg -r 24 -f image2 -i frame%04d.png -vcodec libx264 -pix_fmt yuv420p -vf pad="width=ceil(iw/2)*2:height=ceil(ih/2)*2" -strict -2 -tune animation -crf 15 -acodec none invasion.mp4 +cp invasion.mp4 ../1_images_for_paper/invasion_SVG.mp4 + +# Fibrosis +cd .. + +cd fibrosis_test/ +ffmpeg -r 24 -f image2 -i frame%04d.png -vcodec libx264 -pix_fmt yuv420p -vf pad="width=ceil(iw/2)*2:height=ceil(ih/2)*2" -strict -2 -tune animation -crf 15 -acodec none fibrosis.mp4 +cp fibrosis.mp4 ../1_images_for_paper/fibrosis_SVG.mp4 + + + diff --git a/shell_scripts/run_instant_remodeling_sims.sh b/shell_scripts/run_instant_remodeling_sims.sh new file mode 100644 index 0000000..293ff47 --- /dev/null +++ b/shell_scripts/run_instant_remodeling_sims.sh @@ -0,0 +1,10 @@ +#!/bin/bash +make -j4 +./AMIGOS-invasion config/leader_follower_instant_speed_010.xml +# cp config/leader_follower_instant_speed_010.xml adh_10_replusion_25_speed_010/ + +./AMIGOS-invasion config/leader_follower_instant_speed_050.xml +# cp config/leader_follower_instant_speed_050.xml adh_10_replusion_25_speed_050/ + +./AMIGOS-invasion config/leader_follower_instant_speed_080.xml +# cp config/leader_follower_instant_speed_080.xml adh_10_replusion_25_speed_080/ \ No newline at end of file diff --git a/shell_scripts/run_simple_tests.sh b/shell_scripts/run_simple_tests.sh new file mode 100644 index 0000000..e11afb8 --- /dev/null +++ b/shell_scripts/run_simple_tests.sh @@ -0,0 +1,13 @@ +#!/bin/bash +make -j4 +./AMIGOS-invasion config/simple_test0_straight_ECM.xml +cp config/simple_test0_straight_ECM.xml simple_test0/ +./AMIGOS-invasion config/simple_test1_cell_march.xml +cp config/simple_test1_cell_march.xml simple_test1/ +./AMIGOS-invasion config/simple_test2_random_1_D_circles.xml +cp config/simple_test2_random_1_D_circles.xml simple_test2/ +./AMIGOS-invasion config/simple_test3_directed_circular_motion.xml +cp config/simple_test3_directed_circular_motion.xml simple_test3/ +./AMIGOS-invasion config/simple_test4_split_ECM.xml +cp config/simple_test4_split_ECM.xml simple_test4/ + diff --git a/shell_scripts/run_writing_reading_sims.sh b/shell_scripts/run_writing_reading_sims.sh new file mode 100644 index 0000000..1530758 --- /dev/null +++ b/shell_scripts/run_writing_reading_sims.sh @@ -0,0 +1,11 @@ +#!/bin/bash +make -j4 +./AMIGOS-invasion config/writing_only.xml +cp config/writing_only.xml adh_0_repulsion_0_speed_10_no_reading/ + +./AMIGOS-invasion config/reading_only.xml +cp config/reading_only.xml adh_0_repulsion_0_speed_10_no_writing/ + +./AMIGOS-invasion config/writing_and_reading.xml +cp config/writing_and_reading.xml adh_0_repulsion_0_speed_10/ +