MathCancer / PhysiCell

PhysiCell: Scientist end users should use latest release! Developers please fork the development branch and submit PRs to the dev branch. Thanks!
http://PhysiCell.org
133 stars 91 forks source link

Cell definitions share fixed_duration boolean for apoptosis death model #199

Open drbergman opened 1 year ago

drbergman commented 1 year ago

To see this, make the template project and place the attached xml into the config folder. Run the simulation. Output should roughly match the attached video.

Expected behavior: All cells immediately begin apoptosis (apoptosis death rate is set to 100). random_duration cells have a variable time until they are removed. fixed_duration cells all disappear at 2 hours. Both cells have the phase duration set to 2 hours.

Observed behavior: All cells are removed at 2 hours, including the random_duration cells.

Possible cause: PhysiCell_cell.cpp reads in the cell definitions, overwriting the fixed duration field of the apoptosis CycleModel with each one. Unclear how only this field seems to be overwritten and not the apoptosis rates.

Archive.zip

drbergman commented 1 year ago

If you flip the ordering of the cell definitions within the xml, then the reverse happens: all cells undergo random time to finish apoptosis.

rheiland commented 1 year ago

The .xml config file you provided is malformed and will cause PhysiCell to output warnings which may confuse the debugging process. It has nothing to do with the actual issue though. Specifically, the .xml specifies a non-existent "default" cell type in various blocks, e.g., <cell_interactions>. I think the attached .xml is correct. Still looking at the issue... fixed.zip

drbergman commented 1 year ago

Weird…sorry about that!On Aug 7, 2023, at 7:36 AM, Randy Heiland @.***> wrote: The .xml config file you provided is malformed and will cause PhysiCell to output warnings which may confuse the debugging process. It has nothing to do with the actual issue though. Specifically, the .xml specifies a non-existent "default" cell type in various blocks, e.g., . I think the attached .xml is correct. Still looking at the issue... fixed.zip

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

rheiland commented 1 year ago

Spent several hours looking into this. Just want to make some brief comments here for now. May need to get Paul's input for a well thought out solution, but welcome input from others. This issue involves both the apoptosis and necrosis death models. And so far, I've only tested the case where <phase_durations> are provided for those models (not phase_transition_rates). When there is more than one cell_definition defined, each one will have its apoptosis and necrosis:

The reason for this is due to fact that, for each pointer pCD to a new cell_definition, pCD->phenotype.death.models[death_index] points to the same address. Similarly for the reference address &(pCD->phenotype.death.models[death_index]->phase_links[start][0].fixed_duration). Therefore, as we parse the .xml and generate values in data structures for the apoptosis and necrosis death models, these values are overwritten with each new cell_definition.

MathCancer commented 3 months ago

we shoudl migrate teh "fixed duration" booleans from the graph strucure to the param strucxture fore each cycle model.