From 3b4893ef5a938d4fb5edb17a6d580a1c8ecab515 Mon Sep 17 00:00:00 2001 From: Paul Macklin Date: Mon, 14 Oct 2024 18:04:51 -0400 Subject: [PATCH 1/8] Update BioFVM_basic_agent.cpp In response to Issue #307, cells by default ingest 100% of internalized substrates when eating another cell. --- BioFVM/BioFVM_basic_agent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BioFVM/BioFVM_basic_agent.cpp b/BioFVM/BioFVM_basic_agent.cpp index 559eec65b..03c70d089 100644 --- a/BioFVM/BioFVM_basic_agent.cpp +++ b/BioFVM/BioFVM_basic_agent.cpp @@ -84,7 +84,7 @@ Basic_Agent::Basic_Agent() internalized_substrates = new std::vector(0); // fraction_released_at_death = new std::vector(0); - fraction_transferred_when_ingested = new std::vector(0); + fraction_transferred_when_ingested = new std::vector(1.0); register_microenvironment( get_default_microenvironment() ); // these are done in register_microenvironment @@ -196,7 +196,7 @@ void Basic_Agent::register_microenvironment( Microenvironment* microenvironment_ total_extracellular_substrate_change.resize( microenvironment->density_vector(0).size() , 1.0 ); fraction_released_at_death->resize( microenvironment->density_vector(0).size() , 0.0 ); - fraction_transferred_when_ingested->resize( microenvironment->density_vector(0).size() , 0.0 ); + fraction_transferred_when_ingested->resize( microenvironment->density_vector(0).size() , 1.0 ); return; } From 8fc1793b60e06956618c50c82a9249297e067f18 Mon Sep 17 00:00:00 2001 From: Paul Macklin Date: Mon, 14 Oct 2024 18:06:42 -0400 Subject: [PATCH 2/8] Update PhysiCell_cell.cpp In response to Issue #307, cells by default ingest 100% of conserved custom variables when eating another cell. --- core/PhysiCell_cell.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/core/PhysiCell_cell.cpp b/core/PhysiCell_cell.cpp index 5ec235bfd..2c6ef9367 100644 --- a/core/PhysiCell_cell.cpp +++ b/core/PhysiCell_cell.cpp @@ -1405,6 +1405,26 @@ void Cell::ingest_cell( Cell* pCell_to_eat ) *internalized_substrates += *(pCell_to_eat->internalized_substrates); static int n_substrates = internalized_substrates->size(); pCell_to_eat->internalized_substrates->assign( n_substrates , 0.0 ); + + // conserved quantitites in custom data aer divided in half + // so that each daughter cell gets half of the original ; + for( int nn = 0 ; nn < custom_data.variables.size() ; nn++ ) + { + if( custom_data.variables[nn].conserved_quantity == true ) + { + custom_data.variables[nn].value += + pCell_to_eat->custom_data.variables[nn].value; + } + } + for( int nn = 0 ; nn < custom_data.vector_variables.size() ; nn++ ) + { + if( custom_data.vector_variables[nn].conserved_quantity == true ) + { + custom_data.vector_variables[nn].value += + pCell_to_eat->custom_data.vector_variables[nn].value; + } + } + // trigger removal from the simulation // pCell_to_eat->die(); // I don't think this is safe if it's in an OpenMP loop From 28a69697f822dc1382dc0ed1bcc9ffb6bf183973 Mon Sep 17 00:00:00 2001 From: Paul Macklin Date: Mon, 14 Oct 2024 18:07:22 -0400 Subject: [PATCH 3/8] Update PhysiCell_cell.cpp --- core/PhysiCell_cell.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/core/PhysiCell_cell.cpp b/core/PhysiCell_cell.cpp index 2c6ef9367..5f177ed0d 100644 --- a/core/PhysiCell_cell.cpp +++ b/core/PhysiCell_cell.cpp @@ -1424,7 +1424,6 @@ void Cell::ingest_cell( Cell* pCell_to_eat ) pCell_to_eat->custom_data.vector_variables[nn].value; } } - // trigger removal from the simulation // pCell_to_eat->die(); // I don't think this is safe if it's in an OpenMP loop From bf153297add92c17213f4059213f929a0ccf7605 Mon Sep 17 00:00:00 2001 From: Paul Macklin Date: Mon, 14 Oct 2024 18:09:42 -0400 Subject: [PATCH 4/8] Update VERSION.txt update version number to 1.14.1-development --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index cd99d386a..650e8c926 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -1.14.0 \ No newline at end of file +1.14.1-development \ No newline at end of file From a3fde730f5b5e14ffe806e569903ac44de858c24 Mon Sep 17 00:00:00 2001 From: Paul Macklin Date: Mon, 14 Oct 2024 18:34:28 -0400 Subject: [PATCH 5/8] more on conservation during phagocytosis In response to Issue #307, cells by default ingest 100% of internalized substrates when eating another cell. (Note that the values for std::vector fraction_tranferred_when_ingested in Basic_Agent is *overwritten* by constructors in the cell Phenotype, so we have ot do it there.) --- core/PhysiCell_cell.cpp | 4 +++- core/PhysiCell_phenotype.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/PhysiCell_cell.cpp b/core/PhysiCell_cell.cpp index 5f177ed0d..df261623d 100644 --- a/core/PhysiCell_cell.cpp +++ b/core/PhysiCell_cell.cpp @@ -1399,9 +1399,10 @@ void Cell::ingest_cell( Cell* pCell_to_eat ) // absorb the internalized substrates // multiply by the fraction that is supposed to be ingested (for each substrate) + *(pCell_to_eat->internalized_substrates) *= *(pCell_to_eat->fraction_transferred_when_ingested); // - + *internalized_substrates += *(pCell_to_eat->internalized_substrates); static int n_substrates = internalized_substrates->size(); pCell_to_eat->internalized_substrates->assign( n_substrates , 0.0 ); @@ -1410,6 +1411,7 @@ void Cell::ingest_cell( Cell* pCell_to_eat ) // so that each daughter cell gets half of the original ; for( int nn = 0 ; nn < custom_data.variables.size() ; nn++ ) { + custom_data.variables[nn].conserved_quantity = true; if( custom_data.variables[nn].conserved_quantity == true ) { custom_data.variables[nn].value += diff --git a/core/PhysiCell_phenotype.cpp b/core/PhysiCell_phenotype.cpp index a19d4d4cc..a98559b7a 100644 --- a/core/PhysiCell_phenotype.cpp +++ b/core/PhysiCell_phenotype.cpp @@ -1049,7 +1049,7 @@ void Molecular::sync_to_current_microenvironment( void ) { internalized_total_substrates.resize( 0 , 0.0 ); fraction_released_at_death.resize( 0 , 0.0 ); - fraction_transferred_when_ingested.resize( 0, 0.0 ); + fraction_transferred_when_ingested.resize( 0, 1.0 ); } return; } @@ -1062,7 +1062,7 @@ void Molecular::sync_to_microenvironment( Microenvironment* pNew_Microenvironmen internalized_total_substrates.resize( number_of_densities , 0.0 ); fraction_released_at_death.resize( number_of_densities , 0.0 ); - fraction_transferred_when_ingested.resize( number_of_densities , 0.0 ); + fraction_transferred_when_ingested.resize( number_of_densities , 1.0 ); return; } From 502cc79bd3c3d0ccd0a309ef56ed4f4ffd13cba0 Mon Sep 17 00:00:00 2001 From: Paul Macklin Date: Tue, 15 Oct 2024 09:08:17 -0400 Subject: [PATCH 6/8] Update PhysiCell_cell.cpp remove testing line that set all custom variables to `conserved = true` that was mistakenly left in. Thanks, Daniel! --- core/PhysiCell_cell.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/core/PhysiCell_cell.cpp b/core/PhysiCell_cell.cpp index df261623d..eeb52c05b 100644 --- a/core/PhysiCell_cell.cpp +++ b/core/PhysiCell_cell.cpp @@ -1411,7 +1411,6 @@ void Cell::ingest_cell( Cell* pCell_to_eat ) // so that each daughter cell gets half of the original ; for( int nn = 0 ; nn < custom_data.variables.size() ; nn++ ) { - custom_data.variables[nn].conserved_quantity = true; if( custom_data.variables[nn].conserved_quantity == true ) { custom_data.variables[nn].value += From bc18ac59b152e0c1f54b898f55ab490fb40288c1 Mon Sep 17 00:00:00 2001 From: Heber Lima da Rocha Date: Tue, 15 Oct 2024 10:36:24 -0400 Subject: [PATCH 7/8] Update PhysiCell_cell.cpp fixed the comment --- core/PhysiCell_cell.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/PhysiCell_cell.cpp b/core/PhysiCell_cell.cpp index eeb52c05b..cf4451bde 100644 --- a/core/PhysiCell_cell.cpp +++ b/core/PhysiCell_cell.cpp @@ -630,8 +630,8 @@ Cell* Cell::divide( ) } update_voxel_in_container(); - phenotype.volume.divide(); - child->phenotype.volume.divide(); + phenotype.volume.(); + child->phenotype.volume.(); child->set_total_volume(child->phenotype.volume.total); set_total_volume(phenotype.volume.total); @@ -1407,8 +1407,8 @@ void Cell::ingest_cell( Cell* pCell_to_eat ) static int n_substrates = internalized_substrates->size(); pCell_to_eat->internalized_substrates->assign( n_substrates , 0.0 ); - // conserved quantitites in custom data aer divided in half - // so that each daughter cell gets half of the original ; + // conserved quantitites in custom data during phagocytosis + // so that phagocyte cell absorbs the full amount from the engulfed cell; for( int nn = 0 ; nn < custom_data.variables.size() ; nn++ ) { if( custom_data.variables[nn].conserved_quantity == true ) From 33e78d9344cf7e260f701547e1ead42a3dd7735a Mon Sep 17 00:00:00 2001 From: Heber Lima da Rocha Date: Tue, 15 Oct 2024 10:41:47 -0400 Subject: [PATCH 8/8] Update PhysiCell_cell.cpp --- core/PhysiCell_cell.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/PhysiCell_cell.cpp b/core/PhysiCell_cell.cpp index cf4451bde..19da0a01d 100644 --- a/core/PhysiCell_cell.cpp +++ b/core/PhysiCell_cell.cpp @@ -630,8 +630,8 @@ Cell* Cell::divide( ) } update_voxel_in_container(); - phenotype.volume.(); - child->phenotype.volume.(); + phenotype.volume.divide(); + child->phenotype.volume.divide(); child->set_total_volume(child->phenotype.volume.total); set_total_volume(phenotype.volume.total);