Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apply rules BEFORE checking for transformation #292

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

drbergman
Copy link
Collaborator

Everything else (in phenotype updates) is after applying the rules. with it ordered previously (transform then apply rules), it is possible for cells at the beginning of a sim to transform before the rule inhibiting it is applied.

Everything else (in phenotype updates) is after applying the rules.
with it ordered previously (transform then apply rules), it is possible for cells
at the beginning of a sim to transform before the rule inhibiting it is applied.
@drbergman
Copy link
Collaborator Author

can wait until after v1.14.0

@drbergman drbergman marked this pull request as draft September 7, 2024 05:22
@drbergman
Copy link
Collaborator Author

Example demonstrating need:

content cells begin in a well-oxygenated environment. A rule says that low oxygen increases their transformation rate to migratory, a migratory phenotype, defined by a different cell type to reflect that this change is not transient. The rule is therefore:

content,oxygen,decreases,transform to migratory,0,5,4,0

and acts on a baseline transformation rate of 0.1 content->migratory.

current version result

The current version of PhysiCell does the 0.1 transformation rate before applying the rules, including in the first iteration. Thus, some of these cells (about 0.1 * 6 = 60%) transform in this first time step as seen here:
imageimageimage

post-merge result

Now, we will first apply the rulesets within the phenotype update before transformations. Any call to convert_to_cell_definition will apply the rules to the cell after it has assumed its new type. Now we see the expected result that all cells remain content at the start of the simulation:
imageimageimage

@drbergman drbergman marked this pull request as ready for review October 1, 2024 13:03
@drbergman
Copy link
Collaborator Author

drbergman commented Nov 26, 2024

a similar argument applies to when we compute the gradient vectors. those are calculated first only after the first application of the rules. In this case, the gradient calculation should happen before the rules are applied to avoid this kind of behavior.

@MathCancer MathCancer deleted the branch MathCancer:development December 13, 2024 23:02
@MathCancer MathCancer closed this Dec 13, 2024
@heberlr heberlr reopened this Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants