Setting initial behaviors from config-defined distributions #203
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A common feature implemented in PhysiCell models is initializing cells within a given cell type with heterogeneity across one or more variables. Currently, users can either set this up in
custom.cpp
--not preferable as it requires C++ knowledge--or by adding columns tocells.csv
and labeled according to the behavior name (or volume). This latter option, to my knowledge, is not well-known or documented1. It also requires users to use another language to generate the values and to tie the values only to cells read in from a CSV and not any cells placed by other means.I propose we allow for a new element as a child of
cell_definition
calledinitial_parameter_distributions
. Here is a template of what I am currently experimenting with:At the end of
setup_tissue
, these parameter distributions will be used to initialize cell behavior, limited in the exact same way asload_cells_csv_v2
, i.e., volume and any behavior. Choosing this spot in the code could cause values specified incells.csv
to be overwritten if the behavior is present in both.I currently have the following distributions implemented: Uniform, LogUniform2, Normal, LogNormal, and Log10Normal. Log10Normal is defined by$X\sim 10^{\mu+\sigma Z},\ Z\sim\mathcal{N}(0,1)$ 3. Adding a new distribution requires adding it to a long if-else if-... block and appending the name to a list of
supported_distributions
.Other details
See the template project after custom_data for how this can be implemented. Note: those are disabled to not change the base behavior of the template project.
See the end of
setup_tissue()
in the template project for where to insert into your own project.Checks are performed to ensure coherence (lower bounds <= upper bounds) and to make sure that truncated normals warn the user about how long they will take for draws.
Footnotes
I don't recall learning it at workshops. I learned about it when looking into adding this functionality myself. ↩
https://en.wikipedia.org/wiki/Reciprocal_distribution ↩
Users will likely find powers of 10 easier to interpret than powers of e. ↩