From 07b268582c6a5b3277d905c92672e3d884039978 Mon Sep 17 00:00:00 2001 From: Paul Macklin Date: Tue, 3 May 2022 18:39:11 -0400 Subject: [PATCH 01/10] asdf --- core/PhysiCell_signal_behavior.cpp | 41 ++++++++++++++++-------------- core/PhysiCell_signal_behavior.h | 3 +++ 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/core/PhysiCell_signal_behavior.cpp b/core/PhysiCell_signal_behavior.cpp index 05de056b7..78bc73ce3 100644 --- a/core/PhysiCell_signal_behavior.cpp +++ b/core/PhysiCell_signal_behavior.cpp @@ -277,7 +277,6 @@ void setup_signal_behavior_dictionaries( void ) behavior_to_int[ map_name ] = map_index; int_to_behavior[map_index] = map_name; - // chemotactic sensitivities for( int i=0; i < m ; i++ ) { @@ -301,7 +300,6 @@ void setup_signal_behavior_dictionaries( void ) behavior_to_int[ map_name ] = map_index; int_to_behavior[map_index] = map_name; - // cell adhesion affinities // cell-type specific adhesion for( int i=0; i < n ; i++ ) @@ -429,18 +427,20 @@ double& signal_scale( std::string signal_name ) double& signal_scale( int signal_index ) { return signal_scales[signal_index]; } - -void display_signal_dictionary( void ) +void display_signal_dictionary( std::ostream& os ) { - std::cout << "Signals: " << std::endl + os << "Signals: " << std::endl << "=======" << std::endl; for( int i=0; i < int_to_signal.size() ; i++ ) - { std::cout << i << " : " << int_to_signal[i] << std::endl; } - std::cout << std::endl << std::endl; - + { os << i << " : " << int_to_signal[i] << std::endl; } + os << std::endl; return; } +void display_signal_dictionary( void ) +{ display_signal_dictionary( std::cout); std::cout << std::endl; } + + void display_signal_dictionary_with_synonyms( void ) { std::cout << "Signals (with synonyms): " << std::endl @@ -451,17 +451,23 @@ void display_signal_dictionary_with_synonyms( void ) return; } -void display_behavior_dictionary( void ) +void display_behavior_dictionary( std::ostream& os ) { - std::cout << "Behaviors: " << std::endl - << "=========" << std::endl; + os << "Behaviors: " << std::endl + << "=========" << std::endl; for( int i=0; i < int_to_behavior.size() ; i++ ) - { std::cout << i << " : " << int_to_behavior[i] << std::endl; } - std::cout << std::endl; - + { os << i << " : " << int_to_behavior[i] << std::endl; } + os << std::endl; return; } +void display_behavior_dictionary( void ) +{ + display_behavior_dictionary( std::cout ); + std::cout << std::endl; + return; +} + void display_response_dictionary_with_synonyms( void ) { std::cout << "Behaviors (with synonyms): " << std::endl @@ -493,8 +499,7 @@ std::vector find_signal_indices( std::vector signal_names ) std::string signal_name( int i ) { if( i >= 0 && i < int_to_signal.size() ) - { return int_to_signal[i]; } - + { return int_to_signal[i]; } return "not found"; } @@ -518,6 +523,7 @@ std::vector find_behavior_indices( std::vector behavior_names return output; } +// start here // create a full signal vector std::vector construct_signals( Cell* pCell ) @@ -1780,7 +1786,4 @@ std::vector get_base_behaviors( Cell* pCell , std::vector n return parameters; } - - }; - diff --git a/core/PhysiCell_signal_behavior.h b/core/PhysiCell_signal_behavior.h index 60284d183..727391ff3 100644 --- a/core/PhysiCell_signal_behavior.h +++ b/core/PhysiCell_signal_behavior.h @@ -90,6 +90,9 @@ void setup_signal_behavior_dictionaries( void ); // done void display_signal_dictionary( void ); // done void display_behavior_dictionary( void ); // done +void display_signal_dictionary( std::ostream& os ); // done +void display_behavior_dictionary( std::ostream& os ); // done + void display_signal_dictionary_with_synonyms( void ); // done void display_behavior_dictionary_with_synonyms( void ); // done From e5d87d668d008344ddccd3ac9cd65b96d144ce3a Mon Sep 17 00:00:00 2001 From: Paul Macklin Date: Wed, 4 May 2022 08:07:15 -0400 Subject: [PATCH 02/10] hardening --- ALL_CITATIONS.txt | 4 + Makefile | 212 +++-------------------- blah.xml | 5 +- config/PhysiCell_settings.xml | 231 +++++++------------------ config/cells.csv | 1 + core/PhysiCell_signal_behavior.cpp | 63 ++++--- core/PhysiCell_signal_behavior.h | 6 - custom_modules/custom.cpp | 204 +++++++++++++++++++++++ custom_modules/custom.h | 92 ++++++++++ main-backup.cpp | 0 main.cpp | 259 +++++++++++++++++++++++++++++ 11 files changed, 685 insertions(+), 392 deletions(-) create mode 100644 ALL_CITATIONS.txt create mode 100644 config/cells.csv create mode 100644 custom_modules/custom.cpp create mode 100644 custom_modules/custom.h create mode 100644 main-backup.cpp create mode 100644 main.cpp diff --git a/ALL_CITATIONS.txt b/ALL_CITATIONS.txt new file mode 100644 index 000000000..c99935e8c --- /dev/null +++ b/ALL_CITATIONS.txt @@ -0,0 +1,4 @@ +Using PhysiCell version 1.10.0-beta + Please cite DOI: 10.1371/journal.pcbi.1005991 + Project website: http://PhysiCell.MathCancer.org + diff --git a/Makefile b/Makefile index 85a64d9cc..9c4539c6a 100644 --- a/Makefile +++ b/Makefile @@ -14,8 +14,17 @@ endif ARCH := native # best auto-tuning # ARCH := core2 # a reasonably safe default for most CPUs since 2007 # ARCH := corei7 +# ARCH := corei7-avx # earlier i7 # ARCH := core-avx-i # i7 ivy bridge or newer # ARCH := core-avx2 # i7 with Haswell or newer +# ARCH := nehalem +# ARCH := westmere +# ARCH := sandybridge # circa 2011 +# ARCH := ivybridge # circa 2012 +# ARCH := haswell # circa 2013 +# ARCH := broadwell # circa 2014 +# ARCH := skylake # circa 2015 +# ARCH := bonnell # ARCH := silvermont # ARCH := skylake-avx512 # ARCH := nocona #64-bit pentium 4 or later @@ -49,194 +58,24 @@ PhysiCell_pugixml.o PhysiCell_settings.o PhysiCell_geometry.o # put your custom objects here (they should be in the custom_modules directory) -PhysiCell_custom_module_OBJECTS := .o +PhysiCell_custom_module_OBJECTS := custom.o pugixml_OBJECTS := pugixml.o PhysiCell_OBJECTS := $(BioFVM_OBJECTS) $(pugixml_OBJECTS) $(PhysiCell_core_OBJECTS) $(PhysiCell_module_OBJECTS) ALL_OBJECTS := $(PhysiCell_OBJECTS) $(PhysiCell_custom_module_OBJECTS) -EXAMPLES := ./examples/PhysiCell_test_mechanics_1.cpp ./examples/PhysiCell_test_mechanics_2.cpp \ - ./examples/PhysiCell_test_DCIS.cpp ./examples/PhysiCell_test_HDS.cpp \ - ./examples/PhysiCell_test_cell_cycle.cpp ./examples/PhysiCell_test_volume.cpp +# compile the project -all: - make heterogeneity-sample - make +all: main.cpp $(ALL_OBJECTS) + $(COMPILE_COMMAND) -o $(PROGRAM_NAME) $(ALL_OBJECTS) main.cpp + make name name: @echo "" @echo "Executable name is" $(PROGRAM_NAME) @echo "" -# sample projects -list-projects: - @echo "Sample projects: template biorobots-sample cancer-biorobots-sample cancer-immune-sample" - @echo " celltypes3-sample heterogeneity-sample pred-prey-farmer virus-macrophage-sample" - @echo " worm-sample interaction-sample" - @echo "" - @echo "Sample intracellular projects: ode-energy-sample physiboss-cell-lines-sample cancer-metabolism-sample" - @echo "" - -template: - cp ./sample_projects/template/custom_modules/* ./custom_modules/ - touch main.cpp && cp main.cpp main-backup.cpp - cp ./sample_projects/template/main.cpp ./main.cpp - cp Makefile Makefile-backup - cp ./sample_projects/template/Makefile . - cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml - cp ./sample_projects/template/config/* ./config/ - -# sample projects - -# ---- non-intracellular projects -biorobots-sample: - cp ./sample_projects/biorobots/custom_modules/* ./custom_modules/ - touch main.cpp && cp main.cpp main-backup.cpp - cp ./sample_projects/biorobots/main-biorobots.cpp ./main.cpp - cp Makefile Makefile-backup - cp ./sample_projects/biorobots/Makefile . - cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml - cp ./sample_projects/biorobots/config/* ./config/ - -cancer-biorobots-sample: - cp ./sample_projects/cancer_biorobots/custom_modules/* ./custom_modules/ - touch main.cpp && cp main.cpp main-backup.cpp - cp ./sample_projects/cancer_biorobots/main-cancer_biorobots.cpp ./main.cpp - cp Makefile Makefile-backup - cp ./sample_projects/cancer_biorobots/Makefile . - cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml - cp ./sample_projects/cancer_biorobots/config/* ./config/ - -cancer-immune-sample: - cp ./sample_projects/cancer_immune/custom_modules/* ./custom_modules/ - touch main.cpp && cp main.cpp main-backup.cpp - cp ./sample_projects/cancer_immune/main-cancer_immune_3D.cpp ./main.cpp - cp Makefile Makefile-backup - cp ./sample_projects/cancer_immune/Makefile . - cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml - cp ./sample_projects/cancer_immune/config/* ./config/ - -celltypes3-sample: - cp ./sample_projects/celltypes3/custom_modules/* ./custom_modules/ - touch main.cpp && cp main.cpp main-backup.cpp - cp ./sample_projects/celltypes3/main.cpp ./main.cpp - cp Makefile Makefile-backup - cp ./sample_projects/celltypes3/Makefile . - cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml - cp ./sample_projects/celltypes3/config/* ./config/ - -heterogeneity-sample: - cp ./sample_projects/heterogeneity/custom_modules/* ./custom_modules/ - touch main.cpp && cp main.cpp main-backup.cpp - cp ./sample_projects/heterogeneity/main-heterogeneity.cpp ./main.cpp - cp Makefile Makefile-backup - cp ./sample_projects/heterogeneity/Makefile . - cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml - cp ./sample_projects/heterogeneity/config/* ./config/ - -pred-prey-farmer: - cp ./sample_projects/pred_prey_farmer/custom_modules/* ./custom_modules/ - touch main.cpp && cp main.cpp main-backup.cpp - cp ./sample_projects/pred_prey_farmer/main.cpp ./main.cpp - cp Makefile Makefile-backup - cp ./sample_projects/pred_prey_farmer/Makefile . - cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml - cp ./sample_projects/pred_prey_farmer/config/* ./config/ - -virus-macrophage-sample: - cp ./sample_projects/virus_macrophage/custom_modules/* ./custom_modules/ - touch main.cpp && cp main.cpp main-backup.cpp - cp ./sample_projects/virus_macrophage/main.cpp ./main.cpp - cp Makefile Makefile-backup - cp ./sample_projects/virus_macrophage/Makefile . - cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml - cp ./sample_projects/virus_macrophage/config/* ./config/ - -worm-sample: - cp ./sample_projects/worm/custom_modules/* ./custom_modules/ - touch main.cpp && cp main.cpp main-backup.cpp - cp ./sample_projects/worm/main.cpp ./main.cpp - cp Makefile Makefile-backup - cp ./sample_projects/worm/Makefile . - cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml - cp ./sample_projects/worm/config/* ./config/ - -interaction-sample: - cp ./sample_projects/interactions/custom_modules/* ./custom_modules/ - touch main.cpp && cp main.cpp main-backup.cpp - cp ./sample_projects/interactions/main.cpp ./main.cpp - cp Makefile Makefile-backup - cp ./sample_projects/interactions/Makefile . - cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml - cp ./sample_projects/interactions/config/* ./config/ - -# ---- intracellular projects -ode-energy-sample: - cp ./sample_projects_intracellular/ode/ode_energy/custom_modules/* ./custom_modules/ - touch main.cpp && cp main.cpp main-backup.cpp - cp ./sample_projects_intracellular/ode/ode_energy/main.cpp ./main.cpp - cp Makefile Makefile-backup - cp ./sample_projects_intracellular/ode/ode_energy/Makefile . - cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml - cp ./sample_projects_intracellular/ode/ode_energy/config/* ./config/ - -physiboss-cell-lines-sample: - cp ./sample_projects_intracellular/boolean/physiboss_cell_lines/custom_modules/* ./custom_modules/ - touch main.cpp && cp main.cpp main-backup.cpp - cp ./sample_projects_intracellular/boolean/physiboss_cell_lines/main.cpp ./main.cpp - cp Makefile Makefile-backup - cp ./sample_projects_intracellular/boolean/physiboss_cell_lines/Makefile . - cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml - cp ./sample_projects_intracellular/boolean/physiboss_cell_lines/config/* ./config/ - -ecoli-acetic-switch-sample: - cp ./sample_projects_intracellular/fba/ecoli_acetic_switch/custom_modules/* ./custom_modules/ - touch main.cpp && cp main.cpp main-backup.cpp - cp ./sample_projects_intracellular/fba/ecoli_acetic_switch/main_ecoli_acetic_switch.cpp ./main.cpp - cp Makefile Makefile-backup - cp ./sample_projects_intracellular/fba/ecoli_acetic_switch/Makefile ./ - cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml - cp ./sample_projects_intracellular/fba/ecoli_acetic_switch/config/* ./config/ - -cancer-metabolism-sample: - cp ./sample_projects_intracellular/fba/cancer_metabolism/custom_modules/* ./custom_modules/ - touch main.cpp && cp main.cpp main-backup.cpp - cp ./sample_projects_intracellular/fba/cancer_metabolism/main.cpp ./main.cpp - cp Makefile Makefile-backup - cp ./sample_projects_intracellular/fba/cancer_metabolism/Makefile ./ - cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml - cp ./sample_projects_intracellular/fba/cancer_metabolism/config/* ./config/ - - -# early examples for convergence testing - -physicell_test_mech1: $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_mechanics_1.cpp - $(COMPILE_COMMAND) -o test_mech1 $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_mechanics_1.cpp - -physicell_test_mech2: $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_mechanics_2.cpp - $(COMPILE_COMMAND) -o test_mech2 $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_mechanics_2.cpp - -physicell_test_DCIS: $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_DCIS.cpp - $(COMPILE_COMMAND) -o test_DCIS $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_DCIS.cpp - -physicell_test_HDS: $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_HDS.cpp - $(COMPILE_COMMAND) -o test_HDS $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_HDS.cpp - -physicell_test_cell_cycle: $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_cell_cycle.cpp - $(COMPILE_COMMAND) -o test_cycle $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_cell_cycle.cpp - -PhysiCell_test_volume: $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_volume.cpp - $(COMPILE_COMMAND) -o test_volume $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_volume.cpp - -examples: $(PhysiCell_OBJECTS) - $(COMPILE_COMMAND) -o ./examples/test_mech1 ./examples/PhysiCell_test_mechanics_1.cpp $(PhysiCell_OBJECTS) - $(COMPILE_COMMAND) -o ./examples/test_mech2 ./examples/PhysiCell_test_mechanics_2.cpp $(PhysiCell_OBJECTS) - $(COMPILE_COMMAND) -o ./examples/test_DCIS ./examples/PhysiCell_test_DCIS.cpp $(PhysiCell_OBJECTS) - $(COMPILE_COMMAND) -o ./examples/test_HDS ./examples/PhysiCell_test_HDS.cpp $(PhysiCell_OBJECTS) - $(COMPILE_COMMAND) -o ./examples/test_cycle ./examples/PhysiCell_test_cell_cycle.cpp $(PhysiCell_OBJECTS) - $(COMPILE_COMMAND) -o ./examples/test_volume ./examples/PhysiCell_test_volume.cpp $(PhysiCell_OBJECTS) - # PhysiCell core components PhysiCell_phenotype.o: ./core/PhysiCell_phenotype.cpp @@ -311,25 +150,28 @@ PhysiCell_MultiCellDS.o: ./modules/PhysiCell_MultiCellDS.cpp PhysiCell_various_outputs.o: ./modules/PhysiCell_various_outputs.cpp $(COMPILE_COMMAND) -c ./modules/PhysiCell_various_outputs.cpp - + PhysiCell_pugixml.o: ./modules/PhysiCell_pugixml.cpp $(COMPILE_COMMAND) -c ./modules/PhysiCell_pugixml.cpp PhysiCell_settings.o: ./modules/PhysiCell_settings.cpp - $(COMPILE_COMMAND) -c ./modules/PhysiCell_settings.cpp + $(COMPILE_COMMAND) -c ./modules/PhysiCell_settings.cpp PhysiCell_basic_signaling.o: ./core/PhysiCell_basic_signaling.cpp - $(COMPILE_COMMAND) -c ./core/PhysiCell_basic_signaling.cpp - + $(COMPILE_COMMAND) -c ./core/PhysiCell_basic_signaling.cpp + PhysiCell_geometry.o: ./modules/PhysiCell_geometry.cpp $(COMPILE_COMMAND) -c ./modules/PhysiCell_geometry.cpp - + # user-defined PhysiCell modules +custom.o: ./custom_modules/custom.cpp + $(COMPILE_COMMAND) -c ./custom_modules/custom.cpp + # cleanup reset: - rm -f *.cpp PhysiCell_cell.o + rm -f *.cpp cp ./sample_projects/Makefile-default Makefile rm -f ./custom_modules/* touch ./custom_modules/empty.txt @@ -338,7 +180,7 @@ reset: rm ALL_CITATIONS.txt cp ./config/PhysiCell_settings-backup.xml ./config/PhysiCell_settings.xml touch ./config/empty.csv - rm ./config/*.csv + rm -f ./config/*.csv clean: rm -f *.o @@ -348,9 +190,9 @@ data-cleanup: rm -rf ./output mkdir ./output touch ./output/empty.txt - + # archival - + checkpoint: zip -r $$(date +%b_%d_%Y_%H%M).zip Makefile *.cpp *.h config/*.xml custom_modules/* @@ -421,4 +263,4 @@ upgrade: $(SOURCE) unzip $(SOURCE) PhysiCell/documentation/User_Guide.pdf mv -f PhysiCell/documentation/User_Guide.pdf documentation rm -f -r PhysiCell - rm -f $(SOURCE) + rm -f $(SOURCE) \ No newline at end of file diff --git a/blah.xml b/blah.xml index a45916727..0cb76581d 100644 --- a/blah.xml +++ b/blah.xml @@ -1530,6 +1530,9 @@ 50 0.0075 200 - + + 5 + + diff --git a/config/PhysiCell_settings.xml b/config/PhysiCell_settings.xml index 5164a3782..824881a71 100644 --- a/config/PhysiCell_settings.xml +++ b/config/PhysiCell_settings.xml @@ -97,19 +97,19 @@ - 4 + 6 output - 60 + 360 true - 15 + 60 true @@ -120,36 +120,17 @@ false + true - + - 100.0 - 0 + 100000.0 + 10 - 1 - 0 - - - - - - - 1000.0 - .1 - - 0 - 0 + 0 + 0 - - - - - 1000.0 - .1 - - 0 - 0 - - - - + true @@ -199,31 +159,34 @@ - + - + + - - 0 + 5.31667e-05 - - - - - 0.003 - - - - - 0 - 1 - + + 0 + + 0 + + + 0 + + 0 + + 0 + + + + + 0 + + - - 10 - - - - 0.5 - 5 - 0.5 - - true - true - - false - food - 1 - - - - - - 1.0 - 1.0 - 1.0 - - -100 - 10 - 1 - - - - - - - - 0 - 0 - - - - 10 - - - - 0.5 - 2.5 - 0.7 - - true - true - - false - prey signal - 1 - - - + - 1.0 - 1.0 - 1.0 - - -2 - 100 - 1 + 1.0 - + + + ./config + cells.csv + + + 0 - 15 + 5 diff --git a/config/cells.csv b/config/cells.csv new file mode 100644 index 000000000..734bdc767 --- /dev/null +++ b/config/cells.csv @@ -0,0 +1 @@ +0,0,0,0 \ No newline at end of file diff --git a/core/PhysiCell_signal_behavior.cpp b/core/PhysiCell_signal_behavior.cpp index 78bc73ce3..24e1fba95 100644 --- a/core/PhysiCell_signal_behavior.cpp +++ b/core/PhysiCell_signal_behavior.cpp @@ -170,11 +170,15 @@ void setup_signal_behavior_dictionaries( void ) map_index++; signal_to_int["contact with live cell"] = map_index; int_to_signal[map_index] = "contact with live cell"; + // synonym + signal_to_int["contact with live cells"] = map_index; // contact with dead cell map_index++; signal_to_int["contact with dead cell"] = map_index; int_to_signal[map_index] = "contact with dead cell"; + // synonym + signal_to_int["contact with dead cells"] = map_index; // contact with basement membrane map_index++; @@ -194,7 +198,6 @@ void setup_signal_behavior_dictionaries( void ) signal_to_int["total attack time"] = map_index; int_to_signal[map_index] = "total attack time"; - behavior_to_int.clear(); int_to_behavior.clear(); @@ -348,6 +351,7 @@ void setup_signal_behavior_dictionaries( void ) // synonym "phagocytosis of dead cell"; behavior_to_int[ "phagocytosis of dead cell" ] = map_index; + behavior_to_int[ "phagocytosis of dead cells" ] = map_index; // phagocytosis of each live cell type for( int i=0; i < n ; i++ ) @@ -430,7 +434,7 @@ double& signal_scale( int signal_index ) void display_signal_dictionary( std::ostream& os ) { os << "Signals: " << std::endl - << "=======" << std::endl; + << "=======" << std::endl; for( int i=0; i < int_to_signal.size() ; i++ ) { os << i << " : " << int_to_signal[i] << std::endl; } os << std::endl; @@ -478,7 +482,6 @@ void display_response_dictionary_with_synonyms( void ) return; } - int find_signal_index( std::string signal_name ) { auto search = signal_to_int.find( signal_name ); @@ -523,13 +526,9 @@ std::vector find_behavior_indices( std::vector behavior_names return output; } -// start here - // create a full signal vector std::vector construct_signals( Cell* pCell ) { - // hard-coded - static int m = microenvironment.number_of_densities(); static int n = cell_definition_indices_by_name.size(); @@ -538,41 +537,47 @@ std::vector construct_signals( Cell* pCell ) // substrate densities // copy efficiently; - std::copy( pCell->nearest_density_vector().begin() , pCell->nearest_density_vector().end(), signals.begin() ); - // for( int i=0; i < m ; i++ ) - // { signals[i] /= signal_scales[i]; } - + static int start_substrate_ind = find_signal_index( microenvironment.density_names[0] ); + std::copy( pCell->nearest_density_vector().begin() , + pCell->nearest_density_vector().end(), + signals.begin()+start_substrate_ind ); // internalized substrates - int ind = m; - std::copy( pCell->phenotype.molecular.internalized_total_substrates.begin() , pCell->phenotype.molecular.internalized_total_substrates.end(), signals.begin()+m ); + int ind = m; + static int start_int_substrate_ind = find_signal_index( "intracellular " + microenvironment.density_names[0] ); + std::copy( pCell->phenotype.molecular.internalized_total_substrates.begin() , + pCell->phenotype.molecular.internalized_total_substrates.end(), + signals.begin()+start_int_substrate_ind); // m ); for( int i=0; i < m ; i++ ) - { signals[i+m] /= pCell->phenotype.volume.total; } + { signals[i+start_int_substrate_ind] /= pCell->phenotype.volume.total; } // substrate gradients ind = 2*m; // int ind = m; + static int start_substrate_grad_ind = find_signal_index( microenvironment.density_names[0] + " gradient"); for( int i=0; i < m ; i++ ) { - signals[ind] = norm( pCell->nearest_gradient(i) ); + signals[start_substrate_grad_ind+i] = norm( pCell->nearest_gradient(i) ); // signals[ind] /= signal_scales[ind]; ind++; } // mechanical pressure - signals[ind] = pCell->state.simple_pressure; + static int pressure_ind = find_signal_index( "pressure"); + signals[pressure_ind] = pCell->state.simple_pressure; // signals[ind] / signal_scales[ind]; ind++; // cell volume - signals[ind] = pCell->phenotype.volume.total; + static int volume_ind = find_signal_index( "volume"); + signals[volume_ind] = pCell->phenotype.volume.total; // signals[ind] / signal_scales[ind]; ind++; - // physical contact with cells (of each type) // increment signals int dead_cells = 0; int live_cells = 0; + static int contact_ind = find_signal_index( "contact with " + cell_definitions_by_type[0]->name ); for( int i=0; i < pCell->state.neighbors.size(); i++ ) { Cell* pC = pCell->state.neighbors[i]; @@ -581,33 +586,35 @@ std::vector construct_signals( Cell* pCell ) else { live_cells++; } int nCT = cell_definition_indices_by_type[pC->type]; - signals[ind+nCT] += 1; + signals[contact_ind+nCT] += 1; } - // rescale - // for( int nCT=0; nCT < n ; nCT++ ) - // { signals[ind+nCT] /= signal_scales[ind+nCT]; } ind += n; // physical contact with live cells - signals[ind] = live_cells; + static int live_contact_ind = find_signal_index( "contact with live cell"); + signals[live_contact_ind] = live_cells; // signals[ind] /= signal_scales[ind]; ind++; // physical contact with dead cells - signals[ind] = dead_cells; + static int dead_contact_ind = find_signal_index( "contact with dead cell"); + signals[dead_contact_ind] = dead_cells; // signals[ind] /= signal_scales[ind]; ind++; // physical contact with basement membrane (not implemented) - signals[ind] = (int) pCell->state.contact_with_basement_membrane; + static int BM_contact_ind = find_signal_index( "contact with basement membrane"); + signals[BM_contact_ind] = (int) pCell->state.contact_with_basement_membrane; ind++; // damage - signals[ind] = pCell->state.damage; + static int damage_ind = find_signal_index( "damage"); + signals[damage_ind] = pCell->state.damage; ind++; // integrated total attack time - signals[ind] = pCell->state.total_attack_time; + static int tot_attack_ind = find_signal_index( "total attack time"); + signals[tot_attack_ind] = pCell->state.total_attack_time; ind++; // rescale @@ -616,6 +623,8 @@ std::vector construct_signals( Cell* pCell ) return signals; } +/* start here */ + // create a signal vector of only the cell contacts std::vector construct_cell_contact_signals( Cell* pCell ) { diff --git a/core/PhysiCell_signal_behavior.h b/core/PhysiCell_signal_behavior.h index 727391ff3..9d031b58c 100644 --- a/core/PhysiCell_signal_behavior.h +++ b/core/PhysiCell_signal_behavior.h @@ -117,12 +117,6 @@ std::vector construct_cell_contact_signals( Cell* pCell ); // done std::vector construct_selected_signals( Cell* pCell , std::vector indices ); // done std::vector construct_selected_signals( Cell* pCell , std::vector names ); // done - -/* -void set_selected_behaviors( Cell* pCell , std::vector indices , std::vector parameters ); // done -void set_selected_behaviors( Cell* pCell , std::vector names , std::vector parameters ); // done -*/ - // grab a single signal by its index or name double single_signal( Cell* pCell, int index ); // done double single_signal( Cell* pCell, std::string name ); // done diff --git a/custom_modules/custom.cpp b/custom_modules/custom.cpp new file mode 100644 index 000000000..663bafbbe --- /dev/null +++ b/custom_modules/custom.cpp @@ -0,0 +1,204 @@ +/* +############################################################################### +# If you use PhysiCell in your project, please cite PhysiCell and the version # +# number, such as below: # +# # +# We implemented and solved the model using PhysiCell (Version x.y.z) [1]. # +# # +# [1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin, # +# PhysiCell: an Open Source Physics-Based Cell Simulator for Multicellu- # +# lar Systems, PLoS Comput. Biol. 14(2): e1005991, 2018 # +# DOI: 10.1371/journal.pcbi.1005991 # +# # +# See VERSION.txt or call get_PhysiCell_version() to get the current version # +# x.y.z. Call display_citations() to get detailed information on all cite-# +# able software used in your PhysiCell application. # +# # +# Because PhysiCell extensively uses BioFVM, we suggest you also cite BioFVM # +# as below: # +# # +# We implemented and solved the model using PhysiCell (Version x.y.z) [1], # +# with BioFVM [2] to solve the transport equations. # +# # +# [1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin, # +# PhysiCell: an Open Source Physics-Based Cell Simulator for Multicellu- # +# lar Systems, PLoS Comput. Biol. 14(2): e1005991, 2018 # +# DOI: 10.1371/journal.pcbi.1005991 # +# # +# [2] A Ghaffarizadeh, SH Friedman, and P Macklin, BioFVM: an efficient para- # +# llelized diffusive transport solver for 3-D biological simulations, # +# Bioinformatics 32(8): 1256-8, 2016. DOI: 10.1093/bioinformatics/btv730 # +# # +############################################################################### +# # +# BSD 3-Clause License (see https://opensource.org/licenses/BSD-3-Clause) # +# # +# Copyright (c) 2015-2021, Paul Macklin and the PhysiCell Project # +# All rights reserved. # +# # +# Redistribution and use in source and binary forms, with or without # +# modification, are permitted provided that the following conditions are met: # +# # +# 1. Redistributions of source code must retain the above copyright notice, # +# this list of conditions and the following disclaimer. # +# # +# 2. Redistributions in binary form must reproduce the above copyright # +# notice, this list of conditions and the following disclaimer in the # +# documentation and/or other materials provided with the distribution. # +# # +# 3. Neither the name of the copyright holder nor the names of its # +# contributors may be used to endorse or promote products derived from this # +# software without specific prior written permission. # +# # +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # +# POSSIBILITY OF SUCH DAMAGE. # +# # +############################################################################### +*/ + +#include "./custom.h" + +void create_cell_types( void ) +{ + // set the random seed + SeedRandom( parameters.ints("random_seed") ); + + /* + Put any modifications to default cell definition here if you + want to have "inherited" by other cell types. + + This is a good place to set default functions. + */ + + initialize_default_cell_definition(); + cell_defaults.phenotype.secretion.sync_to_microenvironment( µenvironment ); + + cell_defaults.functions.volume_update_function = standard_volume_update_function; + cell_defaults.functions.update_velocity = standard_update_cell_velocity; + + cell_defaults.functions.update_migration_bias = NULL; + cell_defaults.functions.update_phenotype = NULL; // update_cell_and_death_parameters_O2_based; + cell_defaults.functions.custom_cell_rule = NULL; + cell_defaults.functions.contact_function = NULL; + + cell_defaults.functions.add_cell_basement_membrane_interactions = NULL; + cell_defaults.functions.calculate_distance_to_membrane = NULL; + + /* + This parses the cell definitions in the XML config file. + */ + + initialize_cell_definitions_from_pugixml(); + + /* + This builds the map of cell definitions and summarizes the setup. + */ + + build_cell_definitions_maps(); + + /* + This intializes cell signal and response dictionaries + */ + + setup_signal_behavior_dictionaries(); + + /* + Put any modifications to individual cell definitions here. + + This is a good place to set custom functions. + */ + + cell_defaults.functions.update_phenotype = phenotype_function; + cell_defaults.functions.custom_cell_rule = custom_function; + cell_defaults.functions.contact_function = contact_function; + + /* + This builds the map of cell definitions and summarizes the setup. + */ + + display_cell_definitions( std::cout ); + + return; +} + +void setup_microenvironment( void ) +{ + // set domain parameters + + // put any custom code to set non-homogeneous initial conditions or + // extra Dirichlet nodes here. + + // initialize BioFVM + + initialize_microenvironment(); + + return; +} + +void setup_tissue( void ) +{ + double Xmin = microenvironment.mesh.bounding_box[0]; + double Ymin = microenvironment.mesh.bounding_box[1]; + double Zmin = microenvironment.mesh.bounding_box[2]; + + double Xmax = microenvironment.mesh.bounding_box[3]; + double Ymax = microenvironment.mesh.bounding_box[4]; + double Zmax = microenvironment.mesh.bounding_box[5]; + + if( default_microenvironment_options.simulate_2D == true ) + { + Zmin = 0.0; + Zmax = 0.0; + } + + double Xrange = Xmax - Xmin; + double Yrange = Ymax - Ymin; + double Zrange = Zmax - Zmin; + + // create some of each type of cell + + Cell* pC; + + for( int k=0; k < cell_definitions_by_index.size() ; k++ ) + { + Cell_Definition* pCD = cell_definitions_by_index[k]; + std::cout << "Placing cells of type " << pCD->name << " ... " << std::endl; + for( int n = 0 ; n < parameters.ints("number_of_cells") ; n++ ) + { + std::vector position = {0,0,0}; + position[0] = Xmin + UniformRandom()*Xrange; + position[1] = Ymin + UniformRandom()*Yrange; + position[2] = Zmin + UniformRandom()*Zrange; + + pC = create_cell( *pCD ); + pC->assign_position( position ); + } + } + std::cout << std::endl; + + // load cells from your CSV file (if enabled) + load_cells_from_pugixml(); + + return; +} + +std::vector my_coloring_function( Cell* pCell ) +{ return paint_by_number_cell_coloring(pCell); } + +void phenotype_function( Cell* pCell, Phenotype& phenotype, double dt ) +{ return; } + +void custom_function( Cell* pCell, Phenotype& phenotype , double dt ) +{ return; } + +void contact_function( Cell* pMe, Phenotype& phenoMe , Cell* pOther, Phenotype& phenoOther , double dt ) +{ return; } \ No newline at end of file diff --git a/custom_modules/custom.h b/custom_modules/custom.h new file mode 100644 index 000000000..0e6df8d02 --- /dev/null +++ b/custom_modules/custom.h @@ -0,0 +1,92 @@ +/* +############################################################################### +# If you use PhysiCell in your project, please cite PhysiCell and the version # +# number, such as below: # +# # +# We implemented and solved the model using PhysiCell (Version x.y.z) [1]. # +# # +# [1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin, # +# PhysiCell: an Open Source Physics-Based Cell Simulator for Multicellu- # +# lar Systems, PLoS Comput. Biol. 14(2): e1005991, 2018 # +# DOI: 10.1371/journal.pcbi.1005991 # +# # +# See VERSION.txt or call get_PhysiCell_version() to get the current version # +# x.y.z. Call display_citations() to get detailed information on all cite-# +# able software used in your PhysiCell application. # +# # +# Because PhysiCell extensively uses BioFVM, we suggest you also cite BioFVM # +# as below: # +# # +# We implemented and solved the model using PhysiCell (Version x.y.z) [1], # +# with BioFVM [2] to solve the transport equations. # +# # +# [1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin, # +# PhysiCell: an Open Source Physics-Based Cell Simulator for Multicellu- # +# lar Systems, PLoS Comput. Biol. 14(2): e1005991, 2018 # +# DOI: 10.1371/journal.pcbi.1005991 # +# # +# [2] A Ghaffarizadeh, SH Friedman, and P Macklin, BioFVM: an efficient para- # +# llelized diffusive transport solver for 3-D biological simulations, # +# Bioinformatics 32(8): 1256-8, 2016. DOI: 10.1093/bioinformatics/btv730 # +# # +############################################################################### +# # +# BSD 3-Clause License (see https://opensource.org/licenses/BSD-3-Clause) # +# # +# Copyright (c) 2015-2021, Paul Macklin and the PhysiCell Project # +# All rights reserved. # +# # +# Redistribution and use in source and binary forms, with or without # +# modification, are permitted provided that the following conditions are met: # +# # +# 1. Redistributions of source code must retain the above copyright notice, # +# this list of conditions and the following disclaimer. # +# # +# 2. Redistributions in binary form must reproduce the above copyright # +# notice, this list of conditions and the following disclaimer in the # +# documentation and/or other materials provided with the distribution. # +# # +# 3. Neither the name of the copyright holder nor the names of its # +# contributors may be used to endorse or promote products derived from this # +# software without specific prior written permission. # +# # +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # +# POSSIBILITY OF SUCH DAMAGE. # +# # +############################################################################### +*/ + +#include "../core/PhysiCell.h" +#include "../modules/PhysiCell_standard_modules.h" + +using namespace BioFVM; +using namespace PhysiCell; + +// setup functions to help us along + +void create_cell_types( void ); +void setup_tissue( void ); + +// set up the BioFVM microenvironment +void setup_microenvironment( void ); + +// custom pathology coloring function + +std::vector my_coloring_function( Cell* ); + +// custom functions can go here + +void phenotype_function( Cell* pCell, Phenotype& phenotype, double dt ); +void custom_function( Cell* pCell, Phenotype& phenotype , double dt ); + +void contact_function( Cell* pMe, Phenotype& phenoMe , Cell* pOther, Phenotype& phenoOther , double dt ); + diff --git a/main-backup.cpp b/main-backup.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/main.cpp b/main.cpp new file mode 100644 index 000000000..d74fb0a86 --- /dev/null +++ b/main.cpp @@ -0,0 +1,259 @@ +/* +############################################################################### +# If you use PhysiCell in your project, please cite PhysiCell and the version # +# number, such as below: # +# # +# We implemented and solved the model using PhysiCell (Version x.y.z) [1]. # +# # +# [1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin, # +# PhysiCell: an Open Source Physics-Based Cell Simulator for Multicellu- # +# lar Systems, PLoS Comput. Biol. 14(2): e1005991, 2018 # +# DOI: 10.1371/journal.pcbi.1005991 # +# # +# See VERSION.txt or call get_PhysiCell_version() to get the current version # +# x.y.z. Call display_citations() to get detailed information on all cite-# +# able software used in your PhysiCell application. # +# # +# Because PhysiCell extensively uses BioFVM, we suggest you also cite BioFVM # +# as below: # +# # +# We implemented and solved the model using PhysiCell (Version x.y.z) [1], # +# with BioFVM [2] to solve the transport equations. # +# # +# [1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin, # +# PhysiCell: an Open Source Physics-Based Cell Simulator for Multicellu- # +# lar Systems, PLoS Comput. Biol. 14(2): e1005991, 2018 # +# DOI: 10.1371/journal.pcbi.1005991 # +# # +# [2] A Ghaffarizadeh, SH Friedman, and P Macklin, BioFVM: an efficient para- # +# llelized diffusive transport solver for 3-D biological simulations, # +# Bioinformatics 32(8): 1256-8, 2016. DOI: 10.1093/bioinformatics/btv730 # +# # +############################################################################### +# # +# BSD 3-Clause License (see https://opensource.org/licenses/BSD-3-Clause) # +# # +# Copyright (c) 2015-2022, Paul Macklin and the PhysiCell Project # +# All rights reserved. # +# # +# Redistribution and use in source and binary forms, with or without # +# modification, are permitted provided that the following conditions are met: # +# # +# 1. Redistributions of source code must retain the above copyright notice, # +# this list of conditions and the following disclaimer. # +# # +# 2. Redistributions in binary form must reproduce the above copyright # +# notice, this list of conditions and the following disclaimer in the # +# documentation and/or other materials provided with the distribution. # +# # +# 3. Neither the name of the copyright holder nor the names of its # +# contributors may be used to endorse or promote products derived from this # +# software without specific prior written permission. # +# # +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # +# POSSIBILITY OF SUCH DAMAGE. # +# # +############################################################################### +*/ + +#include +#include +#include +#include +#include +#include +#include + +#include "./core/PhysiCell.h" +#include "./modules/PhysiCell_standard_modules.h" + +// put custom code modules here! + +#include "./custom_modules/custom.h" + +using namespace BioFVM; +using namespace PhysiCell; + +int main( int argc, char* argv[] ) +{ + // load and parse settings file(s) + + bool XML_status = false; + char copy_command [1024]; + if( argc > 1 ) + { + XML_status = load_PhysiCell_config_file( argv[1] ); + sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); + } + else + { + XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); + sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); + } + if( !XML_status ) + { exit(-1); } + + // copy config file to output directry + system( copy_command ); + + // OpenMP setup + omp_set_num_threads(PhysiCell_settings.omp_num_threads); + + // time setup + std::string time_units = "min"; + + /* Microenvironment setup */ + + setup_microenvironment(); // modify this in the custom code + + /* PhysiCell setup */ + + // set mechanics voxel size, and match the data structure to BioFVM + double mechanics_voxel_size = 30; + Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, mechanics_voxel_size ); + + /* Users typically start modifying here. START USERMODS */ + + create_cell_types(); + + setup_tissue(); + + /* Users typically stop modifying here. END USERMODS */ + + // set MultiCellDS save options + + set_save_biofvm_mesh_as_matlab( true ); + set_save_biofvm_data_as_matlab( true ); + set_save_biofvm_cell_data( true ); + set_save_biofvm_cell_data_as_custom_matlab( true ); + + // save a simulation snapshot + + char filename[1024]; + sprintf( filename , "%s/initial" , PhysiCell_settings.folder.c_str() ); + save_PhysiCell_to_MultiCellDS_xml_pugi( filename , microenvironment , PhysiCell_globals.current_time ); + + // save a quick SVG cross section through z = 0, after setting its + // length bar to 200 microns + + PhysiCell_SVG_options.length_bar = 200; + + // for simplicity, set a pathology coloring function + + std::vector (*cell_coloring_function)(Cell*) = my_coloring_function; + + sprintf( filename , "%s/initial.svg" , PhysiCell_settings.folder.c_str() ); + SVG_plot( filename , microenvironment, 0.0 , PhysiCell_globals.current_time, cell_coloring_function ); + + sprintf( filename , "%s/legend.svg" , PhysiCell_settings.folder.c_str() ); + create_plot_legend( filename , cell_coloring_function ); + + display_citations(); + + // set the performance timers + + BioFVM::RUNTIME_TIC(); + BioFVM::TIC(); + + std::ofstream report_file; + if( PhysiCell_settings.enable_legacy_saves == true ) + { + sprintf( filename , "%s/simulation_report.txt" , PhysiCell_settings.folder.c_str() ); + + report_file.open(filename); // create the data log file + report_file<<"simulated time\tnum cells\tnum division\tnum death\twall time"< sigs = construct_signals( pC ); + std::cout << sigs << std::endl; + return 1; + + + try + { + while( PhysiCell_globals.current_time < PhysiCell_settings.max_time + 0.1*diffusion_dt ) + { + // save data if it's time. + if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_full_save_time ) < 0.01 * diffusion_dt ) + { + display_simulation_status( std::cout ); + if( PhysiCell_settings.enable_legacy_saves == true ) + { + log_output( PhysiCell_globals.current_time , PhysiCell_globals.full_output_index, microenvironment, report_file); + } + + if( PhysiCell_settings.enable_full_saves == true ) + { + sprintf( filename , "%s/output%08u" , PhysiCell_settings.folder.c_str(), PhysiCell_globals.full_output_index ); + + save_PhysiCell_to_MultiCellDS_xml_pugi( filename , microenvironment , PhysiCell_globals.current_time ); + } + + PhysiCell_globals.full_output_index++; + PhysiCell_globals.next_full_save_time += PhysiCell_settings.full_save_interval; + } + + // save SVG plot if it's time + if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_SVG_save_time ) < 0.01 * diffusion_dt ) + { + if( PhysiCell_settings.enable_SVG_saves == true ) + { + sprintf( filename , "%s/snapshot%08u.svg" , PhysiCell_settings.folder.c_str() , PhysiCell_globals.SVG_output_index ); + SVG_plot( filename , microenvironment, 0.0 , PhysiCell_globals.current_time, cell_coloring_function ); + + PhysiCell_globals.SVG_output_index++; + PhysiCell_globals.next_SVG_save_time += PhysiCell_settings.SVG_save_interval; + } + } + + // update the microenvironment + microenvironment.simulate_diffusion_decay( diffusion_dt ); + + // run PhysiCell + ((Cell_Container *)microenvironment.agent_container)->update_all_cells( PhysiCell_globals.current_time ); + + /* + Custom add-ons could potentially go here. + */ + + PhysiCell_globals.current_time += diffusion_dt; + } + + if( PhysiCell_settings.enable_legacy_saves == true ) + { + log_output(PhysiCell_globals.current_time, PhysiCell_globals.full_output_index, microenvironment, report_file); + report_file.close(); + } + } + catch( const std::exception& e ) + { // reference to the base of a polymorphic object + std::cout << e.what(); // information from length_error printed + } + + // save a final simulation snapshot + + sprintf( filename , "%s/final" , PhysiCell_settings.folder.c_str() ); + save_PhysiCell_to_MultiCellDS_xml_pugi( filename , microenvironment , PhysiCell_globals.current_time ); + + sprintf( filename , "%s/final.svg" , PhysiCell_settings.folder.c_str() ); + SVG_plot( filename , microenvironment, 0.0 , PhysiCell_globals.current_time, cell_coloring_function ); + + // timer + + std::cout << std::endl << "Total simulation runtime: " << std::endl; + BioFVM::display_stopwatch_value( std::cout , BioFVM::runtime_stopwatch_value() ); + + return 0; +} From 15b8346f6565af025e4c1ef040269d8d6b32d1c0 Mon Sep 17 00:00:00 2001 From: Paul Macklin Date: Wed, 4 May 2022 16:20:23 -0400 Subject: [PATCH 03/10] cleanup and fixes --- core/PhysiCell_signal_behavior.cpp | 145 ++++++++++++++++++++++++++++- todo -- April 28, 2022.txt | 7 ++ 2 files changed, 147 insertions(+), 5 deletions(-) diff --git a/core/PhysiCell_signal_behavior.cpp b/core/PhysiCell_signal_behavior.cpp index 24e1fba95..9e55f8b78 100644 --- a/core/PhysiCell_signal_behavior.cpp +++ b/core/PhysiCell_signal_behavior.cpp @@ -623,8 +623,6 @@ std::vector construct_signals( Cell* pCell ) return signals; } -/* start here */ - // create a signal vector of only the cell contacts std::vector construct_cell_contact_signals( Cell* pCell ) { @@ -696,6 +694,142 @@ double single_signal( Cell* pCell, int index ) static int m = microenvironment.number_of_densities(); static int n = cell_definition_indices_by_name.size(); + double out = 0.0; + if( index < 0 ) + { + std::cout<< "Why would you ask for array[-1]? Why? WHY???? That's it, I quit." << std::endl; + exit(-1832443); + return -9e9; + } + + // first m entries: extracellular concentration + static int start_substrate_ind = find_signal_index( microenvironment.density_names[0] ); + if( start_substrate_ind <= index && index < m ) + { + out = pCell->nearest_density_vector()[index-start_substrate_ind]; + out /= signal_scales[index]; + return out; + } + + // second m entries: intracellular concentration + static int start_int_substrate_ind = find_signal_index( "intracellular " + microenvironment.density_names[0] ); + if( start_int_substrate_ind <= index && start_int_substrate_ind < m ) + { + out = pCell->phenotype.molecular.internalized_total_substrates[index-start_int_substrate_ind]; + out /= pCell->phenotype.volume.total; + out /= signal_scales[index]; + return out; + } + + // next m entries: gradients + static int start_substrate_grad_ind = find_signal_index( microenvironment.density_names[0] + " gradient"); + if( start_substrate_grad_ind <= index && start_substrate_grad_ind < m ) + { + out = norm( pCell->nearest_gradient(index-start_substrate_grad_ind) ); + out /= signal_scales[index]; + return out; + } + + // mechanical pressure + static int pressure_ind = find_signal_index( "pressure"); + if( index == pressure_ind ) + { + out = pCell->state.simple_pressure; + out /= signal_scales[index]; + return out; + } + + // cell volume + static int volume_ind = find_signal_index( "volume"); + if( index == volume_ind ) + { + out = pCell->phenotype.volume.total; + out /= signal_scales[index]; + return out; + } + + // physical contact with cells (of each type) + // individual contact signals are a bit costly + static int contact_ind = find_signal_index( "contact with " + cell_definitions_by_type[0]->name ); + if( contact_ind <= index && index < contact_ind+n+2 ) + { + std::vector counts( n , 0 ); + // process all neighbors + int dead_cells = 0; + int live_cells = 0; + for( int i=0; i < pCell->state.neighbors.size(); i++ ) + { + Cell* pC = pCell->state.neighbors[i]; + if( pC->phenotype.death.dead == true ) + { dead_cells++; } + else + { live_cells++; } + int nCT = cell_definition_indices_by_type[pC->type]; + counts[nCT] += 1; + } + + if( index < contact_ind+n ) + { + out = counts[index-contact_ind]; + out /= signal_scales[index]; + return out; + } + + static int live_contact_ind = find_signal_index( "contact with live cell"); + if( index == live_contact_ind ) + { + out = live_cells; + out /= signal_scales[index]; + return out; + } + + static int dead_contact_ind = find_signal_index( "contact with dead cell"); + // index == dead_contact_ind + out = dead_cells; + out /= signal_scales[index]; + return out; + } + + // contact with BM + static int BM_contact_ind = find_signal_index( "contact with basement membrane"); + if( index == BM_contact_ind ) + { + out = (double) pCell->state.contact_with_basement_membrane; + out /= signal_scales[index]; + return out; + } + + // damage + static int damage_ind = find_signal_index( "damage"); + if( index == damage_ind ) + { + out = pCell->state.damage; + out /= signal_scales[index]; + return out; + } + + // integrated total attack time + static int tot_attack_ind = find_signal_index( "total attack time"); + if( index == tot_attack_ind ) + { + out = pCell->state.total_attack_time; + out /= signal_scales[index]; + return out; + } + + // unknown after here ! + + std::cout << "Warning: Requested unknown signal number " << index << "!" << std::endl + << " Returning 0.0, but you should fix this!" << std::endl << std::endl; + + return 0.0; +} + +double single_signal_old( Cell* pCell, int index ) +{ + static int m = microenvironment.number_of_densities(); + static int n = cell_definition_indices_by_name.size(); + double out = 0.0; if( index < 0 ) @@ -834,10 +968,11 @@ std::string behavior_name( int i ) { if( i >= 0 && i < int_to_behavior.size() ) { return int_to_behavior[i]; } - return "not found"; } +/* start here */ + std::vector create_empty_behavior_vector() { std::vector parameters( int_to_behavior.size() , 0.0 ); @@ -891,7 +1026,6 @@ void set_behaviors( Cell* pCell , std::vector parameters ) static int apoptosis_index = pCell->phenotype.death.find_death_model_index( PhysiCell_constants::apoptosis_death_model ); static int necrosis_index = pCell->phenotype.death.find_death_model_index( PhysiCell_constants::necrosis_death_model ); - map_index = first_cycle_index+6; // 4*m + 6; static int apoptosis_param_index = find_behavior_index( "apoptosis"); // apoptosis @@ -1126,7 +1260,6 @@ void set_single_behavior( Cell* pCell, int index , double parameter ) if( index >= first_fusion_index && index < first_fusion_index + n ) { pCell->phenotype.cell_interactions.fusion_rates[index-first_fusion_index]; return; } - // transformation static int first_transformation_index = find_behavior_index( "transform to " + cell_definitions_by_type[0]->name ); if( index >= first_transformation_index && index < first_transformation_index + n ) @@ -1135,6 +1268,8 @@ void set_single_behavior( Cell* pCell, int index , double parameter ) return; } +/* start here */ + void set_single_behavior( Cell* pCell, std::string name , double parameter ) { int index = find_behavior_index( name ); diff --git a/todo -- April 28, 2022.txt b/todo -- April 28, 2022.txt index d3c742f26..5990b1232 100644 --- a/todo -- April 28, 2022.txt +++ b/todo -- April 28, 2022.txt @@ -20,6 +20,10 @@ can generate a properly sized parameter vector [x] can map parameters back to phenotype [x] +start at 692 + + + prototypical phenotyep funciton @@ -30,6 +34,9 @@ prototypical phenotyep funciton pC->edit_rule_parameters( signal, behavior, rsponse , parameters ); */ + + + // get signals std::vector< std::string > sig_names = {"substrate","pressure"} ; static std::vector sig_indices = find_signal_indices( sig_names ); From 4cef68cb640ea2068f723c3e833805abe7e083c0 Mon Sep 17 00:00:00 2001 From: Paul Macklin Date: Wed, 4 May 2022 16:30:02 -0400 Subject: [PATCH 04/10] Update PhysiCell_signal_behavior.cpp removing more hard-coded ordering of signals and behaviors. --- core/PhysiCell_signal_behavior.cpp | 56 ++++++++++++++---------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/core/PhysiCell_signal_behavior.cpp b/core/PhysiCell_signal_behavior.cpp index 9e55f8b78..5ca68aa8b 100644 --- a/core/PhysiCell_signal_behavior.cpp +++ b/core/PhysiCell_signal_behavior.cpp @@ -1268,8 +1268,6 @@ void set_single_behavior( Cell* pCell, int index , double parameter ) return; } -/* start here */ - void set_single_behavior( Cell* pCell, std::string name , double parameter ) { int index = find_behavior_index( name ); @@ -1291,7 +1289,6 @@ std::vector get_behaviors( Cell* pCell ) pCell->phenotype.secretion.secretion_rates.end(), parameters.begin()+first_secretion_index ); - // next m entries are secretion targets static int first_secretion_target_index = find_behavior_index( microenvironment.density_names[0] + " secretion target" ); // m; std::copy( pCell->phenotype.secretion.saturation_densities.begin(), @@ -1312,7 +1309,6 @@ std::vector get_behaviors( Cell* pCell ) // cycle entry (exit from phase 0) and exit from up to 5 more phases static int first_cycle_index = find_behavior_index("exit from cycle phase 0" ); // 4*m; - int map_index = first_cycle_index; int max_cycle_index = pCell->phenotype.cycle.model().phases.size(); if( max_cycle_index > 6 ) { @@ -1321,30 +1317,30 @@ std::vector get_behaviors( Cell* pCell ) << " Ignoring any later phase exit rates." << std::endl; } for( int i=0; i < max_cycle_index ; i++ ) - { parameters[map_index+i] = pCell->phenotype.cycle.data.exit_rate( i ); } + { parameters[first_cycle_index+i] = pCell->phenotype.cycle.data.exit_rate( i ); } static int apoptosis_index = pCell->phenotype.death.find_death_model_index( PhysiCell_constants::apoptosis_death_model ); static int necrosis_index = pCell->phenotype.death.find_death_model_index( PhysiCell_constants::necrosis_death_model ); - map_index = first_cycle_index+6; // 4*m + 6; // apoptosis - parameters[map_index] = pCell->phenotype.death.rates[apoptosis_index]; + static int apoptosis_param_index = find_behavior_index( "apoptosis"); + parameters[apoptosis_param_index] = pCell->phenotype.death.rates[apoptosis_index]; // necrosis - map_index++; - parameters[map_index] = pCell->phenotype.death.rates[necrosis_index]; + static int necrosis_param_index = find_behavior_index( "necrosis"); + parameters[necrosis_param_index] = pCell->phenotype.death.rates[necrosis_index]; // migration speed - map_index++; - parameters[map_index] = pCell->phenotype.motility.migration_speed; + static int migration_speed_index = find_behavior_index("migration speed"); + parameters[migration_speed_index] = pCell->phenotype.motility.migration_speed; // migration bias - map_index++; - parameters[map_index] = pCell->phenotype.motility.migration_bias; + static int migration_bias_index = find_behavior_index("migration bias"); + parameters[migration_bias_index] = pCell->phenotype.motility.migration_bias; // migration persistence time - map_index++; - parameters[map_index] = pCell->phenotype.motility.persistence_time; + static int migration_pt_index = find_behavior_index("migration persistence time"); + parameters[migration_pt_index] = pCell->phenotype.motility.persistence_time; // chemotactic sensitivities static int first_chemotaxis_index = find_behavior_index( "chemotactic response to " + microenvironment.density_names[0] ); @@ -1353,12 +1349,12 @@ std::vector get_behaviors( Cell* pCell ) parameters.begin()+first_chemotaxis_index ); // cell-cell adhesion - map_index++; - parameters[map_index] = pCell->phenotype.mechanics.cell_cell_adhesion_strength; + static int cca_index = find_behavior_index("cell-cell adhesion"); + parameters[cca_index] = pCell->phenotype.mechanics.cell_cell_adhesion_strength; // cell-cell "springs" - map_index++; - parameters[map_index] = pCell->phenotype.mechanics.attachment_elastic_constant; + static int cca_spring_index = find_behavior_index("cell-cell adhesion elastic constant"); + parameters[cca_spring_index] = pCell->phenotype.mechanics.attachment_elastic_constant; // cell adhesion affinities static std::string search_for1 = "adhesive affinity to " + cell_definitions_by_type[0]->name ; @@ -1368,24 +1364,24 @@ std::vector get_behaviors( Cell* pCell ) parameters.begin()+first_affinity_index ); // max relative maximum adhesion distance - map_index += n; - parameters[map_index] = pCell->phenotype.mechanics.relative_maximum_adhesion_distance; + static int max_adhesion_distance_index = find_behavior_index("relative maximum adhesion distance"); + parameters[max_adhesion_distance_index] = pCell->phenotype.mechanics.relative_maximum_adhesion_distance; // cell-cell repulsion - map_index++; - parameters[map_index] = pCell->phenotype.mechanics.cell_cell_repulsion_strength; + static int ccr_index = find_behavior_index("cell-cell repulsion"); + parameters[ccr_index] = pCell->phenotype.mechanics.cell_cell_repulsion_strength; // cell-BM adhesion - map_index++; - parameters[map_index] = pCell->phenotype.mechanics.cell_BM_adhesion_strength; + static int cba_index = find_behavior_index("cell-BM adhesion"); + parameters[cba_index] = pCell->phenotype.mechanics.cell_BM_adhesion_strength; // cell-BM repulsion - map_index++; - parameters[map_index] = pCell->phenotype.mechanics.cell_BM_repulsion_strength; + static int cbr_index = find_behavior_index("cell-BM repulsion"); + parameters[cbr_index] = pCell->phenotype.mechanics.cell_BM_repulsion_strength; // dead cell phagocytosis - map_index++; - parameters[map_index] = pCell->phenotype.cell_interactions.dead_phagocytosis_rate; + static int dead_phag_index = find_behavior_index("phagocytose dead cell"); + parameters[dead_phag_index] = pCell->phenotype.cell_interactions.dead_phagocytosis_rate; // phagocytosis of each live cell type static int first_phagocytosis_index = find_behavior_index( "phagocytose " + cell_definitions_by_type[0]->name ); @@ -1414,6 +1410,8 @@ std::vector get_behaviors( Cell* pCell ) return parameters; } +/* start here */ + double get_single_behavior( Cell* pCell , int index ) { static int m = microenvironment.number_of_densities(); From b936ed25d4c0daa3de698478511e42a93eb6da0d Mon Sep 17 00:00:00 2001 From: Paul Macklin Date: Wed, 4 May 2022 17:17:12 -0400 Subject: [PATCH 05/10] Update PhysiCell_signal_behavior.cpp --- core/PhysiCell_signal_behavior.cpp | 81 ++++++++++-------------------- 1 file changed, 27 insertions(+), 54 deletions(-) diff --git a/core/PhysiCell_signal_behavior.cpp b/core/PhysiCell_signal_behavior.cpp index 5ca68aa8b..04d12efa4 100644 --- a/core/PhysiCell_signal_behavior.cpp +++ b/core/PhysiCell_signal_behavior.cpp @@ -1410,8 +1410,6 @@ std::vector get_behaviors( Cell* pCell ) return parameters; } -/* start here */ - double get_single_behavior( Cell* pCell , int index ) { static int m = microenvironment.number_of_densities(); @@ -1448,7 +1446,6 @@ double get_single_behavior( Cell* pCell , int index ) // cycle entry (exit from phase 0) and exit from up to 5 more phases static int first_cycle_index = find_behavior_index("exit from cycle phase 0" ); // 4*m; - int map_index = first_cycle_index; int max_cycle_index = pCell->phenotype.cycle.model().phases.size(); if( max_cycle_index > 6 ) { @@ -1470,30 +1467,25 @@ double get_single_behavior( Cell* pCell , int index ) static int apop_param_index = find_behavior_index( "apoptosis"); static int necr_param_index = find_behavior_index( "necrosis"); - map_index = first_cycle_index+6; // 4*m + 6; // apoptosis if( index == apop_param_index ) { return pCell->phenotype.death.rates[apoptosis_index]; } // necrosis - map_index++; if( index == necr_param_index ) { return pCell->phenotype.death.rates[necrosis_index]; } // migration speed - map_index++; static int migr_spd_index = find_behavior_index( "migration speed"); if( index == migr_spd_index ) { return pCell->phenotype.motility.migration_speed; } // migration bias - map_index++; static int migr_bias_index = find_behavior_index( "migration bias"); if( index == migr_bias_index ) { return pCell->phenotype.motility.migration_bias; } // migration persistence time - map_index++; static int migr_pt_index = find_behavior_index( "migration persistence time"); if( index == migr_pt_index ) { return pCell->phenotype.motility.persistence_time; } @@ -1504,13 +1496,11 @@ double get_single_behavior( Cell* pCell , int index ) { return pCell->phenotype.motility.chemotactic_sensitivities[index-first_chemotaxis_index]; } // cell-cell adhesion - map_index++; static int cca_index = find_behavior_index( "cell-cell adhesion" ); if( index == cca_index ) { return pCell->phenotype.mechanics.cell_cell_adhesion_strength; } // cell-cell "springs" - map_index++; static int cca_spring_index = find_behavior_index( "cell-cell adhesion" ); // HERE if( index == cca_spring_index ) { return pCell->phenotype.mechanics.attachment_elastic_constant; } @@ -1521,31 +1511,26 @@ double get_single_behavior( Cell* pCell , int index ) { return pCell->phenotype.mechanics.cell_adhesion_affinities[index-first_affinity_index]; } // max relative maximum adhesion distance - map_index += n; static int max_adh_index = find_behavior_index("relative maximum adhesion distance" ); if( index = max_adh_index ) { return pCell->phenotype.mechanics.relative_maximum_adhesion_distance; } // cell-cell repulsion - map_index++; static int ccr_index = find_behavior_index("cell-cell repulsion" ); if( index = ccr_index ) { return pCell->phenotype.mechanics.cell_cell_repulsion_strength; } // cell-BM adhesion - map_index++; static int cba_index = find_behavior_index("cell-BM adhesion" ); if( index = cba_index ) { return pCell->phenotype.mechanics.cell_BM_adhesion_strength; } // cell-BM repulsion - map_index++; static int cbr_index = find_behavior_index("cell-BM repulsion" ); if( index = cbr_index ) { return pCell->phenotype.mechanics.cell_BM_repulsion_strength; } // dead cell phagocytosis - map_index++; static int dead_phag_index = find_behavior_index("phagocytose dead dell" ); if( index = dead_phag_index ) { return pCell->phenotype.cell_interactions.dead_phagocytosis_rate; } @@ -1644,7 +1629,6 @@ std::vector get_base_behaviors( Cell* pCell ) // cycle entry (exit from phase 0) and exit from up to 5 more phases static int first_cycle_index = find_behavior_index("exit from cycle phase 0" ); // 4*m; - int map_index = first_cycle_index; int max_cycle_index = pCD->phenotype.cycle.model().phases.size(); if( max_cycle_index > 6 ) { @@ -1653,30 +1637,30 @@ std::vector get_base_behaviors( Cell* pCell ) << " Ignoring any later phase exit rates." << std::endl; } for( int i=0; i < max_cycle_index ; i++ ) - { parameters[map_index+i] = pCD->phenotype.cycle.data.exit_rate( i ); } + { parameters[first_cycle_index+i] = pCD->phenotype.cycle.data.exit_rate( i ); } static int apoptosis_index = pCD->phenotype.death.find_death_model_index( PhysiCell_constants::apoptosis_death_model ); static int necrosis_index = pCD->phenotype.death.find_death_model_index( PhysiCell_constants::necrosis_death_model ); - map_index = first_cycle_index+6; // 4*m + 6; // apoptosis - parameters[map_index] = pCD->phenotype.death.rates[apoptosis_index]; + static int apoptosis_param_index = find_behavior_index( "apoptosis"); + parameters[apoptosis_param_index] = pCD->phenotype.death.rates[apoptosis_index]; // necrosis - map_index++; - parameters[map_index] = pCD->phenotype.death.rates[necrosis_index]; + static int necrosis_param_index = find_behavior_index( "necrosis"); + parameters[necrosis_param_index] = pCD->phenotype.death.rates[necrosis_index]; // migration speed - map_index++; - parameters[map_index] = pCD->phenotype.motility.migration_speed; + static int migration_speed_index = find_behavior_index("migration speed"); + parameters[migration_speed_index] = pCD->phenotype.motility.migration_speed; // migration bias - map_index++; - parameters[map_index] = pCD->phenotype.motility.migration_bias; + static int migration_bias_index = find_behavior_index("migration bias"); + parameters[migration_bias_index] = pCD->phenotype.motility.migration_bias; // migration persistence time - map_index++; - parameters[map_index] = pCD->phenotype.motility.persistence_time; + static int migration_pt_index = find_behavior_index("migration persistence time"); + parameters[migration_pt_index] = pCD->phenotype.motility.persistence_time; // chemotactic sensitivities static int first_chemotaxis_index = find_behavior_index( "chemotactic response to " + microenvironment.density_names[0] ); @@ -1685,12 +1669,12 @@ std::vector get_base_behaviors( Cell* pCell ) parameters.begin()+first_chemotaxis_index ); // cell-cell adhesion - map_index++; - parameters[map_index] = pCD->phenotype.mechanics.cell_cell_adhesion_strength; + static int cca_index = find_behavior_index("cell-cell adhesion"); + parameters[cca_index] = pCD->phenotype.mechanics.cell_cell_adhesion_strength; // cell-cell "springs" - map_index++; - parameters[map_index] = pCD->phenotype.mechanics.attachment_elastic_constant; + static int cca_spring_index = find_behavior_index("cell-cell adhesion elastic constant"); + parameters[cca_spring_index] = pCD->phenotype.mechanics.attachment_elastic_constant; // cell adhesion affinities static std::string search_for1 = "adhesive affinity to " + cell_definitions_by_type[0]->name ; @@ -1700,24 +1684,24 @@ std::vector get_base_behaviors( Cell* pCell ) parameters.begin()+first_affinity_index ); // max relative maximum adhesion distance - map_index += n; - parameters[map_index] = pCD->phenotype.mechanics.relative_maximum_adhesion_distance; + static int max_adhesion_distance_index = find_behavior_index("relative maximum adhesion distance"); + parameters[max_adhesion_distance_index] = pCD->phenotype.mechanics.relative_maximum_adhesion_distance; // cell-cell repulsion - map_index++; - parameters[map_index] = pCD->phenotype.mechanics.cell_cell_repulsion_strength; + static int ccr_index = find_behavior_index("cell-cell repulsion"); + parameters[ccr_index] = pCD->phenotype.mechanics.cell_cell_repulsion_strength; // cell-BM adhesion - map_index++; - parameters[map_index] = pCD->phenotype.mechanics.cell_BM_adhesion_strength; + static int cba_index = find_behavior_index("cell-BM adhesion"); + parameters[cba_index] = pCD->phenotype.mechanics.cell_BM_adhesion_strength; // cell-BM repulsion - map_index++; - parameters[map_index] = pCD->phenotype.mechanics.cell_BM_repulsion_strength; + static int cbr_index = find_behavior_index("cell-BM repulsion"); + parameters[cbr_index] = pCD->phenotype.mechanics.cell_BM_repulsion_strength; // dead cell phagocytosis - map_index++; - parameters[map_index] = pCD->phenotype.cell_interactions.dead_phagocytosis_rate; + static int dead_phag_index = find_behavior_index("phagocytose dead cell"); + parameters[dead_phag_index] = pCD->phenotype.cell_interactions.dead_phagocytosis_rate; // phagocytosis of each live cell type static int first_phagocytosis_index = find_behavior_index( "phagocytose " + cell_definitions_by_type[0]->name ); @@ -1746,6 +1730,8 @@ std::vector get_base_behaviors( Cell* pCell ) return parameters; } +/* start here */ + double get_single_base_behavior( Cell* pCell , int index ) { static int m = microenvironment.number_of_densities(); @@ -1784,7 +1770,6 @@ double get_single_base_behavior( Cell* pCell , int index ) // cycle entry (exit from phase 0) and exit from up to 5 more phases static int first_cycle_index = find_behavior_index("exit from cycle phase 0" ); // 4*m; - int map_index = first_cycle_index; int max_cycle_index = pCD->phenotype.cycle.model().phases.size(); if( max_cycle_index > 6 ) { @@ -1806,30 +1791,25 @@ double get_single_base_behavior( Cell* pCell , int index ) static int apop_param_index = find_behavior_index( "apoptosis"); static int necr_param_index = find_behavior_index( "necrosis"); - map_index = first_cycle_index+6; // 4*m + 6; // apoptosis if( index == apop_param_index ) { return pCD->phenotype.death.rates[apoptosis_index]; } // necrosis - map_index++; if( index == necr_param_index ) { return pCD->phenotype.death.rates[necrosis_index]; } // migration speed - map_index++; static int migr_spd_index = find_behavior_index( "migration speed"); if( index == migr_spd_index ) { return pCD->phenotype.motility.migration_speed; } // migration bias - map_index++; static int migr_bias_index = find_behavior_index( "migration bias"); if( index == migr_bias_index ) { return pCD->phenotype.motility.migration_bias; } // migration persistence time - map_index++; static int migr_pt_index = find_behavior_index( "migration persistence time"); if( index == migr_pt_index ) { return pCD->phenotype.motility.persistence_time; } @@ -1840,13 +1820,11 @@ double get_single_base_behavior( Cell* pCell , int index ) { return pCD->phenotype.motility.chemotactic_sensitivities[index-first_chemotaxis_index]; } // cell-cell adhesion - map_index++; static int cca_index = find_behavior_index( "cell-cell adhesion" ); if( index == cca_index ) { return pCD->phenotype.mechanics.cell_cell_adhesion_strength; } // cell-cell "springs" - map_index++; static int cca_spring_index = find_behavior_index( "cell-cell adhesion" ); // HERE if( index == cca_spring_index ) { return pCD->phenotype.mechanics.attachment_elastic_constant; } @@ -1857,31 +1835,26 @@ double get_single_base_behavior( Cell* pCell , int index ) { return pCD->phenotype.mechanics.cell_adhesion_affinities[index-first_affinity_index]; } // max relative maximum adhesion distance - map_index += n; static int max_adh_index = find_behavior_index("relative maximum adhesion distance" ); if( index = max_adh_index ) { return pCD->phenotype.mechanics.relative_maximum_adhesion_distance; } // cell-cell repulsion - map_index++; static int ccr_index = find_behavior_index("cell-cell repulsion" ); if( index = ccr_index ) { return pCD->phenotype.mechanics.cell_cell_repulsion_strength; } // cell-BM adhesion - map_index++; static int cba_index = find_behavior_index("cell-BM adhesion" ); if( index = cba_index ) { return pCD->phenotype.mechanics.cell_BM_adhesion_strength; } // cell-BM repulsion - map_index++; static int cbr_index = find_behavior_index("cell-BM repulsion" ); if( index = cbr_index ) { return pCD->phenotype.mechanics.cell_BM_repulsion_strength; } // dead cell phagocytosis - map_index++; static int dead_phag_index = find_behavior_index("phagocytose dead dell" ); if( index = dead_phag_index ) { return pCD->phenotype.cell_interactions.dead_phagocytosis_rate; } From 64015d1083e4e957a3d3e0f5c455c3b20dbc2256 Mon Sep 17 00:00:00 2001 From: Paul Macklin Date: Wed, 4 May 2022 17:27:30 -0400 Subject: [PATCH 06/10] testing --- main.cpp | 10 + output/blah.xml | 1538 ++++++++++++++++++++++++++ output/initial.svg | 179 +++ output/initial.xml | 130 +++ output/initial_cells.mat | Bin 0 -> 5632 bytes output/initial_cells_physicell.mat | Bin 0 -> 24385 bytes output/initial_mesh0.mat | Bin 0 -> 51224 bytes output/initial_microenvironment0.mat | Bin 0 -> 115247 bytes output/legend.svg | 55 + 9 files changed, 1912 insertions(+) create mode 100644 output/blah.xml create mode 100644 output/initial.svg create mode 100644 output/initial.xml create mode 100644 output/initial_cells.mat create mode 100644 output/initial_cells_physicell.mat create mode 100644 output/initial_mesh0.mat create mode 100644 output/initial_microenvironment0.mat create mode 100644 output/legend.svg diff --git a/main.cpp b/main.cpp index d74fb0a86..5b27cadee 100644 --- a/main.cpp +++ b/main.cpp @@ -178,6 +178,16 @@ int main( int argc, char* argv[] ) Cell* pC = (*all_cells)[0]; std::vector sigs = construct_signals( pC ); std::cout << sigs << std::endl; + + std::vector b0 = get_base_behaviors( pC ); + std::cout << b0 << std::endl; + + for( int i=0; i < b0.size(); i++ ) + { + std::cout << i << " : " << behavior_name(i) << " : " << b0[i] << std::endl; + } + + return 1; diff --git a/output/blah.xml b/output/blah.xml new file mode 100644 index 000000000..0cb76581d --- /dev/null +++ b/output/blah.xml @@ -0,0 +1,1538 @@ + + + -400 + 400 + -400 + 400 + -10 + 10 + 20 + 20 + 20 + true + + + + 10080 + min + micron + + 0.01 + 0.1 + 6 + + + + 6 + + + + output + + + 180 + true + + + + 30 + true + + + + false + + + + + false + true + false + + + + + + 100000.0 + 0.1 + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + + + + 100 + 0.1 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + 1000 + 0.1 + + 0.0 + 0.0 + + + + + + + + + + + + 1000 + 0.01 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + 1000 + 0.1 + + 0.0 + 0.0 + + + + + + + + + + + true + true + + + ./config/initial.mat + + + + ./config/dirichlet.mat + + + + + + + + + + 0.00028 + + + + + + 0.00028 + + 516 + + + 0.05 + 0 + 1.66667e-02 + 5.83333e-03 + 0 + 2.0 + + + + 0.0 + + 0 + 86400 + + + 0.05 + 0 + 1.66667e-02 + 5.83333e-03 + 0 + 2.0 + + + + + + 500 + 0.75 + 499 + 0.05 + 0.0045 + 0.0055 + 0 + 0 + 2.0 + + + + 0.04 + 20.0 + 1.25 + + .1 + .2 + .3 + .4 + .5 + .6 + .7 + + + 1.8 + 15.12 + + + + + 1 + 5 + 0.2 + + true + true + + false + resource + 1 + + + + true + false + + 1 + 0 + 0.1 + 0 + 0 + + + + + + + + + 0 + 1 + 30 + 0 + + + 0.0 + 0.0 + 0.0 + 100 + + + 0 + 0.0 + 0.0 + 1 + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 0.0 + 0.0 + 0.0 + 0.0 + + + + 0 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + 0 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + 0.15 + 0.075 + 0.15 + 0.25 + 0.5 + 0.0 + 0.0 + 0.0 + 0.0 + 36 + 100 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + + + + + + + + 0 + + + + + + 0 + + 516 + + + 0.05 + 0 + 1.66667e-02 + 5.83333e-03 + 0 + 2.0 + + + + 0.0 + + 0 + 86400 + + + 0.05 + 0 + 1.66667e-02 + 5.83333e-03 + 0 + 2.0 + + + + + + 2494 + 0.75 + 540 + 0.05 + 0.0045 + 0.0055 + 0 + 0 + 2.0 + + + + 0.4 + 10.0 + 1.25 + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + 1.8 + 15.12 + + + + + 1 + 1 + .5 + + false + true + + false + debris + 1 + + + + false + false + + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1000 + 1 + 0 + 0 + + + 0.0 + 0.0 + 0 + 0.0 + + + 0.0 + 0.0 + 0 + 0.0 + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 0.0 + 0.0 + 0.0 + 0.0 + + + + 0 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + 0 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + 0.15 + 0.075 + 0.15 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + + + + + + + + 0.002 + + + + + + 5.3e-08 + + 516 + + + 0.05 + 0 + 1.66667e-02 + 5.83333e-03 + 0 + 2.0 + + + + 0.0 + + 0 + 86400 + + + 0.05 + 0 + 1.66667e-02 + 5.83333e-03 + 0 + 2.0 + + + + + + 2494 + 0.75 + 540 + 0.05 + 0.0045 + 0.0055 + 0 + 0 + 2.0 + + + + 0.4 + 10.0 + 1.25 + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + 1.8 + 15.12 + + + + + 1 + 1 + .5 + + false + true + + false + debris + 1 + + + + false + false + + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 0 + 1 + 1 + 0 + + + 0.0 + 0.0 + 0 + 0.0 + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 0.0 + 0.0 + 0.0 + 0.0 + + + + 0 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + 0 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + 0 + 0 + 0 + 0.0001 + 0 + 0 + 0 + + + + + + 0.15 + 0.075 + 0.15 + 0.0 + 0.0 + 0.4 + 100 + 0.1 + 0.1 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + + + + + + + + 5.3e-4 + + + + + + 5.3e-05 + + 516 + + + 0.05 + 0 + 1.66667e-02 + 5.83333e-03 + 0 + 2.0 + + + + 0.0 + + 0 + 86400 + + + 0.05 + 0 + 1.66667e-02 + 5.83333e-03 + 0 + 2.0 + + + + + + 2494 + 0.75 + 540 + 0.05 + 0.0045 + 0.0055 + 0 + 0 + 2.0 + + + + 0.4 + 10.0 + 1.25 + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + 1.8 + 15.12 + + + + + 1 + 1 + .5 + + false + true + + false + debris + 1 + + + + false + false + + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 0 + 1 + 10 + 0 + + + 0.0 + 0.0 + 0 + 0.0 + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 0.0 + 0.0 + 0.0 + 0.0 + + + + 0 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + 0 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + 0.15 + 0.075 + 0.15 + 0.0 + 0.0 + 0.2 + 100 + 0.0 + 0.0 + 0.0 + 0.0 + 0.5 + 0.0 + 0.0 + 0.0 + 0.0 + + + + + + + + 0 + + + + + + 0 + + 516 + + + 0.05 + 0 + 1.66667e-02 + 5.83333e-03 + 0 + 2.0 + + + + 0.0 + + 0 + 86400 + + + 0.05 + 0 + 1.66667e-02 + 5.83333e-03 + 0 + 2.0 + + + + + + 3000 + 0.75 + 600 + 0.05 + 0.045 + 0.0055 + 0 + 0 + 2.0 + + + + 0.04 + 10.0 + 1.25 + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + 1.8 + 15.12 + + + + + 1 + 5 + 0.1 + + true + true + + false + debris + 1 + + + + true + false + + 0 + 0 + 1 + 0 + 0.1 + + + + + + + + + 0 + 1 + 5 + 0 + + + 0.0 + 0.0 + 0.0 + 0 + + + 0.0 + 0.0 + 0.0 + 0 + + + 0.0 + 1.0 + 0 + 0.0 + + + 0.0 + 0.0 + 5 + 0.0 + + + + 0.05 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + 0 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + 0.15 + 0.075 + 0.15 + 0.05 + 0.01 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.005 + 0.1 + 1 + 0 + + + + + + + + 0 + + + + + + 0 + + 516 + + + 0.05 + 0 + 1.66667e-02 + 5.83333e-03 + 0 + 2.0 + + + + 0.0 + + 0 + 86400 + + + 0.05 + 0 + 1.66667e-02 + 5.83333e-03 + 0 + 2.0 + + + + + + 3000 + 0.75 + 600 + 0.05 + 0.0045 + 0.0055 + 0 + 0 + 2.0 + + + + 0.04 + 10.0 + 1.25 + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + 1.8 + 15.12 + + + + + 1 + 5 + 0.1 + + true + true + + true + pro-inflammatory + 1 + + + + false + false + + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 0 + 1 + 5 + 0 + + + 0.0 + 0.0 + 0.0 + 0 + + + 0.0 + 0.0 + 0.0 + 0 + + + 0.0 + 0.0 + 1 + 0.0 + + + 0.0 + 0.0 + 0 + 0.0 + + + + 0 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 0.05 + 0 + 0 + 0 + 0 + 0 + 0 + + 0 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + 0.15 + 0.075 + 0.15 + 0.0 + 0.5 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + + + + + + + + 0 + + + + + + 0 + + 516 + + + 0.05 + 0 + 1.66667e-02 + 5.83333e-03 + 0 + 2.0 + + + + 0.0 + + 0 + 86400 + + + 0.05 + 0 + 1.66667e-02 + 5.83333e-03 + 0 + 2.0 + + + + + + 1000 + 0.75 + 200 + 0.05 + 0.045 + 0.0055 + 0 + 0 + 2.0 + + + + 0.04 + 10.0 + 1.25 + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + 1.8 + 15.12 + + + + + 1 + 5 + 0.1 + + true + true + + true + pro-inflammatory + 1 + + + + false + false + + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 0 + 1 + 5 + 0 + + + 0.0 + 0.0 + 0.0 + 0 + + + 0.0 + 0.0 + 0.0 + 0 + + + 0.0 + 0.0 + 1 + 0.0 + + + 0.0 + 0.0 + 0 + 0.0 + + + + 0 + + 0.05 + 0 + 0 + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + 0 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + 0.15 + 0.075 + 0.15 + 0.0 + 0.5 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + + + + + + + + + cells.csv + + + + + 0 + 50 + 400 + 40 + 20 + 50 + 50 + 50 + 0.0075 + 200 + + 5 + + + + diff --git a/output/initial.svg b/output/initial.svg new file mode 100644 index 000000000..c06d656fe --- /dev/null +++ b/output/initial.svg @@ -0,0 +1,179 @@ + + + + + + Current time: 0 days, 0 hours, and 0.00 minutes, z = 0.00 μm + + + 35 agents + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 200 μm + + + 0 days, 0 hours, 0 minutes, and 0.8058 seconds + + + diff --git a/output/initial.xml b/output/initial.xml new file mode 100644 index 000000000..8e0170249 --- /dev/null +++ b/output/initial.xml @@ -0,0 +1,130 @@ + + + + + BioFVM + 1.1.7 + http://BioFVM.MathCancer.org + + + + + + 0.000000 + 0.800728 + 2022-05-04T21:25:48Z + 2022-05-04T21:25:48Z + + + + + -400.000000 -400.000000 -10.000000 400.000000 400.000000 10.000000 + -390.000000 -370.000000 -350.000000 -330.000000 -310.000000 -290.000000 -270.000000 -250.000000 -230.000000 -210.000000 -190.000000 -170.000000 -150.000000 -130.000000 -110.000000 -90.000000 -70.000000 -50.000000 -30.000000 -10.000000 10.000000 30.000000 50.000000 70.000000 90.000000 110.000000 130.000000 150.000000 170.000000 190.000000 210.000000 230.000000 250.000000 270.000000 290.000000 310.000000 330.000000 350.000000 370.000000 390.000000 + -390.000000 -370.000000 -350.000000 -330.000000 -310.000000 -290.000000 -270.000000 -250.000000 -230.000000 -210.000000 -190.000000 -170.000000 -150.000000 -130.000000 -110.000000 -90.000000 -70.000000 -50.000000 -30.000000 -10.000000 10.000000 30.000000 50.000000 70.000000 90.000000 110.000000 130.000000 150.000000 170.000000 190.000000 210.000000 230.000000 250.000000 270.000000 290.000000 310.000000 330.000000 350.000000 370.000000 390.000000 + 0.000000 + + initial_mesh0.mat + + + + + + + 100000.000000 + 0.100000 + + + + + + 100.000000 + 0.100000 + + + + + + 1000.000000 + 0.100000 + + + + + + 1000.000000 + 0.010000 + + + + + + 1000.000000 + 0.100000 + + + + + initial_microenvironment0.mat + + + + + + + + + initial_cells.mat + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + initial_cells_physicell.mat + + + + + + diff --git a/output/initial_cells.mat b/output/initial_cells.mat new file mode 100644 index 0000000000000000000000000000000000000000..6adf8ff2285f4b9fe80829b063737492027e5629 GIT binary patch literal 5632 zcmd7W+e?#S90%~9V4$HiYiNWsF%^;Wluq+F$&1d;m^wUeYR)n9IOol@*A613d7vVx z3o{`I3&n~NBo9pJgd$N?5++g+CIR$jp(Iq_f@HAF2a4`@JME7>QS^K#?oBKI31C2Uj$ssU*~3<&_B06X=!7`N4PH% zu58Ejm=&%OOYP`}{YAJh8b0ZQUr7mkwyB<5^7F_=xGx5twB7Ub7WB~2*+0#U(|N(` zFBUH8i>j*y?R!nT;%)oiUbqYcZQo9#BOhu*8qi#XuWuYYBafdO6VUZOy@B;;F2a4X zE3YCrxRqg_j!IJ0V&)>;mk7_ZIkQQN&UWv3<8AMcB)H~6of$T?r0f4+MspGV{OyOQ z*KK?tudl%;Kd1oBMYu0nL!{FiE}0nCS^ufL5zVFPj)t2AoTlLVJ->EMn$U{T%`fDzxEm*p@s-e1!Wl;7Y4|e^Xvx z>B^7z!;I&NU*Al)YGzBF)#&9&wZGNNd|7ZslwR&=M~@ez-!q`O2w&f9c- literal 0 HcmV?d00001 diff --git a/output/initial_cells_physicell.mat b/output/initial_cells_physicell.mat new file mode 100644 index 0000000000000000000000000000000000000000..18aa18718bd061a09266527b0b5b9303bcde6233 GIT binary patch literal 24385 zcmdU%dyrGr9mkIyor$eZqh)lbBbxC+GgjgHf)yWJTW5^cO4L;%2nIn3g=%;$R1v~M zCMu6Wt;S;8NUcUi8wa&%r`l_wvZ!FRTGvN4r9M)v&i#YYZ98^)lHczaa=*^)Njo~; zduG_rob$cEyLW&2ntl4K9Ebe$kw3npId&M%C)cIx&!7J1)R&Zs17o)x zKjovPO2sawJOOmixti({UeXoq;qSkf2f(Ge7js>omz4`?-T+FuDR;Rpei5ISDfNDN z_FOu?3{?A2r74fyb!Dp`y}*-NW9vBL7Uov&PmNh;%2oRDTQ((^F==N0+Vm#($sMET z=(^Mai`Vpd>%-{n6!sP<-rAEX&j79Q^f+gL)Wf~L%KTH_itp@6oM|yLKst|7#+*IP z0NeGjF2`k)>@BeEEv%P$F1h*%dD{aFhPTRAs#4g0&smy>FL~keroSB{gx2%)D5$@HLi;+pz{c8%Xz-SOX;#Hk8*tiDD{4Ml&>QJ6faGAX)}3S z1qQ?0h^^G%u>QwVnwix0<0or&j1YROrt^La6mN4G%FDpQV)AMLNZshd+hy#fc*;yN z^FZmcDKA{d*9DY%zr5DZ*R#+|@z#{r?;&r8fWh!KYAfZue9*@UN2z^B4<9#OvtxwN z+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j#I=N%)2-WF~nFRMWDHg`MaWuV%{-U6u`U3j~L{RBF^PYwa4%ceZX d`(hO+^?teYd%B(>pm=M_bEEkF7WhSb`yUYkR#pH2 literal 0 HcmV?d00001 diff --git a/output/initial_mesh0.mat b/output/initial_mesh0.mat new file mode 100644 index 0000000000000000000000000000000000000000..eb7d75559395ec6a7b71c82783672f6a107e3ba8 GIT binary patch literal 51224 zcmajnL2lee8h}wP26GNCa*lx8EVIcb8zF#^L6AWL+d;DQQGAo|C_c(4?E3!3Q2i(a z5z~AwcB@(ZRHAG@Jv}}B>*c@g-!C6te*N?R|9$`QKgWaTzxMyz9uHnVY=3XZ|GxWk zKeqk8+jdT{dVp9uh+i)a_#%i*S@{K_Wh@8-=44i z^N(-%4{!MQ*Z%a~8~*JZ{>@vyJ^k}b^Xuu`H~hP6|NQ+M{=*yo3U`?bIOaP7|@ul>uXYybMkwZHrG+MoY=%lD^$e$~0-!OMsG z*8a9Yu#+(O3WItAFz};-$?KoI{>kf~y#C4SpS=Fb>z};-$?G3|^^d;# zC$E3>)j#^`pM5)~41M*FzWOJxfArNq`s$y&{>kf~y#C4SpS=Fb>z};-$?KoI{>h(L z|K#;gUjO9vPhS7*`!WCO)bZfu!?}O*jw^3}+w<}3pS=Fb>z};-$?KoI{>kf~y#C4S zpS=Fb>mPmfkG}dRuYdH_KlYu#+$?KoI{>kf~y#C4S zpS=Fbzpn3p<@HZq|K#;gUjO9vPhS7*`!WCO(DC5q!?}O*`X}#siIwH$1ZvO zlh;3a{gc-}dHs{uKY9I=*FSmvqp$waSO4VokKX;ibszV9{+?Fz};-$?Ko|Yxn=~`PV;z};-$?KoI{>kf~y#C4SAHDm3 z>+8t*{rlYgKY0Dq@t?Z?r}5qYqu=JQkN<{u{}0Ene>#5sqj&!g$FF}HU;pIwPhS7z z^-o^^Qp|K#;gUjO9vPhS7z^-o^^?E7&^)RE)C%ZKy&PhS7z^-o^^Qp|K#;g{^iqlOi6kDlh;3a{j=}K z^Vf;v!OMqp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CQ|7m>dKY8mvc>UA!*FSpe zKODdQX?*>Y*FSmvlh;3a*S);`ZO_+l{gc-}dHs{uKY9I=*FSmvv+u{J+~;}z{9FIY z>!19~r|aX_KaH<{^7<#QfAab#uYdCTC$E3<`X{e{^7=<#{iCm+|H|thef5vNe*SCU zF6UoA|K<4AKY9J5ub=Qp|KxQ+-u||)`tafU{MA2=uYdCT zC$E3<`e)ydPpOW-`ux_v|01t{@-M4@^7<#QfAab#uYdCTC$E3<`X{e{^7<#QfAacA zU;U%6{>kefef5vN`e(mgKlHW!qp$wS>mPmfkG}dRuYdCTC$E3<`X{e{^7<#QfAYE^ zZ-3i!KkA>n{>kf~y#C4SpM5`Gaz};-$?KoI{>kf~y#C4SpS=Fb>z};- z$?KoI{>kefef5vN`X{e{^wmH5>YshPoPVwVIDYj{UjOK;fArNqdHs{uKY9I=*FSmv zlh;3a{gc-}d0mmWzwNm%^-o^^Qp|Lptml6oEI*Y|F%|K#;gUjO9vPhS7zUw^-T z{q;}d>z};-$?KoI{>kf~y#C4SAAR+YzWOJxfArNq`s$y3yPSXZkKJ;cmMB?ty6z&`}tM<)A;^fdV2T& zbo}-64~}2o|I)kvhvU~jjqm3l^zQ%R`1McY>z};-$?KoI{>kf~y#C4SpS=Fb>z}+X z$=lzyN!t9ZfAacg-;YCfoY%*{_WGys^-uo%@%s4nPvh&Ky#C4SpS=Fb>z};-$?KoI z{>kefz59QEZk^g=+x+S0zZzfv=-vOr@%#BN$FKg;yZ@)-cmEGw|8)HNNALb0j$i*Y zzW&MUpS=Fb>z};-$?KoI{>kf~y#C4SpS*6#+uycH-u$kA_Wc;r?>mog{U@(~^7du*E@^-tsLAHDm3IDY-( z_|-r9>L0!Pe|Y}-r}6cV-u*uuzy4`_{gc-}dHs{uKY9I=*FSmvlh;3a{gc-}dHs{u OHF^8nb`iYH|NjBw#O*Zz literal 0 HcmV?d00001 diff --git a/output/initial_microenvironment0.mat b/output/initial_microenvironment0.mat new file mode 100644 index 0000000000000000000000000000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P@|5=^-S)KY>o%&gw`dOX&S)KY>o%&gw`dOX&S)KY>o%&gw z`dOX&nVr?o?5uuPr+#K<^)oxGpWWGxC7GS|{02L#pVg_K*;)O}&gy4%>SuN8XLagl zb?Rqz>SuN8XLaglb?Rqz>N#~fzvJ1itDn`WpVg_K)v2G|*^jrj_v!5W{A%q#t5ZL# zQ$MRyKdVzetMldOYrbFgvyP{JR;PYer+!waepaV`R;PYer+#K<^)oxGpVg_K*;)O} z&gy4(woBIM_Mdq?tDn`WpV?Xc%+Bg(b?Rqz>SuN8XLaglb?Rqz>SuN8XLaglb?Rqz z>OyrozvJ0Hte@4XpVg_K-MRHx^E>eSEb)X(aCS^ca|{j5&?tWN!` zPW`M-{j5&?tWN!`PW{Zz>SuO({`r@!rRO+4`rixJ&pMu`o`2Ty^!zhBxA(>8b&=Ea z&p5C8S?AS%KgdqcKjXaWXB|)dtWN!`PW`M-{j5&?tWN!`PW`M-{j5&?tWJHYPUm-Q zv43=(ubeSEb)X(bF&+63A>eSEb)X(bFsp@oo$8J84 z-goL}clKild1uGd{o%&gw`dOX& zS)KZsot}UGb!*8uj*qTm^|OwrerBiVpK)IGGmmHWGdn&1tn=#mXLRakomc(LPR~E% zyy|BiPyMV;{j5&?tWN!`PW`M-{j5&?tWN!`PW`M-{j5&?tWLeFPUm;*CicMn>pv!Y BT|EE* literal 0 HcmV?d00001 diff --git a/output/legend.svg b/output/legend.svg new file mode 100644 index 000000000..7bc9910ef --- /dev/null +++ b/output/legend.svg @@ -0,0 +1,55 @@ + + + + + + + bacteria + + + + + blood vessel + + + + + stem + + + + + differentiated + + + + + macrophage + + + + + CD8+ T cell + + + + + neutrophil + + From a2348e11a73ab6498427e512bb83c0b4b0bfc57f Mon Sep 17 00:00:00 2001 From: Paul Macklin Date: Wed, 4 May 2022 22:32:28 -0400 Subject: [PATCH 07/10] bug fxies --- blah.xml | 2 +- config/PhysiCell_settings.xml | 2 +- core/PhysiCell_signal_behavior.cpp | 41 +- core/PhysiCell_signal_behavior.h | 12 +- main.cpp | 62 +- output/blah.xml | 1538 -------------------------- output/initial.svg | 179 --- output/initial.xml | 130 --- output/initial_cells.mat | Bin 5632 -> 0 bytes output/initial_cells_physicell.mat | Bin 24385 -> 0 bytes output/initial_mesh0.mat | Bin 51224 -> 0 bytes output/initial_microenvironment0.mat | Bin 115247 -> 0 bytes output/legend.svg | 55 - 13 files changed, 88 insertions(+), 1933 deletions(-) delete mode 100644 output/blah.xml delete mode 100644 output/initial.svg delete mode 100644 output/initial.xml delete mode 100644 output/initial_cells.mat delete mode 100644 output/initial_cells_physicell.mat delete mode 100644 output/initial_mesh0.mat delete mode 100644 output/initial_microenvironment0.mat delete mode 100644 output/legend.svg diff --git a/blah.xml b/blah.xml index 0cb76581d..3c33d0c57 100644 --- a/blah.xml +++ b/blah.xml @@ -1531,7 +1531,7 @@ 0.0075 200 - 5 + 500 diff --git a/config/PhysiCell_settings.xml b/config/PhysiCell_settings.xml index 824881a71..12f39edea 100644 --- a/config/PhysiCell_settings.xml +++ b/config/PhysiCell_settings.xml @@ -328,7 +328,7 @@ - 5 + 500 diff --git a/core/PhysiCell_signal_behavior.cpp b/core/PhysiCell_signal_behavior.cpp index 04d12efa4..fe9d6108a 100644 --- a/core/PhysiCell_signal_behavior.cpp +++ b/core/PhysiCell_signal_behavior.cpp @@ -527,7 +527,7 @@ std::vector find_behavior_indices( std::vector behavior_names } // create a full signal vector -std::vector construct_signals( Cell* pCell ) +std::vector get_signals( Cell* pCell ) { static int m = microenvironment.number_of_densities(); static int n = cell_definition_indices_by_name.size(); @@ -624,7 +624,7 @@ std::vector construct_signals( Cell* pCell ) } // create a signal vector of only the cell contacts -std::vector construct_cell_contact_signals( Cell* pCell ) +std::vector get_cell_contact_signals( Cell* pCell ) { static int m = microenvironment.number_of_densities(); static int n = cell_definition_indices_by_name.size(); @@ -655,7 +655,7 @@ std::vector construct_cell_contact_signals( Cell* pCell ) return output; } -std::vector construct_selected_signals( Cell* pCell , std::vector indices ) +std::vector get_selected_signals( Cell* pCell , std::vector indices ) { static int m = microenvironment.number_of_densities(); static int n = cell_definition_indices_by_name.size(); @@ -664,7 +664,7 @@ std::vector construct_selected_signals( Cell* pCell , std::vector i static int contact_start_index = find_signal_index( "contact with " + cell_definitions_by_type[0]->name ); // typically more efficient to get these first - std::vector contact_signals = construct_cell_contact_signals( pCell ); + std::vector contact_signals = get_cell_contact_signals( pCell ); bool created_contact_signals = false; std::vector signals( indices.size() , 0.0 ); @@ -674,22 +674,22 @@ std::vector construct_selected_signals( Cell* pCell , std::vector i if( ind >= contact_start_index && ind < contact_start_index+n+2) { signals[i] = contact_signals[ind-contact_start_index]; } else - { signals[i] = single_signal( pCell , ind ); } + { signals[i] = get_single_signal( pCell , ind ); } } return signals; } -std::vector construct_selected_signals( Cell* pCell , std::vector names ) +std::vector get_selected_signals( Cell* pCell , std::vector names ) { std::vector signal_indices( names.size() , 0 ); for( int i=0; i < names.size(); i++ ) { signal_indices[i] = find_signal_index( names[i]); } - return construct_selected_signals(pCell,signal_indices); + return get_selected_signals(pCell,signal_indices); } -double single_signal( Cell* pCell, int index ) +double get_single_signal( Cell* pCell, int index ) { static int m = microenvironment.number_of_densities(); static int n = cell_definition_indices_by_name.size(); @@ -713,7 +713,7 @@ double single_signal( Cell* pCell, int index ) // second m entries: intracellular concentration static int start_int_substrate_ind = find_signal_index( "intracellular " + microenvironment.density_names[0] ); - if( start_int_substrate_ind <= index && start_int_substrate_ind < m ) + if( start_int_substrate_ind <= index && index < start_int_substrate_ind + m ) { out = pCell->phenotype.molecular.internalized_total_substrates[index-start_int_substrate_ind]; out /= pCell->phenotype.volume.total; @@ -723,7 +723,7 @@ double single_signal( Cell* pCell, int index ) // next m entries: gradients static int start_substrate_grad_ind = find_signal_index( microenvironment.density_names[0] + " gradient"); - if( start_substrate_grad_ind <= index && start_substrate_grad_ind < m ) + if( start_substrate_grad_ind <= index && index < start_substrate_grad_ind + m ) { out = norm( pCell->nearest_gradient(index-start_substrate_grad_ind) ); out /= signal_scales[index]; @@ -825,7 +825,7 @@ double single_signal( Cell* pCell, int index ) return 0.0; } -double single_signal_old( Cell* pCell, int index ) +double get_single_signal_old( Cell* pCell, int index ) { static int m = microenvironment.number_of_densities(); static int n = cell_definition_indices_by_name.size(); @@ -959,8 +959,8 @@ double single_signal_old( Cell* pCell, int index ) return 0.0; } -double single_signal( Cell* pCell, std::string name ) -{ return single_signal( pCell, find_signal_index(name) ); } +double get_single_signal( Cell* pCell, std::string name ) +{ return get_single_signal( pCell, find_signal_index(name) ); } // behaviors @@ -1168,7 +1168,7 @@ void set_single_behavior( Cell* pCell, int index , double parameter ) if( index < first_cycle_index+max_cycle_index ) { pCell->phenotype.cycle.data.exit_rate(index-first_cycle_index) = parameter; return; } std::cout << "Warning: Attempted to set a cycle exit rate outside the bounds of the cell's cycle model" << std::endl - << " Ignoring it, but you should fix this." << std::endl; + << " Ignoring it, but you should fix this." << std::endl; return; } @@ -1179,7 +1179,7 @@ void set_single_behavior( Cell* pCell, int index , double parameter ) if( index == apoptosis_parameter_index ) { pCell->phenotype.death.rates[apoptosis_model_index] = parameter; return; } - static int necrosis_model_index = pCell->phenotype.death.find_death_model_index( PhysiCell_constants::apoptosis_death_model ); + static int necrosis_model_index = pCell->phenotype.death.find_death_model_index( PhysiCell_constants::necrosis_death_model ); static int necrosis_parameter_index = find_behavior_index( "necrosis"); if( index == necrosis_parameter_index ) { pCell->phenotype.death.rates[necrosis_model_index] = parameter; return; } @@ -1202,8 +1202,7 @@ void set_single_behavior( Cell* pCell, int index , double parameter ) // chemotactic sensitivities static int first_chemotaxis_index = find_behavior_index( "chemotactic response to " + microenvironment.density_names[0] ); if( index >= first_chemotaxis_index && index < first_chemotaxis_index + m ) - { pCell->phenotype.motility.chemotactic_sensitivities[index-first_chemotaxis_index]; return; } - + { pCell->phenotype.motility.chemotactic_sensitivities[index-first_chemotaxis_index] = parameter; return; } // cell-cell adhesion static int cca_index = find_behavior_index( "cell-cell adhesion"); @@ -1248,22 +1247,22 @@ void set_single_behavior( Cell* pCell, int index , double parameter ) // phagocytosis of each live cell type static int first_phagocytosis_index = find_behavior_index( "phagocytose " + cell_definitions_by_type[0]->name ); if( index >= first_phagocytosis_index && index < first_phagocytosis_index + n ) - { pCell->phenotype.cell_interactions.live_phagocytosis_rates[index-first_phagocytosis_index]; return; } + { pCell->phenotype.cell_interactions.live_phagocytosis_rates[index-first_phagocytosis_index] = parameter ; return; } // attack of each live cell type static int first_attack_index = find_behavior_index( "attack " + cell_definitions_by_type[0]->name ); if( index >= first_attack_index && index < first_attack_index + n ) - { pCell->phenotype.cell_interactions.attack_rates[index-first_attack_index]; return; } + { pCell->phenotype.cell_interactions.attack_rates[index-first_attack_index] = parameter; return; } // fusion static int first_fusion_index = find_behavior_index( "fuse to " + cell_definitions_by_type[0]->name ); if( index >= first_fusion_index && index < first_fusion_index + n ) - { pCell->phenotype.cell_interactions.fusion_rates[index-first_fusion_index]; return; } + { pCell->phenotype.cell_interactions.fusion_rates[index-first_fusion_index] = parameter; return; } // transformation static int first_transformation_index = find_behavior_index( "transform to " + cell_definitions_by_type[0]->name ); if( index >= first_transformation_index && index < first_transformation_index + n ) - { pCell->phenotype.cell_transformations.transformation_rates[index-first_transformation_index]; return; } + { pCell->phenotype.cell_transformations.transformation_rates[index-first_transformation_index] = parameter; return; } return; } diff --git a/core/PhysiCell_signal_behavior.h b/core/PhysiCell_signal_behavior.h index 9d031b58c..b7fcc77c9 100644 --- a/core/PhysiCell_signal_behavior.h +++ b/core/PhysiCell_signal_behavior.h @@ -108,18 +108,18 @@ std::vector find_signal_indices( std::vector signal_names ); / std::string signal_name( int i ); // done // create a full signal vector -std::vector construct_signals( Cell* pCell ); // done +std::vector get_signals( Cell* pCell ); // done // create a signal vector of only the cell contacts -std::vector construct_cell_contact_signals( Cell* pCell ); // done +std::vector get_cell_contact_signals( Cell* pCell ); // done // create a subset of the signal vector with the supplied indicies -std::vector construct_selected_signals( Cell* pCell , std::vector indices ); // done -std::vector construct_selected_signals( Cell* pCell , std::vector names ); // done +std::vector get_selected_signals( Cell* pCell , std::vector indices ); // done +std::vector get_selected_signals( Cell* pCell , std::vector names ); // done // grab a single signal by its index or name -double single_signal( Cell* pCell, int index ); // done -double single_signal( Cell* pCell, std::string name ); // done +double get_single_signal( Cell* pCell, int index ); // done +double get_single_signal( Cell* pCell, std::string name ); // done /* behavior functions */ diff --git a/main.cpp b/main.cpp index 5b27cadee..ac3303f1d 100644 --- a/main.cpp +++ b/main.cpp @@ -176,17 +176,75 @@ int main( int argc, char* argv[] ) // main loop Cell* pC = (*all_cells)[0]; - std::vector sigs = construct_signals( pC ); + std::vector sigs = get_signals( pC ); std::cout << sigs << std::endl; std::vector b0 = get_base_behaviors( pC ); - std::cout << b0 << std::endl; + + for( int i=0; i < b0.size(); i++ ) + { + std::vector indices = {i}; + std::vector params = {i + 0.0 }; + b0[i] = i + 0.00001; + // set_selected_behaviors(pC, indices, params ); + // set_single_behavior( pC, i , i+0.0 ); + } + + set_behaviors( pC, b0 ); + + b0 = get_behaviors( pC ); + + + std::cout.precision(10); for( int i=0; i < b0.size(); i++ ) { std::cout << i << " : " << behavior_name(i) << " : " << b0[i] << std::endl; } + // now let's test signals + int nV = pC->get_current_voxel_index(); + for( int i=0 ; i < microenvironment.number_of_densities() ; i++ ) + { + microenvironment(nV)[i] = i + 0.1; + pC->phenotype.molecular.internalized_total_substrates[i] = (-i - 0.1)*pC->phenotype.volume.total; +/* + pC->phenotype.secretion.secretion_rates[i] = 10*i+0.01; + pC->phenotype.secretion.saturation_densities[i] = 20*i+0.01; + pC->phenotype.secretion.uptake_rates[i] = 30*i+0.01; + pC->phenotype.secretion.net_export_rates[i] = 40*i+0.01; + + pC->phenotype.motility.chemotactic_sensitivities[i] = 50*i + 0.001; +*/ + } + + int n = cell_definitions_by_index.size(); + std::vector cell_probs( n , 1.0 / ( n + 0.0 ) ); + + for( int i=1; i < 100 ; i++ ) + { + Cell* pC1 = (*all_cells)[i]; + + // choose type + int nNT = choose_event( cell_probs ); + // transform cell + pC1->convert_to_cell_definition( *cell_definitions_by_index[nNT] ); + // dead or alive? + if( UniformRandom() <= 0.5 ) + { pC1->phenotype.death.dead = true; } + // add it to neighbors of pC + pC->state.neighbors.push_back( pC1 ); + } + + std::cout << std::endl; + sigs = get_signals( pC ); + for( int i=0; i < sigs.size(); i++ ) + { + std::cout << i << " : " << signal_name(i) << " : " << sigs[i] << " vs: " << get_single_signal(pC,i) << std::endl; + } + + + return 1; diff --git a/output/blah.xml b/output/blah.xml deleted file mode 100644 index 0cb76581d..000000000 --- a/output/blah.xml +++ /dev/null @@ -1,1538 +0,0 @@ - - - -400 - 400 - -400 - 400 - -10 - 10 - 20 - 20 - 20 - true - - - - 10080 - min - micron - - 0.01 - 0.1 - 6 - - - - 6 - - - - output - - - 180 - true - - - - 30 - true - - - - false - - - - - false - true - false - - - - - - 100000.0 - 0.1 - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - - - - 100 - 0.1 - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - 1000 - 0.1 - - 0.0 - 0.0 - - - - - - - - - - - - 1000 - 0.01 - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - 1000 - 0.1 - - 0.0 - 0.0 - - - - - - - - - - - true - true - - - ./config/initial.mat - - - - ./config/dirichlet.mat - - - - - - - - - - 0.00028 - - - - - - 0.00028 - - 516 - - - 0.05 - 0 - 1.66667e-02 - 5.83333e-03 - 0 - 2.0 - - - - 0.0 - - 0 - 86400 - - - 0.05 - 0 - 1.66667e-02 - 5.83333e-03 - 0 - 2.0 - - - - - - 500 - 0.75 - 499 - 0.05 - 0.0045 - 0.0055 - 0 - 0 - 2.0 - - - - 0.04 - 20.0 - 1.25 - - .1 - .2 - .3 - .4 - .5 - .6 - .7 - - - 1.8 - 15.12 - - - - - 1 - 5 - 0.2 - - true - true - - false - resource - 1 - - - - true - false - - 1 - 0 - 0.1 - 0 - 0 - - - - - - - - - 0 - 1 - 30 - 0 - - - 0.0 - 0.0 - 0.0 - 100 - - - 0 - 0.0 - 0.0 - 1 - - - 0.0 - 0.0 - 0.0 - 0.0 - - - 0.0 - 0.0 - 0.0 - 0.0 - - - - 0 - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - 0 - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - 0.15 - 0.075 - 0.15 - 0.25 - 0.5 - 0.0 - 0.0 - 0.0 - 0.0 - 36 - 100 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - - - - - - - - 0 - - - - - - 0 - - 516 - - - 0.05 - 0 - 1.66667e-02 - 5.83333e-03 - 0 - 2.0 - - - - 0.0 - - 0 - 86400 - - - 0.05 - 0 - 1.66667e-02 - 5.83333e-03 - 0 - 2.0 - - - - - - 2494 - 0.75 - 540 - 0.05 - 0.0045 - 0.0055 - 0 - 0 - 2.0 - - - - 0.4 - 10.0 - 1.25 - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 1.8 - 15.12 - - - - - 1 - 1 - .5 - - false - true - - false - debris - 1 - - - - false - false - - 0 - 0 - 0 - 0 - 0 - - - - - - - - - 1000 - 1 - 0 - 0 - - - 0.0 - 0.0 - 0 - 0.0 - - - 0.0 - 0.0 - 0 - 0.0 - - - 0.0 - 0.0 - 0.0 - 0.0 - - - 0.0 - 0.0 - 0.0 - 0.0 - - - - 0 - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - 0 - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - 0.15 - 0.075 - 0.15 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - - - - - - - - 0.002 - - - - - - 5.3e-08 - - 516 - - - 0.05 - 0 - 1.66667e-02 - 5.83333e-03 - 0 - 2.0 - - - - 0.0 - - 0 - 86400 - - - 0.05 - 0 - 1.66667e-02 - 5.83333e-03 - 0 - 2.0 - - - - - - 2494 - 0.75 - 540 - 0.05 - 0.0045 - 0.0055 - 0 - 0 - 2.0 - - - - 0.4 - 10.0 - 1.25 - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 1.8 - 15.12 - - - - - 1 - 1 - .5 - - false - true - - false - debris - 1 - - - - false - false - - 0 - 0 - 0 - 0 - 0 - - - - - - - - - 0 - 1 - 1 - 0 - - - 0.0 - 0.0 - 0 - 0.0 - - - 0.0 - 0.0 - 0.0 - 0.0 - - - 0.0 - 0.0 - 0.0 - 0.0 - - - 0.0 - 0.0 - 0.0 - 0.0 - - - - 0 - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - 0 - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - 0 - 0 - 0 - 0.0001 - 0 - 0 - 0 - - - - - - 0.15 - 0.075 - 0.15 - 0.0 - 0.0 - 0.4 - 100 - 0.1 - 0.1 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - - - - - - - - 5.3e-4 - - - - - - 5.3e-05 - - 516 - - - 0.05 - 0 - 1.66667e-02 - 5.83333e-03 - 0 - 2.0 - - - - 0.0 - - 0 - 86400 - - - 0.05 - 0 - 1.66667e-02 - 5.83333e-03 - 0 - 2.0 - - - - - - 2494 - 0.75 - 540 - 0.05 - 0.0045 - 0.0055 - 0 - 0 - 2.0 - - - - 0.4 - 10.0 - 1.25 - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 1.8 - 15.12 - - - - - 1 - 1 - .5 - - false - true - - false - debris - 1 - - - - false - false - - 0 - 0 - 0 - 0 - 0 - - - - - - - - - 0 - 1 - 10 - 0 - - - 0.0 - 0.0 - 0 - 0.0 - - - 0.0 - 0.0 - 0.0 - 0.0 - - - 0.0 - 0.0 - 0.0 - 0.0 - - - 0.0 - 0.0 - 0.0 - 0.0 - - - - 0 - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - 0 - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - 0.15 - 0.075 - 0.15 - 0.0 - 0.0 - 0.2 - 100 - 0.0 - 0.0 - 0.0 - 0.0 - 0.5 - 0.0 - 0.0 - 0.0 - 0.0 - - - - - - - - 0 - - - - - - 0 - - 516 - - - 0.05 - 0 - 1.66667e-02 - 5.83333e-03 - 0 - 2.0 - - - - 0.0 - - 0 - 86400 - - - 0.05 - 0 - 1.66667e-02 - 5.83333e-03 - 0 - 2.0 - - - - - - 3000 - 0.75 - 600 - 0.05 - 0.045 - 0.0055 - 0 - 0 - 2.0 - - - - 0.04 - 10.0 - 1.25 - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 1.8 - 15.12 - - - - - 1 - 5 - 0.1 - - true - true - - false - debris - 1 - - - - true - false - - 0 - 0 - 1 - 0 - 0.1 - - - - - - - - - 0 - 1 - 5 - 0 - - - 0.0 - 0.0 - 0.0 - 0 - - - 0.0 - 0.0 - 0.0 - 0 - - - 0.0 - 1.0 - 0 - 0.0 - - - 0.0 - 0.0 - 5 - 0.0 - - - - 0.05 - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - 0 - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - 0.15 - 0.075 - 0.15 - 0.05 - 0.01 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.005 - 0.1 - 1 - 0 - - - - - - - - 0 - - - - - - 0 - - 516 - - - 0.05 - 0 - 1.66667e-02 - 5.83333e-03 - 0 - 2.0 - - - - 0.0 - - 0 - 86400 - - - 0.05 - 0 - 1.66667e-02 - 5.83333e-03 - 0 - 2.0 - - - - - - 3000 - 0.75 - 600 - 0.05 - 0.0045 - 0.0055 - 0 - 0 - 2.0 - - - - 0.04 - 10.0 - 1.25 - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 1.8 - 15.12 - - - - - 1 - 5 - 0.1 - - true - true - - true - pro-inflammatory - 1 - - - - false - false - - 0 - 0 - 0 - 0 - 0 - - - - - - - - - 0 - 1 - 5 - 0 - - - 0.0 - 0.0 - 0.0 - 0 - - - 0.0 - 0.0 - 0.0 - 0 - - - 0.0 - 0.0 - 1 - 0.0 - - - 0.0 - 0.0 - 0 - 0.0 - - - - 0 - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0.05 - 0 - 0 - 0 - 0 - 0 - 0 - - 0 - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - 0.15 - 0.075 - 0.15 - 0.0 - 0.5 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - - - - - - - - 0 - - - - - - 0 - - 516 - - - 0.05 - 0 - 1.66667e-02 - 5.83333e-03 - 0 - 2.0 - - - - 0.0 - - 0 - 86400 - - - 0.05 - 0 - 1.66667e-02 - 5.83333e-03 - 0 - 2.0 - - - - - - 1000 - 0.75 - 200 - 0.05 - 0.045 - 0.0055 - 0 - 0 - 2.0 - - - - 0.04 - 10.0 - 1.25 - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 1.8 - 15.12 - - - - - 1 - 5 - 0.1 - - true - true - - true - pro-inflammatory - 1 - - - - false - false - - 0 - 0 - 0 - 0 - 0 - - - - - - - - - 0 - 1 - 5 - 0 - - - 0.0 - 0.0 - 0.0 - 0 - - - 0.0 - 0.0 - 0.0 - 0 - - - 0.0 - 0.0 - 1 - 0.0 - - - 0.0 - 0.0 - 0 - 0.0 - - - - 0 - - 0.05 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - 0 - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - 0.15 - 0.075 - 0.15 - 0.0 - 0.5 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - - - - - - - - - cells.csv - - - - - 0 - 50 - 400 - 40 - 20 - 50 - 50 - 50 - 0.0075 - 200 - - 5 - - - - diff --git a/output/initial.svg b/output/initial.svg deleted file mode 100644 index c06d656fe..000000000 --- a/output/initial.svg +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - Current time: 0 days, 0 hours, and 0.00 minutes, z = 0.00 μm - - - 35 agents - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 200 μm - - - 0 days, 0 hours, 0 minutes, and 0.8058 seconds - - - diff --git a/output/initial.xml b/output/initial.xml deleted file mode 100644 index 8e0170249..000000000 --- a/output/initial.xml +++ /dev/null @@ -1,130 +0,0 @@ - - - - - BioFVM - 1.1.7 - http://BioFVM.MathCancer.org - - - - - - 0.000000 - 0.800728 - 2022-05-04T21:25:48Z - 2022-05-04T21:25:48Z - - - - - -400.000000 -400.000000 -10.000000 400.000000 400.000000 10.000000 - -390.000000 -370.000000 -350.000000 -330.000000 -310.000000 -290.000000 -270.000000 -250.000000 -230.000000 -210.000000 -190.000000 -170.000000 -150.000000 -130.000000 -110.000000 -90.000000 -70.000000 -50.000000 -30.000000 -10.000000 10.000000 30.000000 50.000000 70.000000 90.000000 110.000000 130.000000 150.000000 170.000000 190.000000 210.000000 230.000000 250.000000 270.000000 290.000000 310.000000 330.000000 350.000000 370.000000 390.000000 - -390.000000 -370.000000 -350.000000 -330.000000 -310.000000 -290.000000 -270.000000 -250.000000 -230.000000 -210.000000 -190.000000 -170.000000 -150.000000 -130.000000 -110.000000 -90.000000 -70.000000 -50.000000 -30.000000 -10.000000 10.000000 30.000000 50.000000 70.000000 90.000000 110.000000 130.000000 150.000000 170.000000 190.000000 210.000000 230.000000 250.000000 270.000000 290.000000 310.000000 330.000000 350.000000 370.000000 390.000000 - 0.000000 - - initial_mesh0.mat - - - - - - - 100000.000000 - 0.100000 - - - - - - 100.000000 - 0.100000 - - - - - - 1000.000000 - 0.100000 - - - - - - 1000.000000 - 0.010000 - - - - - - 1000.000000 - 0.100000 - - - - - initial_microenvironment0.mat - - - - - - - - - initial_cells.mat - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - initial_cells_physicell.mat - - - - - - diff --git a/output/initial_cells.mat b/output/initial_cells.mat deleted file mode 100644 index 6adf8ff2285f4b9fe80829b063737492027e5629..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5632 zcmd7W+e?#S90%~9V4$HiYiNWsF%^;Wluq+F$&1d;m^wUeYR)n9IOol@*A613d7vVx z3o{`I3&n~NBo9pJgd$N?5++g+CIR$jp(Iq_f@HAF2a4`@JME7>QS^K#?oBKI31C2Uj$ssU*~3<&_B06X=!7`N4PH% zu58Ejm=&%OOYP`}{YAJh8b0ZQUr7mkwyB<5^7F_=xGx5twB7Ub7WB~2*+0#U(|N(` zFBUH8i>j*y?R!nT;%)oiUbqYcZQo9#BOhu*8qi#XuWuYYBafdO6VUZOy@B;;F2a4X zE3YCrxRqg_j!IJ0V&)>;mk7_ZIkQQN&UWv3<8AMcB)H~6of$T?r0f4+MspGV{OyOQ z*KK?tudl%;Kd1oBMYu0nL!{FiE}0nCS^ufL5zVFPj)t2AoTlLVJ->EMn$U{T%`fDzxEm*p@s-e1!Wl;7Y4|e^Xvx z>B^7z!;I&NU*Al)YGzBF)#&9&wZGNNd|7ZslwR&=M~@ez-!q`O2w&f9c- diff --git a/output/initial_cells_physicell.mat b/output/initial_cells_physicell.mat deleted file mode 100644 index 18aa18718bd061a09266527b0b5b9303bcde6233..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24385 zcmdU%dyrGr9mkIyor$eZqh)lbBbxC+GgjgHf)yWJTW5^cO4L;%2nIn3g=%;$R1v~M zCMu6Wt;S;8NUcUi8wa&%r`l_wvZ!FRTGvN4r9M)v&i#YYZ98^)lHczaa=*^)Njo~; zduG_rob$cEyLW&2ntl4K9Ebe$kw3npId&M%C)cIx&!7J1)R&Zs17o)x zKjovPO2sawJOOmixti({UeXoq;qSkf2f(Ge7js>omz4`?-T+FuDR;Rpei5ISDfNDN z_FOu?3{?A2r74fyb!Dp`y}*-NW9vBL7Uov&PmNh;%2oRDTQ((^F==N0+Vm#($sMET z=(^Mai`Vpd>%-{n6!sP<-rAEX&j79Q^f+gL)Wf~L%KTH_itp@6oM|yLKst|7#+*IP z0NeGjF2`k)>@BeEEv%P$F1h*%dD{aFhPTRAs#4g0&smy>FL~keroSB{gx2%)D5$@HLi;+pz{c8%Xz-SOX;#Hk8*tiDD{4Ml&>QJ6faGAX)}3S z1qQ?0h^^G%u>QwVnwix0<0or&j1YROrt^La6mN4G%FDpQV)AMLNZshd+hy#fc*;yN z^FZmcDKA{d*9DY%zr5DZ*R#+|@z#{r?;&r8fWh!KYAfZue9*@UN2z^B4<9#OvtxwN z+uAhpatJ8iW_i5`Ebx9f0Hki1y)7(azkoHKM}ENmFr~|;JjwfI9w_yGd6d6T0w~^^ za;HMx4g!PWZS(a^?frv~?RWH@)-k(BF4XgmvH0gam)B47`UhT@)pK-Q{-=EWXZN~{ zuEunqFW0A3>>Bbm0TgfDe#(0mdRcgYy#vzsH+!4BhwAgdWSQ52bY7)QdEr66E}+!= z<+UwT7kR`>@z#{5A0lrT0sp(Va#f!9>4; z3k-(0huKP<{_)B&*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10FB3rVHp%OYfa&Mh4}~9iRG$Kt z_<1l0lrEd{*b97Kpw#>2r9V;KAh7K%tjlqdt50aZ?EwbE+g@AWVIBD0S(j?2*KgQ1 z%aMMx7(#E;6Uo~=P`q{0yx#)ruh8S%!+r^=A7*dsHLic&%QUYSfzoGFUYF~U{hTTF zetDWbF9O9&Q=Z$8Unc;A;q9rm{=E48Ten>5D0R)l{}|Q$eOSk6dn>Pdgz*2D1?Y8I zWjc8|2o!IlS5e*ztpAREbG)Q(_?eu+% zz_z!rF2_k8`wDs63-t3=u7}v|`(ECv?q_3d{dt;YcZ|GJGyU(w_dDBBog;+a7G{!{ zRiJolO`|*otg}}=&$4$+YDX8|vIji_T+fVcqj?G_Z8qiU9qb=a>izQ4<5V{Y6fceW z!Q^cf7z}Suv-Rf~Gq2p)yids8`oXAk9qC7lA@nvohrBET#am|qpztaFq&g;fzoGFURy%-k)>Wr zy>&OG!-om;ZC%HO|yzK!7!`m}#rH-7m_J)O;n=c&uU|O?dgwR{HlDv!q#anv? zZ8l-oyrTkhMVlxVd{%}zpSu?ysQGn+uTyh z%fRF^@+uFcpU3QNZ5?}A@G{Bkc_5uv|J@H*m*XUl-a_X~08M!`&viiY)|BUtAa9Gn zV0b&u*1x}fbK{iD9i_%z@WdK;-ywwFsx`dd0>xXG*L&8|al*oCdYlJ< zKP+6L=N%)2-dY9nF$ENFYpW?A0_L8g$F~ZkZkWAwo~HUCpsLY&FRM`S?XZ@zR)|#P_$rKzOT~fA`i| zeDb=4qg3&Y7hj#I=N%)2-WF~nFRMWDHg`MaWuV%{-U6u`U3j~L{RBF^PYwa4%ceZX d`(hO+^?teYd%B(>pm=M_bEEkF7WhSb`yUYkR#pH2 diff --git a/output/initial_mesh0.mat b/output/initial_mesh0.mat deleted file mode 100644 index eb7d75559395ec6a7b71c82783672f6a107e3ba8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 51224 zcmajnL2lee8h}wP26GNCa*lx8EVIcb8zF#^L6AW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E3<`X{e{^7<#QfAacA zU;U%6{>kefef5vN`e(mgKlHW!qp$wS>mPmfkG}dRuYdCTC$E3<`X{e{^7<#QfAYE^ zZ-3i!KkA>n{>kf~y#C4SpM5`Gaz};-$?KoI{>kf~y#C4SpS=Fb>z};- z$?KoI{>kefef5vN`X{e{^wmH5>YshPoPVwVIDYj{UjOK;fArNqdHs{uKY9I=*FSmv zlh;3a{gc-}d0mmWzwNm%^-o^^Qp|Lptml6oEI*Y|F%|K#;gUjO9vPhS7zUw^-T z{q;}d>z};-$?KoI{>kf~y#C4SAAR+YzWOJxfArNq`s$y3yPSXZkKJ;cmMB?ty6z&`}tM<)A;^fdV2T& zbo}-64~}2o|I)kvhvU~jjqm3l^zQ%R`1McY>z};-$?KoI{>kf~y#C4SpS=Fb>z}+X z$=lzyN!t9ZfAacg-;YCfoY%*{_WGys^-uo%@%s4nPvh&Ky#C4SpS=Fb>z};-$?KoI z{>kefz59QEZk^g=+x+S0zZzfv=-vOr@%#BN$FKg;yZ@)-cmEGw|8)HNNALb0j$i*Y zzW&MUpS=Fb>z};-$?KoI{>kf~y#C4SpS*6#+uycH-u$kA_Wc;r?>mog{U@(~^7du*E@^-tsLAHDm3IDY-( z_|-r9>L0!Pe|Y}-r}6cV-u*uuzy4`_{gc-}dHs{uKY9I=*FSmvlh;3a{gc-}dHs{u OHF^8nb`iYH|NjBw#O*Zz diff --git a/output/initial_microenvironment0.mat b/output/initial_microenvironment0.mat deleted file mode 100644 index c6e221639a732677669f41dd0c21526ee5b2d1a6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 115247 zcmb{5F^(L^8GzA^4EPLA82B7krwW}Yap1KKLXbd-0!f()c@*BneH0!+NARkrzJK7r z2Bu#V(6&cbKUB?5SAQ(EmQPPlPk(&*Yx~2?mzQ6Edim?eU*3H9{{27y@#gj4fBgQR z@7})t>0jT!d;8OmuYdY*{4>wL?*DZ>Uc7wS{=MD)=Wk#2xBl<()yMt#|MU8XA9cR` za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gy4(woBIM_Mdq?tDn`WpV?Xc%+Bg(b?Rqz>SuN8XLaglb?Rqz>SuN8XLaglb?Rqz z>OyrozvJ0Hte@4XpVg_K-MRHx^E>eSEb)X(aCS^ca|{j5&?tWN!` zPW`M-{j5&?tWN!`PW{Zz>SuO({`r@!rRO+4`rixJ&pMu`o`2Ty^!zhBxA(>8b&=Ea z&p5C8S?AS%KgdqcKjXaWXB|)dtWN!`PW`M-{j5&?tWN!`PW`M-{j5&?tWJHYPUm-Q zv43=(ubeSEb)X(bF&+63A>eSEb)X(bFsp@oo$8J84 z-goL}clKild1uGd{o%&gw`dOX& zS)KZsot}UGb!*8uj*qTm^|OwrerBiVpK)IGGmmHWGdn&1tn=#mXLRakomc(LPR~E% zyy|BiPyMV;{j5&?tWN!`PW`M-{j5&?tWN!`PW`M-{j5&?tWLeFPUm;*CicMn>pv!Y BT|EE* diff --git a/output/legend.svg b/output/legend.svg deleted file mode 100644 index 7bc9910ef..000000000 --- a/output/legend.svg +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - bacteria - - - - - blood vessel - - - - - stem - - - - - differentiated - - - - - macrophage - - - - - CD8+ T cell - - - - - neutrophil - - From a0b9326d94c3e4e85267b1034985084a685acc24 Mon Sep 17 00:00:00 2001 From: Paul Macklin Date: Thu, 5 May 2022 09:14:03 -0400 Subject: [PATCH 08/10] QC check on signals --- core/PhysiCell_signal_behavior.cpp | 168 +-------------- main-blah.cpp | 327 +++++++++++++++++++++++++++++ 2 files changed, 333 insertions(+), 162 deletions(-) create mode 100644 main-blah.cpp diff --git a/core/PhysiCell_signal_behavior.cpp b/core/PhysiCell_signal_behavior.cpp index fe9d6108a..5a5e3199a 100644 --- a/core/PhysiCell_signal_behavior.cpp +++ b/core/PhysiCell_signal_behavior.cpp @@ -509,7 +509,6 @@ std::string signal_name( int i ) int find_parameter_index( std::string response_name ) { auto search = behavior_to_int.find( response_name ); - // safety first! if( search != behavior_to_int.end() ) { return search->second; } return -1; @@ -543,35 +542,25 @@ std::vector get_signals( Cell* pCell ) signals.begin()+start_substrate_ind ); // internalized substrates - int ind = m; static int start_int_substrate_ind = find_signal_index( "intracellular " + microenvironment.density_names[0] ); std::copy( pCell->phenotype.molecular.internalized_total_substrates.begin() , pCell->phenotype.molecular.internalized_total_substrates.end(), - signals.begin()+start_int_substrate_ind); // m ); + signals.begin()+start_int_substrate_ind); for( int i=0; i < m ; i++ ) { signals[i+start_int_substrate_ind] /= pCell->phenotype.volume.total; } // substrate gradients - ind = 2*m; // int ind = m; static int start_substrate_grad_ind = find_signal_index( microenvironment.density_names[0] + " gradient"); for( int i=0; i < m ; i++ ) - { - signals[start_substrate_grad_ind+i] = norm( pCell->nearest_gradient(i) ); - // signals[ind] /= signal_scales[ind]; - ind++; - } + { signals[start_substrate_grad_ind+i] = norm( pCell->nearest_gradient(i) ); } // mechanical pressure static int pressure_ind = find_signal_index( "pressure"); signals[pressure_ind] = pCell->state.simple_pressure; - // signals[ind] / signal_scales[ind]; - ind++; // cell volume static int volume_ind = find_signal_index( "volume"); signals[volume_ind] = pCell->phenotype.volume.total; - // signals[ind] / signal_scales[ind]; - ind++; // physical contact with cells (of each type) // increment signals @@ -589,33 +578,25 @@ std::vector get_signals( Cell* pCell ) signals[contact_ind+nCT] += 1; } - ind += n; // physical contact with live cells static int live_contact_ind = find_signal_index( "contact with live cell"); signals[live_contact_ind] = live_cells; - // signals[ind] /= signal_scales[ind]; - ind++; // physical contact with dead cells static int dead_contact_ind = find_signal_index( "contact with dead cell"); signals[dead_contact_ind] = dead_cells; - // signals[ind] /= signal_scales[ind]; - ind++; // physical contact with basement membrane (not implemented) static int BM_contact_ind = find_signal_index( "contact with basement membrane"); signals[BM_contact_ind] = (int) pCell->state.contact_with_basement_membrane; - ind++; // damage static int damage_ind = find_signal_index( "damage"); signals[damage_ind] = pCell->state.damage; - ind++; // integrated total attack time static int tot_attack_ind = find_signal_index( "total attack time"); signals[tot_attack_ind] = pCell->state.total_attack_time; - ind++; // rescale signals /= signal_scales; @@ -698,13 +679,12 @@ double get_single_signal( Cell* pCell, int index ) if( index < 0 ) { std::cout<< "Why would you ask for array[-1]? Why? WHY???? That's it, I quit." << std::endl; - exit(-1832443); return -9e9; } // first m entries: extracellular concentration static int start_substrate_ind = find_signal_index( microenvironment.density_names[0] ); - if( start_substrate_ind <= index && index < m ) + if( start_substrate_ind <= index && index < start_substrate_ind + m ) { out = pCell->nearest_density_vector()[index-start_substrate_ind]; out /= signal_scales[index]; @@ -731,7 +711,7 @@ double get_single_signal( Cell* pCell, int index ) } // mechanical pressure - static int pressure_ind = find_signal_index( "pressure"); + static int pressure_ind = find_signal_index( "pressure" ); if( index == pressure_ind ) { out = pCell->state.simple_pressure; @@ -751,7 +731,7 @@ double get_single_signal( Cell* pCell, int index ) // physical contact with cells (of each type) // individual contact signals are a bit costly static int contact_ind = find_signal_index( "contact with " + cell_definitions_by_type[0]->name ); - if( contact_ind <= index && index < contact_ind+n+2 ) + if( contact_ind <= index && index < contact_ind + n+2 ) { std::vector counts( n , 0 ); // process all neighbors @@ -768,7 +748,7 @@ double get_single_signal( Cell* pCell, int index ) counts[nCT] += 1; } - if( index < contact_ind+n ) + if( index < contact_ind + n ) { out = counts[index-contact_ind]; out /= signal_scales[index]; @@ -825,140 +805,6 @@ double get_single_signal( Cell* pCell, int index ) return 0.0; } -double get_single_signal_old( Cell* pCell, int index ) -{ - static int m = microenvironment.number_of_densities(); - static int n = cell_definition_indices_by_name.size(); - - double out = 0.0; - - if( index < 0 ) - { - std::cout<< "Why would you ask for array[-1]? Why? WHY???? That's it, I quit." << std::endl; - exit(-1832443); - return -9e9; - } - - int ind = index; - // first m entries: extracellular concentration - if( 0 <= ind && ind < m ) - { - out = pCell->nearest_density_vector()[ind]; - out /= signal_scales[index]; - return out; - } - - // second m entries: intracellular concentration - ind -= m; - if( ind < m ) - { - out = pCell->phenotype.molecular.internalized_total_substrates[ind]; - out /= pCell->phenotype.volume.total; - out /= signal_scales[index]; - return out; - } - - // next m entries: gradients - ind -= m; - if( ind < m ) - { - out = norm( pCell->nearest_gradient(ind) ); - out /= signal_scales[index]; - return out; - } - - ind -= m; - // mechanical pressure - if( ind == 0 ) - { - out = pCell->state.simple_pressure; - out /= signal_scales[index]; - return out; - } - - ind -= 1; - // cell volume - if( ind == 0 ) - { - out = pCell->phenotype.volume.total; - out /= signal_scales[index]; - return out; - } - - ind -=1; - // physical contact with cells (of each type) - // individual contact signals are a bit costly - if( ind < n+2 ) - { - std::vector counts( n , 0 ); - // process all neighbors - int dead_cells = 0; - int live_cells = 0; - for( int i=0; i < pCell->state.neighbors.size(); i++ ) - { - Cell* pC = pCell->state.neighbors[i]; - if( pC->phenotype.death.dead == true ) - { dead_cells++; } - else - { live_cells++; } - int nCT = cell_definition_indices_by_type[pC->type]; - counts[nCT] += 1; - } - - if( ind < n ) - { - out = counts[ind]; - out /= signal_scales[index]; - return out; - } - if( ind == n ) - { - out = live_cells; - out /= signal_scales[index]; - return out; - } - - // ind == n+1 - out = dead_cells; - out /= signal_scales[index]; - return out; - } - - // contact with BM - ind -= (n+2); - if( ind == 0 ) - { - out = (double) pCell->state.contact_with_basement_membrane; - out /= signal_scales[index]; - return out; - } - - // damage - ind -= 1; - if( ind == 0 ) - { - out = pCell->state.damage; - out /= signal_scales[index]; - return out; - } - - // integrated total attack time - ind -= 1; - if( ind == 0 ) - { - out = pCell->state.total_attack_time; - out /= signal_scales[index]; - return out; - } - - // unknown after here ! - - std::cout << "Warning: Requested unknown signal number " << index << "!" << std::endl - << " Returning 0.0, but you should fix this!" << std::endl << std::endl; - - return 0.0; -} - double get_single_signal( Cell* pCell, std::string name ) { return get_single_signal( pCell, find_signal_index(name) ); } @@ -971,8 +817,6 @@ std::string behavior_name( int i ) return "not found"; } -/* start here */ - std::vector create_empty_behavior_vector() { std::vector parameters( int_to_behavior.size() , 0.0 ); diff --git a/main-blah.cpp b/main-blah.cpp new file mode 100644 index 000000000..ac3303f1d --- /dev/null +++ b/main-blah.cpp @@ -0,0 +1,327 @@ +/* +############################################################################### +# If you use PhysiCell in your project, please cite PhysiCell and the version # +# number, such as below: # +# # +# We implemented and solved the model using PhysiCell (Version x.y.z) [1]. # +# # +# [1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin, # +# PhysiCell: an Open Source Physics-Based Cell Simulator for Multicellu- # +# lar Systems, PLoS Comput. Biol. 14(2): e1005991, 2018 # +# DOI: 10.1371/journal.pcbi.1005991 # +# # +# See VERSION.txt or call get_PhysiCell_version() to get the current version # +# x.y.z. Call display_citations() to get detailed information on all cite-# +# able software used in your PhysiCell application. # +# # +# Because PhysiCell extensively uses BioFVM, we suggest you also cite BioFVM # +# as below: # +# # +# We implemented and solved the model using PhysiCell (Version x.y.z) [1], # +# with BioFVM [2] to solve the transport equations. # +# # +# [1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin, # +# PhysiCell: an Open Source Physics-Based Cell Simulator for Multicellu- # +# lar Systems, PLoS Comput. Biol. 14(2): e1005991, 2018 # +# DOI: 10.1371/journal.pcbi.1005991 # +# # +# [2] A Ghaffarizadeh, SH Friedman, and P Macklin, BioFVM: an efficient para- # +# llelized diffusive transport solver for 3-D biological simulations, # +# Bioinformatics 32(8): 1256-8, 2016. DOI: 10.1093/bioinformatics/btv730 # +# # +############################################################################### +# # +# BSD 3-Clause License (see https://opensource.org/licenses/BSD-3-Clause) # +# # +# Copyright (c) 2015-2022, Paul Macklin and the PhysiCell Project # +# All rights reserved. # +# # +# Redistribution and use in source and binary forms, with or without # +# modification, are permitted provided that the following conditions are met: # +# # +# 1. Redistributions of source code must retain the above copyright notice, # +# this list of conditions and the following disclaimer. # +# # +# 2. Redistributions in binary form must reproduce the above copyright # +# notice, this list of conditions and the following disclaimer in the # +# documentation and/or other materials provided with the distribution. # +# # +# 3. Neither the name of the copyright holder nor the names of its # +# contributors may be used to endorse or promote products derived from this # +# software without specific prior written permission. # +# # +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # +# POSSIBILITY OF SUCH DAMAGE. # +# # +############################################################################### +*/ + +#include +#include +#include +#include +#include +#include +#include + +#include "./core/PhysiCell.h" +#include "./modules/PhysiCell_standard_modules.h" + +// put custom code modules here! + +#include "./custom_modules/custom.h" + +using namespace BioFVM; +using namespace PhysiCell; + +int main( int argc, char* argv[] ) +{ + // load and parse settings file(s) + + bool XML_status = false; + char copy_command [1024]; + if( argc > 1 ) + { + XML_status = load_PhysiCell_config_file( argv[1] ); + sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); + } + else + { + XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); + sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); + } + if( !XML_status ) + { exit(-1); } + + // copy config file to output directry + system( copy_command ); + + // OpenMP setup + omp_set_num_threads(PhysiCell_settings.omp_num_threads); + + // time setup + std::string time_units = "min"; + + /* Microenvironment setup */ + + setup_microenvironment(); // modify this in the custom code + + /* PhysiCell setup */ + + // set mechanics voxel size, and match the data structure to BioFVM + double mechanics_voxel_size = 30; + Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, mechanics_voxel_size ); + + /* Users typically start modifying here. START USERMODS */ + + create_cell_types(); + + setup_tissue(); + + /* Users typically stop modifying here. END USERMODS */ + + // set MultiCellDS save options + + set_save_biofvm_mesh_as_matlab( true ); + set_save_biofvm_data_as_matlab( true ); + set_save_biofvm_cell_data( true ); + set_save_biofvm_cell_data_as_custom_matlab( true ); + + // save a simulation snapshot + + char filename[1024]; + sprintf( filename , "%s/initial" , PhysiCell_settings.folder.c_str() ); + save_PhysiCell_to_MultiCellDS_xml_pugi( filename , microenvironment , PhysiCell_globals.current_time ); + + // save a quick SVG cross section through z = 0, after setting its + // length bar to 200 microns + + PhysiCell_SVG_options.length_bar = 200; + + // for simplicity, set a pathology coloring function + + std::vector (*cell_coloring_function)(Cell*) = my_coloring_function; + + sprintf( filename , "%s/initial.svg" , PhysiCell_settings.folder.c_str() ); + SVG_plot( filename , microenvironment, 0.0 , PhysiCell_globals.current_time, cell_coloring_function ); + + sprintf( filename , "%s/legend.svg" , PhysiCell_settings.folder.c_str() ); + create_plot_legend( filename , cell_coloring_function ); + + display_citations(); + + // set the performance timers + + BioFVM::RUNTIME_TIC(); + BioFVM::TIC(); + + std::ofstream report_file; + if( PhysiCell_settings.enable_legacy_saves == true ) + { + sprintf( filename , "%s/simulation_report.txt" , PhysiCell_settings.folder.c_str() ); + + report_file.open(filename); // create the data log file + report_file<<"simulated time\tnum cells\tnum division\tnum death\twall time"< sigs = get_signals( pC ); + std::cout << sigs << std::endl; + + std::vector b0 = get_base_behaviors( pC ); + + for( int i=0; i < b0.size(); i++ ) + { + std::vector indices = {i}; + std::vector params = {i + 0.0 }; + b0[i] = i + 0.00001; + // set_selected_behaviors(pC, indices, params ); + // set_single_behavior( pC, i , i+0.0 ); + } + + set_behaviors( pC, b0 ); + + b0 = get_behaviors( pC ); + + + std::cout.precision(10); + + for( int i=0; i < b0.size(); i++ ) + { + std::cout << i << " : " << behavior_name(i) << " : " << b0[i] << std::endl; + } + + // now let's test signals + int nV = pC->get_current_voxel_index(); + for( int i=0 ; i < microenvironment.number_of_densities() ; i++ ) + { + microenvironment(nV)[i] = i + 0.1; + pC->phenotype.molecular.internalized_total_substrates[i] = (-i - 0.1)*pC->phenotype.volume.total; +/* + pC->phenotype.secretion.secretion_rates[i] = 10*i+0.01; + pC->phenotype.secretion.saturation_densities[i] = 20*i+0.01; + pC->phenotype.secretion.uptake_rates[i] = 30*i+0.01; + pC->phenotype.secretion.net_export_rates[i] = 40*i+0.01; + + pC->phenotype.motility.chemotactic_sensitivities[i] = 50*i + 0.001; +*/ + } + + int n = cell_definitions_by_index.size(); + std::vector cell_probs( n , 1.0 / ( n + 0.0 ) ); + + for( int i=1; i < 100 ; i++ ) + { + Cell* pC1 = (*all_cells)[i]; + + // choose type + int nNT = choose_event( cell_probs ); + // transform cell + pC1->convert_to_cell_definition( *cell_definitions_by_index[nNT] ); + // dead or alive? + if( UniformRandom() <= 0.5 ) + { pC1->phenotype.death.dead = true; } + // add it to neighbors of pC + pC->state.neighbors.push_back( pC1 ); + } + + std::cout << std::endl; + sigs = get_signals( pC ); + for( int i=0; i < sigs.size(); i++ ) + { + std::cout << i << " : " << signal_name(i) << " : " << sigs[i] << " vs: " << get_single_signal(pC,i) << std::endl; + } + + + + + return 1; + + + try + { + while( PhysiCell_globals.current_time < PhysiCell_settings.max_time + 0.1*diffusion_dt ) + { + // save data if it's time. + if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_full_save_time ) < 0.01 * diffusion_dt ) + { + display_simulation_status( std::cout ); + if( PhysiCell_settings.enable_legacy_saves == true ) + { + log_output( PhysiCell_globals.current_time , PhysiCell_globals.full_output_index, microenvironment, report_file); + } + + if( PhysiCell_settings.enable_full_saves == true ) + { + sprintf( filename , "%s/output%08u" , PhysiCell_settings.folder.c_str(), PhysiCell_globals.full_output_index ); + + save_PhysiCell_to_MultiCellDS_xml_pugi( filename , microenvironment , PhysiCell_globals.current_time ); + } + + PhysiCell_globals.full_output_index++; + PhysiCell_globals.next_full_save_time += PhysiCell_settings.full_save_interval; + } + + // save SVG plot if it's time + if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_SVG_save_time ) < 0.01 * diffusion_dt ) + { + if( PhysiCell_settings.enable_SVG_saves == true ) + { + sprintf( filename , "%s/snapshot%08u.svg" , PhysiCell_settings.folder.c_str() , PhysiCell_globals.SVG_output_index ); + SVG_plot( filename , microenvironment, 0.0 , PhysiCell_globals.current_time, cell_coloring_function ); + + PhysiCell_globals.SVG_output_index++; + PhysiCell_globals.next_SVG_save_time += PhysiCell_settings.SVG_save_interval; + } + } + + // update the microenvironment + microenvironment.simulate_diffusion_decay( diffusion_dt ); + + // run PhysiCell + ((Cell_Container *)microenvironment.agent_container)->update_all_cells( PhysiCell_globals.current_time ); + + /* + Custom add-ons could potentially go here. + */ + + PhysiCell_globals.current_time += diffusion_dt; + } + + if( PhysiCell_settings.enable_legacy_saves == true ) + { + log_output(PhysiCell_globals.current_time, PhysiCell_globals.full_output_index, microenvironment, report_file); + report_file.close(); + } + } + catch( const std::exception& e ) + { // reference to the base of a polymorphic object + std::cout << e.what(); // information from length_error printed + } + + // save a final simulation snapshot + + sprintf( filename , "%s/final" , PhysiCell_settings.folder.c_str() ); + save_PhysiCell_to_MultiCellDS_xml_pugi( filename , microenvironment , PhysiCell_globals.current_time ); + + sprintf( filename , "%s/final.svg" , PhysiCell_settings.folder.c_str() ); + SVG_plot( filename , microenvironment, 0.0 , PhysiCell_globals.current_time, cell_coloring_function ); + + // timer + + std::cout << std::endl << "Total simulation runtime: " << std::endl; + BioFVM::display_stopwatch_value( std::cout , BioFVM::runtime_stopwatch_value() ); + + return 0; +} From e6c914b2e4829ddc01fd0c358db568cbb2b2a102 Mon Sep 17 00:00:00 2001 From: Paul Macklin Date: Thu, 5 May 2022 09:41:54 -0400 Subject: [PATCH 09/10] Behavior QC --- core/PhysiCell_signal_behavior.cpp | 100 +++++++++++++---------------- 1 file changed, 43 insertions(+), 57 deletions(-) diff --git a/core/PhysiCell_signal_behavior.cpp b/core/PhysiCell_signal_behavior.cpp index 5a5e3199a..80705c703 100644 --- a/core/PhysiCell_signal_behavior.cpp +++ b/core/PhysiCell_signal_behavior.cpp @@ -833,30 +833,29 @@ void set_behaviors( Cell* pCell , std::vector parameters ) // first m entries are secretion static int first_secretion_index = find_behavior_index( microenvironment.density_names[0] + " secretion" ); // 0; std::copy( parameters.begin()+first_secretion_index , - parameters.begin()+first_secretion_index+m , + parameters.begin()+first_secretion_index + m , pCell->phenotype.secretion.secretion_rates.begin() ); // next m entries are secretion targets static int first_secretion_target_index = find_behavior_index( microenvironment.density_names[0] + " secretion target" ); // m; std::copy( parameters.begin()+first_secretion_target_index , - parameters.begin()+first_secretion_target_index+m , + parameters.begin()+first_secretion_target_index + m , pCell->phenotype.secretion.saturation_densities.begin() ); // next m entries are uptake rates static int first_uptake_index = find_behavior_index( microenvironment.density_names[0] + " uptake" ); // 2*m; std::copy( parameters.begin()+first_uptake_index , - parameters.begin()+first_uptake_index+m , + parameters.begin()+first_uptake_index + m , pCell->phenotype.secretion.uptake_rates.begin() ); // next m entries are net export rates static int first_export_index = find_behavior_index( microenvironment.density_names[0] + " export" ); // 3*m; std::copy( parameters.begin()+first_export_index , - parameters.begin()+first_export_index+m , + parameters.begin()+first_export_index + m , pCell->phenotype.secretion.net_export_rates.begin() ); // cycle entry (exit from phase 0) and exit from up to 5 more phases static int first_cycle_index = find_behavior_index("exit from cycle phase 0" ); // 4*m; - int map_index = first_cycle_index; int max_cycle_index = pCell->phenotype.cycle.model().phases.size(); if( max_cycle_index > 6 ) { @@ -865,100 +864,87 @@ void set_behaviors( Cell* pCell , std::vector parameters ) << " Ignoring any later phase exit rates." << std::endl; } for( int i=0; i < max_cycle_index ; i++ ) - { pCell->phenotype.cycle.data.exit_rate( i ) = parameters[map_index+i]; } + { pCell->phenotype.cycle.data.exit_rate( i ) = parameters[first_cycle_index + i]; } static int apoptosis_index = pCell->phenotype.death.find_death_model_index( PhysiCell_constants::apoptosis_death_model ); static int necrosis_index = pCell->phenotype.death.find_death_model_index( PhysiCell_constants::necrosis_death_model ); - map_index = first_cycle_index+6; // 4*m + 6; - static int apoptosis_param_index = find_behavior_index( "apoptosis"); // apoptosis + static int apoptosis_param_index = find_behavior_index( "apoptosis"); pCell->phenotype.death.rates[apoptosis_index] = parameters[apoptosis_param_index]; // necrosis - map_index++; static int necrosis_param_index = find_behavior_index( "necrosis"); pCell->phenotype.death.rates[necrosis_index] = parameters[necrosis_param_index]; // migration speed - map_index++; static int migration_speed_index = find_behavior_index("migration speed"); pCell->phenotype.motility.migration_speed = parameters[migration_speed_index]; // migration bias - map_index++; static int migration_bias_index = find_behavior_index("migration bias"); pCell->phenotype.motility.migration_bias = parameters[migration_bias_index]; // migration persistence time - map_index++; static int migration_pt_index = find_behavior_index("migration persistence time"); pCell->phenotype.motility.persistence_time = parameters[migration_pt_index]; // chemotactic sensitivities static int first_chemotaxis_index = find_behavior_index( "chemotactic response to " + microenvironment.density_names[0] ); std::copy( parameters.begin()+first_chemotaxis_index , - parameters.begin()+first_chemotaxis_index+m , + parameters.begin()+first_chemotaxis_index + m , pCell->phenotype.motility.chemotactic_sensitivities.begin() ); // cell-cell adhesion - map_index++; static int cca_index = find_behavior_index("cell-cell adhesion"); - pCell->phenotype.mechanics.cell_cell_adhesion_strength= parameters[cca_index]; + pCell->phenotype.mechanics.cell_cell_adhesion_strength = parameters[cca_index]; // cell-cell "springs" - map_index++; static int cca_spring_index = find_behavior_index("cell-cell adhesion elastic constant"); pCell->phenotype.mechanics.attachment_elastic_constant = parameters[cca_spring_index]; // cell adhesion affinities static int first_affinity_index = find_behavior_index( "adhesive affinity to " + cell_definitions_by_type[0]->name ); std::copy( parameters.begin()+first_affinity_index , - parameters.begin()+first_affinity_index+n , + parameters.begin()+first_affinity_index + n , pCell->phenotype.mechanics.cell_adhesion_affinities.begin() ); // max relative maximum adhesion distance - - map_index += n; static int max_adhesion_distance_index = find_behavior_index("relative maximum adhesion distance"); pCell->phenotype.mechanics.relative_maximum_adhesion_distance = parameters[max_adhesion_distance_index]; // cell-cell repulsion - map_index++; static int ccr_index = find_behavior_index("cell-cell repulsion"); pCell->phenotype.mechanics.cell_cell_repulsion_strength = parameters[ccr_index]; // cell-BM adhesion - map_index++; static int cba_index = find_behavior_index("cell-BM adhesion"); pCell->phenotype.mechanics.cell_BM_adhesion_strength = parameters[cba_index]; // cell-BM repulsion - map_index++; static int cbr_index = find_behavior_index("cell-BM repulsion"); pCell->phenotype.mechanics.cell_BM_repulsion_strength = parameters[cbr_index]; // dead cell phagocytosis - map_index++; static int dead_phag_index = find_behavior_index("phagocytose dead cell"); pCell->phenotype.cell_interactions.dead_phagocytosis_rate = parameters[dead_phag_index]; // phagocytosis of each live cell type static int first_phagocytosis_index = find_behavior_index( "phagocytose " + cell_definitions_by_type[0]->name ); std::copy( parameters.begin()+first_phagocytosis_index , - parameters.begin()+first_phagocytosis_index+n , + parameters.begin()+first_phagocytosis_index + n , pCell->phenotype.cell_interactions.live_phagocytosis_rates.begin() ); // attack of each live cell type static int first_attack_index = find_behavior_index( "attack " + cell_definitions_by_type[0]->name ); std::copy( parameters.begin()+first_attack_index , - parameters.begin()+first_attack_index+n , + parameters.begin()+first_attack_index + n , pCell->phenotype.cell_interactions.attack_rates.begin() ); // fusion static int first_fusion_index = find_behavior_index( "fuse to " + cell_definitions_by_type[0]->name ); std::copy( parameters.begin()+first_fusion_index , - parameters.begin()+first_fusion_index+n , + parameters.begin()+first_fusion_index + n , pCell->phenotype.cell_interactions.fusion_rates.begin() ); // transformation @@ -1018,11 +1004,13 @@ void set_single_behavior( Cell* pCell, int index , double parameter ) // death rates + // apoptosis static int apoptosis_model_index = pCell->phenotype.death.find_death_model_index( PhysiCell_constants::apoptosis_death_model ); static int apoptosis_parameter_index = find_behavior_index( "apoptosis"); if( index == apoptosis_parameter_index ) { pCell->phenotype.death.rates[apoptosis_model_index] = parameter; return; } + // necrosis static int necrosis_model_index = pCell->phenotype.death.find_death_model_index( PhysiCell_constants::necrosis_death_model ); static int necrosis_parameter_index = find_behavior_index( "necrosis"); if( index == necrosis_parameter_index ) @@ -1269,22 +1257,22 @@ double get_single_behavior( Cell* pCell , int index ) // first m entries are secretion static int first_secretion_index = find_behavior_index( microenvironment.density_names[0] + " secretion" ); // 0; - if( index >= first_secretion_index && index < first_secretion_index+m ) + if( index >= first_secretion_index && index < first_secretion_index + m ) { return pCell->phenotype.secretion.secretion_rates[index-first_secretion_index]; } // next m entries are secretion targets static int first_secretion_target_index = find_behavior_index( microenvironment.density_names[0] + " secretion target" ); // m; - if( index >= first_secretion_target_index && index < first_secretion_target_index+m ) + if( index >= first_secretion_target_index && index < first_secretion_target_index + m ) { return pCell->phenotype.secretion.saturation_densities[index-first_secretion_target_index]; } // next m entries are uptake rates static int first_uptake_index = find_behavior_index( microenvironment.density_names[0] + " uptake" ); // 2*m; - if( index >= first_uptake_index && index < first_uptake_index+m ) + if( index >= first_uptake_index && index < first_uptake_index + m ) { return pCell->phenotype.secretion.uptake_rates[index-first_uptake_index]; } // next m entries are net export rates static int first_export_index = find_behavior_index( microenvironment.density_names[0] + " export" ); // 3*m; - if( index >= first_export_index && index < first_export_index+m ) + if( index >= first_export_index && index < first_export_index + m ) { return pCell->phenotype.secretion.net_export_rates[index-first_export_index]; } // cycle entry (exit from phase 0) and exit from up to 5 more phases @@ -1335,7 +1323,7 @@ double get_single_behavior( Cell* pCell , int index ) // chemotactic sensitivities static int first_chemotaxis_index = find_behavior_index( "chemotactic response to " + microenvironment.density_names[0] ); - if( index >= first_chemotaxis_index && index < first_chemotaxis_index+m ) + if( index >= first_chemotaxis_index && index < first_chemotaxis_index + m ) { return pCell->phenotype.motility.chemotactic_sensitivities[index-first_chemotaxis_index]; } // cell-cell adhesion @@ -1344,38 +1332,38 @@ double get_single_behavior( Cell* pCell , int index ) { return pCell->phenotype.mechanics.cell_cell_adhesion_strength; } // cell-cell "springs" - static int cca_spring_index = find_behavior_index( "cell-cell adhesion" ); // HERE + static int cca_spring_index = find_behavior_index( "cell-cell adhesion" ); if( index == cca_spring_index ) { return pCell->phenotype.mechanics.attachment_elastic_constant; } // cell adhesion affinities static int first_affinity_index = find_behavior_index("adhesive affinity to " + cell_definitions_by_type[0]->name ); - if( index >= first_affinity_index && index < first_affinity_index+n ) + if( index >= first_affinity_index && index < first_affinity_index + n ) { return pCell->phenotype.mechanics.cell_adhesion_affinities[index-first_affinity_index]; } // max relative maximum adhesion distance static int max_adh_index = find_behavior_index("relative maximum adhesion distance" ); - if( index = max_adh_index ) + if( index == max_adh_index ) { return pCell->phenotype.mechanics.relative_maximum_adhesion_distance; } // cell-cell repulsion static int ccr_index = find_behavior_index("cell-cell repulsion" ); - if( index = ccr_index ) + if( index == ccr_index ) { return pCell->phenotype.mechanics.cell_cell_repulsion_strength; } // cell-BM adhesion static int cba_index = find_behavior_index("cell-BM adhesion" ); - if( index = cba_index ) + if( index == cba_index ) { return pCell->phenotype.mechanics.cell_BM_adhesion_strength; } // cell-BM repulsion static int cbr_index = find_behavior_index("cell-BM repulsion" ); - if( index = cbr_index ) + if( index == cbr_index ) { return pCell->phenotype.mechanics.cell_BM_repulsion_strength; } // dead cell phagocytosis static int dead_phag_index = find_behavior_index("phagocytose dead dell" ); - if( index = dead_phag_index ) + if( index == dead_phag_index ) { return pCell->phenotype.cell_interactions.dead_phagocytosis_rate; } // phagocytosis of each live cell type @@ -1480,7 +1468,7 @@ std::vector get_base_behaviors( Cell* pCell ) << " Ignoring any later phase exit rates." << std::endl; } for( int i=0; i < max_cycle_index ; i++ ) - { parameters[first_cycle_index+i] = pCD->phenotype.cycle.data.exit_rate( i ); } + { parameters[first_cycle_index + i] = pCD->phenotype.cycle.data.exit_rate( i ); } static int apoptosis_index = pCD->phenotype.death.find_death_model_index( PhysiCell_constants::apoptosis_death_model ); static int necrosis_index = pCD->phenotype.death.find_death_model_index( PhysiCell_constants::necrosis_death_model ); @@ -1573,8 +1561,6 @@ std::vector get_base_behaviors( Cell* pCell ) return parameters; } -/* start here */ - double get_single_base_behavior( Cell* pCell , int index ) { static int m = microenvironment.number_of_densities(); @@ -1593,22 +1579,22 @@ double get_single_base_behavior( Cell* pCell , int index ) // first m entries are secretion static int first_secretion_index = find_behavior_index( microenvironment.density_names[0] + " secretion" ); // 0; - if( index >= first_secretion_index && index < first_secretion_index+m ) + if( index >= first_secretion_index && index < first_secretion_index + m ) { return pCD->phenotype.secretion.secretion_rates[index-first_secretion_index]; } // next m entries are secretion targets static int first_secretion_target_index = find_behavior_index( microenvironment.density_names[0] + " secretion target" ); // m; - if( index >= first_secretion_target_index && index < first_secretion_target_index+m ) + if( index >= first_secretion_target_index && index < first_secretion_target_index + m ) { return pCD->phenotype.secretion.saturation_densities[index-first_secretion_target_index]; } // next m entries are uptake rates static int first_uptake_index = find_behavior_index( microenvironment.density_names[0] + " uptake" ); // 2*m; - if( index >= first_uptake_index && index < first_uptake_index+m ) + if( index >= first_uptake_index && index < first_uptake_index + m ) { return pCD->phenotype.secretion.uptake_rates[index-first_uptake_index]; } // next m entries are net export rates static int first_export_index = find_behavior_index( microenvironment.density_names[0] + " export" ); // 3*m; - if( index >= first_export_index && index < first_export_index+m ) + if( index >= first_export_index && index < first_export_index + m ) { return pCD->phenotype.secretion.net_export_rates[index-first_export_index]; } // cycle entry (exit from phase 0) and exit from up to 5 more phases @@ -1659,7 +1645,7 @@ double get_single_base_behavior( Cell* pCell , int index ) // chemotactic sensitivities static int first_chemotaxis_index = find_behavior_index( "chemotactic response to " + microenvironment.density_names[0] ); - if( index >= first_chemotaxis_index && index < first_chemotaxis_index+m ) + if( index >= first_chemotaxis_index && index < first_chemotaxis_index + m ) { return pCD->phenotype.motility.chemotactic_sensitivities[index-first_chemotaxis_index]; } // cell-cell adhesion @@ -1668,58 +1654,58 @@ double get_single_base_behavior( Cell* pCell , int index ) { return pCD->phenotype.mechanics.cell_cell_adhesion_strength; } // cell-cell "springs" - static int cca_spring_index = find_behavior_index( "cell-cell adhesion" ); // HERE + static int cca_spring_index = find_behavior_index( "cell-cell adhesion" ); if( index == cca_spring_index ) { return pCD->phenotype.mechanics.attachment_elastic_constant; } // cell adhesion affinities static int first_affinity_index = find_behavior_index("adhesive affinity to " + cell_definitions_by_type[0]->name ); - if( index >= first_affinity_index && index < first_affinity_index+n ) + if( index >= first_affinity_index && index < first_affinity_index + n ) { return pCD->phenotype.mechanics.cell_adhesion_affinities[index-first_affinity_index]; } // max relative maximum adhesion distance static int max_adh_index = find_behavior_index("relative maximum adhesion distance" ); - if( index = max_adh_index ) + if( index == max_adh_index ) { return pCD->phenotype.mechanics.relative_maximum_adhesion_distance; } // cell-cell repulsion static int ccr_index = find_behavior_index("cell-cell repulsion" ); - if( index = ccr_index ) + if( index == ccr_index ) { return pCD->phenotype.mechanics.cell_cell_repulsion_strength; } // cell-BM adhesion static int cba_index = find_behavior_index("cell-BM adhesion" ); - if( index = cba_index ) + if( index == cba_index ) { return pCD->phenotype.mechanics.cell_BM_adhesion_strength; } // cell-BM repulsion static int cbr_index = find_behavior_index("cell-BM repulsion" ); - if( index = cbr_index ) + if( index == cbr_index ) { return pCD->phenotype.mechanics.cell_BM_repulsion_strength; } // dead cell phagocytosis static int dead_phag_index = find_behavior_index("phagocytose dead dell" ); - if( index = dead_phag_index ) + if( index == dead_phag_index ) { return pCD->phenotype.cell_interactions.dead_phagocytosis_rate; } // phagocytosis of each live cell type static int first_phagocytosis_index = find_behavior_index( "phagocytose " + cell_definitions_by_type[0]->name ); - if( index >= first_phagocytosis_index && index < first_phagocytosis_index+n ) + if( index >= first_phagocytosis_index && index < first_phagocytosis_index + n ) { return pCD->phenotype.cell_interactions.live_phagocytosis_rates[index-first_phagocytosis_index]; } // attack of each live cell type static int first_attack_index = find_behavior_index( "attack " + cell_definitions_by_type[0]->name ); - if( index >= first_attack_index && index < first_attack_index+n ) + if( index >= first_attack_index && index < first_attack_index + n ) { return pCD->phenotype.cell_interactions.attack_rates[index-first_attack_index]; } // fusion static int first_fusion_index = find_behavior_index( "fuse to " + cell_definitions_by_type[0]->name ); - if( index >= first_fusion_index && index < first_fusion_index+n ) + if( index >= first_fusion_index && index < first_fusion_index + n ) { return pCD->phenotype.cell_interactions.fusion_rates[index-first_fusion_index]; } // transformation static int first_transformation_index = find_behavior_index( "transform to " + cell_definitions_by_type[0]->name ); - if( index >= first_transformation_index && index < first_transformation_index+n ) + if( index >= first_transformation_index && index < first_transformation_index + n ) { return pCD->phenotype.cell_transformations.transformation_rates[index-first_transformation_index]; } return -1; From d172fbd7ed963d437fc49bab4f39b0d188a4f666 Mon Sep 17 00:00:00 2001 From: Paul Macklin Date: Thu, 5 May 2022 09:46:25 -0400 Subject: [PATCH 10/10] cleanup --- ALL_CITATIONS.txt | 4 - Makefile | 212 ++++++++++++++++--- config/PhysiCell_settings.xml | 231 +++++++++++++++----- config/cells.csv | 1 - core/PhysiCell_signal_behavior.cpp | 2 +- custom_modules/custom.cpp | 204 ------------------ custom_modules/custom.h | 92 -------- main-backup.cpp | 0 main-blah.cpp | 327 ----------------------------- main.cpp | 327 ----------------------------- 10 files changed, 359 insertions(+), 1041 deletions(-) delete mode 100644 ALL_CITATIONS.txt delete mode 100644 config/cells.csv delete mode 100644 custom_modules/custom.cpp delete mode 100644 custom_modules/custom.h delete mode 100644 main-backup.cpp delete mode 100644 main-blah.cpp delete mode 100644 main.cpp diff --git a/ALL_CITATIONS.txt b/ALL_CITATIONS.txt deleted file mode 100644 index c99935e8c..000000000 --- a/ALL_CITATIONS.txt +++ /dev/null @@ -1,4 +0,0 @@ -Using PhysiCell version 1.10.0-beta - Please cite DOI: 10.1371/journal.pcbi.1005991 - Project website: http://PhysiCell.MathCancer.org - diff --git a/Makefile b/Makefile index 9c4539c6a..85a64d9cc 100644 --- a/Makefile +++ b/Makefile @@ -14,17 +14,8 @@ endif ARCH := native # best auto-tuning # ARCH := core2 # a reasonably safe default for most CPUs since 2007 # ARCH := corei7 -# ARCH := corei7-avx # earlier i7 # ARCH := core-avx-i # i7 ivy bridge or newer # ARCH := core-avx2 # i7 with Haswell or newer -# ARCH := nehalem -# ARCH := westmere -# ARCH := sandybridge # circa 2011 -# ARCH := ivybridge # circa 2012 -# ARCH := haswell # circa 2013 -# ARCH := broadwell # circa 2014 -# ARCH := skylake # circa 2015 -# ARCH := bonnell # ARCH := silvermont # ARCH := skylake-avx512 # ARCH := nocona #64-bit pentium 4 or later @@ -58,24 +49,194 @@ PhysiCell_pugixml.o PhysiCell_settings.o PhysiCell_geometry.o # put your custom objects here (they should be in the custom_modules directory) -PhysiCell_custom_module_OBJECTS := custom.o +PhysiCell_custom_module_OBJECTS := .o pugixml_OBJECTS := pugixml.o PhysiCell_OBJECTS := $(BioFVM_OBJECTS) $(pugixml_OBJECTS) $(PhysiCell_core_OBJECTS) $(PhysiCell_module_OBJECTS) ALL_OBJECTS := $(PhysiCell_OBJECTS) $(PhysiCell_custom_module_OBJECTS) -# compile the project +EXAMPLES := ./examples/PhysiCell_test_mechanics_1.cpp ./examples/PhysiCell_test_mechanics_2.cpp \ + ./examples/PhysiCell_test_DCIS.cpp ./examples/PhysiCell_test_HDS.cpp \ + ./examples/PhysiCell_test_cell_cycle.cpp ./examples/PhysiCell_test_volume.cpp -all: main.cpp $(ALL_OBJECTS) - $(COMPILE_COMMAND) -o $(PROGRAM_NAME) $(ALL_OBJECTS) main.cpp - make name +all: + make heterogeneity-sample + make name: @echo "" @echo "Executable name is" $(PROGRAM_NAME) @echo "" +# sample projects +list-projects: + @echo "Sample projects: template biorobots-sample cancer-biorobots-sample cancer-immune-sample" + @echo " celltypes3-sample heterogeneity-sample pred-prey-farmer virus-macrophage-sample" + @echo " worm-sample interaction-sample" + @echo "" + @echo "Sample intracellular projects: ode-energy-sample physiboss-cell-lines-sample cancer-metabolism-sample" + @echo "" + +template: + cp ./sample_projects/template/custom_modules/* ./custom_modules/ + touch main.cpp && cp main.cpp main-backup.cpp + cp ./sample_projects/template/main.cpp ./main.cpp + cp Makefile Makefile-backup + cp ./sample_projects/template/Makefile . + cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml + cp ./sample_projects/template/config/* ./config/ + +# sample projects + +# ---- non-intracellular projects +biorobots-sample: + cp ./sample_projects/biorobots/custom_modules/* ./custom_modules/ + touch main.cpp && cp main.cpp main-backup.cpp + cp ./sample_projects/biorobots/main-biorobots.cpp ./main.cpp + cp Makefile Makefile-backup + cp ./sample_projects/biorobots/Makefile . + cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml + cp ./sample_projects/biorobots/config/* ./config/ + +cancer-biorobots-sample: + cp ./sample_projects/cancer_biorobots/custom_modules/* ./custom_modules/ + touch main.cpp && cp main.cpp main-backup.cpp + cp ./sample_projects/cancer_biorobots/main-cancer_biorobots.cpp ./main.cpp + cp Makefile Makefile-backup + cp ./sample_projects/cancer_biorobots/Makefile . + cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml + cp ./sample_projects/cancer_biorobots/config/* ./config/ + +cancer-immune-sample: + cp ./sample_projects/cancer_immune/custom_modules/* ./custom_modules/ + touch main.cpp && cp main.cpp main-backup.cpp + cp ./sample_projects/cancer_immune/main-cancer_immune_3D.cpp ./main.cpp + cp Makefile Makefile-backup + cp ./sample_projects/cancer_immune/Makefile . + cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml + cp ./sample_projects/cancer_immune/config/* ./config/ + +celltypes3-sample: + cp ./sample_projects/celltypes3/custom_modules/* ./custom_modules/ + touch main.cpp && cp main.cpp main-backup.cpp + cp ./sample_projects/celltypes3/main.cpp ./main.cpp + cp Makefile Makefile-backup + cp ./sample_projects/celltypes3/Makefile . + cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml + cp ./sample_projects/celltypes3/config/* ./config/ + +heterogeneity-sample: + cp ./sample_projects/heterogeneity/custom_modules/* ./custom_modules/ + touch main.cpp && cp main.cpp main-backup.cpp + cp ./sample_projects/heterogeneity/main-heterogeneity.cpp ./main.cpp + cp Makefile Makefile-backup + cp ./sample_projects/heterogeneity/Makefile . + cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml + cp ./sample_projects/heterogeneity/config/* ./config/ + +pred-prey-farmer: + cp ./sample_projects/pred_prey_farmer/custom_modules/* ./custom_modules/ + touch main.cpp && cp main.cpp main-backup.cpp + cp ./sample_projects/pred_prey_farmer/main.cpp ./main.cpp + cp Makefile Makefile-backup + cp ./sample_projects/pred_prey_farmer/Makefile . + cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml + cp ./sample_projects/pred_prey_farmer/config/* ./config/ + +virus-macrophage-sample: + cp ./sample_projects/virus_macrophage/custom_modules/* ./custom_modules/ + touch main.cpp && cp main.cpp main-backup.cpp + cp ./sample_projects/virus_macrophage/main.cpp ./main.cpp + cp Makefile Makefile-backup + cp ./sample_projects/virus_macrophage/Makefile . + cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml + cp ./sample_projects/virus_macrophage/config/* ./config/ + +worm-sample: + cp ./sample_projects/worm/custom_modules/* ./custom_modules/ + touch main.cpp && cp main.cpp main-backup.cpp + cp ./sample_projects/worm/main.cpp ./main.cpp + cp Makefile Makefile-backup + cp ./sample_projects/worm/Makefile . + cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml + cp ./sample_projects/worm/config/* ./config/ + +interaction-sample: + cp ./sample_projects/interactions/custom_modules/* ./custom_modules/ + touch main.cpp && cp main.cpp main-backup.cpp + cp ./sample_projects/interactions/main.cpp ./main.cpp + cp Makefile Makefile-backup + cp ./sample_projects/interactions/Makefile . + cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml + cp ./sample_projects/interactions/config/* ./config/ + +# ---- intracellular projects +ode-energy-sample: + cp ./sample_projects_intracellular/ode/ode_energy/custom_modules/* ./custom_modules/ + touch main.cpp && cp main.cpp main-backup.cpp + cp ./sample_projects_intracellular/ode/ode_energy/main.cpp ./main.cpp + cp Makefile Makefile-backup + cp ./sample_projects_intracellular/ode/ode_energy/Makefile . + cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml + cp ./sample_projects_intracellular/ode/ode_energy/config/* ./config/ + +physiboss-cell-lines-sample: + cp ./sample_projects_intracellular/boolean/physiboss_cell_lines/custom_modules/* ./custom_modules/ + touch main.cpp && cp main.cpp main-backup.cpp + cp ./sample_projects_intracellular/boolean/physiboss_cell_lines/main.cpp ./main.cpp + cp Makefile Makefile-backup + cp ./sample_projects_intracellular/boolean/physiboss_cell_lines/Makefile . + cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml + cp ./sample_projects_intracellular/boolean/physiboss_cell_lines/config/* ./config/ + +ecoli-acetic-switch-sample: + cp ./sample_projects_intracellular/fba/ecoli_acetic_switch/custom_modules/* ./custom_modules/ + touch main.cpp && cp main.cpp main-backup.cpp + cp ./sample_projects_intracellular/fba/ecoli_acetic_switch/main_ecoli_acetic_switch.cpp ./main.cpp + cp Makefile Makefile-backup + cp ./sample_projects_intracellular/fba/ecoli_acetic_switch/Makefile ./ + cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml + cp ./sample_projects_intracellular/fba/ecoli_acetic_switch/config/* ./config/ + +cancer-metabolism-sample: + cp ./sample_projects_intracellular/fba/cancer_metabolism/custom_modules/* ./custom_modules/ + touch main.cpp && cp main.cpp main-backup.cpp + cp ./sample_projects_intracellular/fba/cancer_metabolism/main.cpp ./main.cpp + cp Makefile Makefile-backup + cp ./sample_projects_intracellular/fba/cancer_metabolism/Makefile ./ + cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml + cp ./sample_projects_intracellular/fba/cancer_metabolism/config/* ./config/ + + +# early examples for convergence testing + +physicell_test_mech1: $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_mechanics_1.cpp + $(COMPILE_COMMAND) -o test_mech1 $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_mechanics_1.cpp + +physicell_test_mech2: $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_mechanics_2.cpp + $(COMPILE_COMMAND) -o test_mech2 $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_mechanics_2.cpp + +physicell_test_DCIS: $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_DCIS.cpp + $(COMPILE_COMMAND) -o test_DCIS $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_DCIS.cpp + +physicell_test_HDS: $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_HDS.cpp + $(COMPILE_COMMAND) -o test_HDS $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_HDS.cpp + +physicell_test_cell_cycle: $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_cell_cycle.cpp + $(COMPILE_COMMAND) -o test_cycle $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_cell_cycle.cpp + +PhysiCell_test_volume: $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_volume.cpp + $(COMPILE_COMMAND) -o test_volume $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_volume.cpp + +examples: $(PhysiCell_OBJECTS) + $(COMPILE_COMMAND) -o ./examples/test_mech1 ./examples/PhysiCell_test_mechanics_1.cpp $(PhysiCell_OBJECTS) + $(COMPILE_COMMAND) -o ./examples/test_mech2 ./examples/PhysiCell_test_mechanics_2.cpp $(PhysiCell_OBJECTS) + $(COMPILE_COMMAND) -o ./examples/test_DCIS ./examples/PhysiCell_test_DCIS.cpp $(PhysiCell_OBJECTS) + $(COMPILE_COMMAND) -o ./examples/test_HDS ./examples/PhysiCell_test_HDS.cpp $(PhysiCell_OBJECTS) + $(COMPILE_COMMAND) -o ./examples/test_cycle ./examples/PhysiCell_test_cell_cycle.cpp $(PhysiCell_OBJECTS) + $(COMPILE_COMMAND) -o ./examples/test_volume ./examples/PhysiCell_test_volume.cpp $(PhysiCell_OBJECTS) + # PhysiCell core components PhysiCell_phenotype.o: ./core/PhysiCell_phenotype.cpp @@ -150,28 +311,25 @@ PhysiCell_MultiCellDS.o: ./modules/PhysiCell_MultiCellDS.cpp PhysiCell_various_outputs.o: ./modules/PhysiCell_various_outputs.cpp $(COMPILE_COMMAND) -c ./modules/PhysiCell_various_outputs.cpp - + PhysiCell_pugixml.o: ./modules/PhysiCell_pugixml.cpp $(COMPILE_COMMAND) -c ./modules/PhysiCell_pugixml.cpp PhysiCell_settings.o: ./modules/PhysiCell_settings.cpp - $(COMPILE_COMMAND) -c ./modules/PhysiCell_settings.cpp + $(COMPILE_COMMAND) -c ./modules/PhysiCell_settings.cpp PhysiCell_basic_signaling.o: ./core/PhysiCell_basic_signaling.cpp - $(COMPILE_COMMAND) -c ./core/PhysiCell_basic_signaling.cpp - + $(COMPILE_COMMAND) -c ./core/PhysiCell_basic_signaling.cpp + PhysiCell_geometry.o: ./modules/PhysiCell_geometry.cpp $(COMPILE_COMMAND) -c ./modules/PhysiCell_geometry.cpp - -# user-defined PhysiCell modules -custom.o: ./custom_modules/custom.cpp - $(COMPILE_COMMAND) -c ./custom_modules/custom.cpp +# user-defined PhysiCell modules # cleanup reset: - rm -f *.cpp + rm -f *.cpp PhysiCell_cell.o cp ./sample_projects/Makefile-default Makefile rm -f ./custom_modules/* touch ./custom_modules/empty.txt @@ -180,7 +338,7 @@ reset: rm ALL_CITATIONS.txt cp ./config/PhysiCell_settings-backup.xml ./config/PhysiCell_settings.xml touch ./config/empty.csv - rm -f ./config/*.csv + rm ./config/*.csv clean: rm -f *.o @@ -190,9 +348,9 @@ data-cleanup: rm -rf ./output mkdir ./output touch ./output/empty.txt - + # archival - + checkpoint: zip -r $$(date +%b_%d_%Y_%H%M).zip Makefile *.cpp *.h config/*.xml custom_modules/* @@ -263,4 +421,4 @@ upgrade: $(SOURCE) unzip $(SOURCE) PhysiCell/documentation/User_Guide.pdf mv -f PhysiCell/documentation/User_Guide.pdf documentation rm -f -r PhysiCell - rm -f $(SOURCE) \ No newline at end of file + rm -f $(SOURCE) diff --git a/config/PhysiCell_settings.xml b/config/PhysiCell_settings.xml index 12f39edea..5164a3782 100644 --- a/config/PhysiCell_settings.xml +++ b/config/PhysiCell_settings.xml @@ -97,19 +97,19 @@ - 6 + 4 output - 360 + 60 true - 60 + 15 true @@ -120,17 +120,16 @@ false - true - + - 100000.0 - 10 + 100.0 + 0 - 0 - 0 + 1 + 0 +--> + + + 1000.0 + .1 + + 0 + 0 + + + + + + + 1000.0 + .1 + + 0 + 0 + + + + + true true @@ -159,34 +199,31 @@ - + - + - + - 5.31667e-05 + 0 + + + + + 0.003 + + + + + 0 + 1 + + + 10 + + + + 0.5 + 5 + 0.5 + + true + true + + false + food + 1 + + + + + + 1.0 + 1.0 + 1.0 + + -100 + 10 + 1 + + + + + + + + 0 + 0 + - + + 10 + + + + 0.5 + 2.5 + 0.7 + + + true + true + + false + prey signal + 1 + + + - 1.0 + 1.0 + 1.0 + 1.0 + + -2 + 100 + 1 + - - - ./config - cells.csv - - - 0 - 500 + 15 diff --git a/config/cells.csv b/config/cells.csv deleted file mode 100644 index 734bdc767..000000000 --- a/config/cells.csv +++ /dev/null @@ -1 +0,0 @@ -0,0,0,0 \ No newline at end of file diff --git a/core/PhysiCell_signal_behavior.cpp b/core/PhysiCell_signal_behavior.cpp index 80705c703..b51d42701 100644 --- a/core/PhysiCell_signal_behavior.cpp +++ b/core/PhysiCell_signal_behavior.cpp @@ -995,7 +995,7 @@ void set_single_behavior( Cell* pCell, int index , double parameter ) if( index >= first_cycle_index && index < first_cycle_index+6 ) { int max_cycle_index = pCell->phenotype.cycle.model().phases.size(); - if( index < first_cycle_index+max_cycle_index ) + if( index < first_cycle_index + max_cycle_index ) { pCell->phenotype.cycle.data.exit_rate(index-first_cycle_index) = parameter; return; } std::cout << "Warning: Attempted to set a cycle exit rate outside the bounds of the cell's cycle model" << std::endl << " Ignoring it, but you should fix this." << std::endl; diff --git a/custom_modules/custom.cpp b/custom_modules/custom.cpp deleted file mode 100644 index 663bafbbe..000000000 --- a/custom_modules/custom.cpp +++ /dev/null @@ -1,204 +0,0 @@ -/* -############################################################################### -# If you use PhysiCell in your project, please cite PhysiCell and the version # -# number, such as below: # -# # -# We implemented and solved the model using PhysiCell (Version x.y.z) [1]. # -# # -# [1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin, # -# PhysiCell: an Open Source Physics-Based Cell Simulator for Multicellu- # -# lar Systems, PLoS Comput. Biol. 14(2): e1005991, 2018 # -# DOI: 10.1371/journal.pcbi.1005991 # -# # -# See VERSION.txt or call get_PhysiCell_version() to get the current version # -# x.y.z. Call display_citations() to get detailed information on all cite-# -# able software used in your PhysiCell application. # -# # -# Because PhysiCell extensively uses BioFVM, we suggest you also cite BioFVM # -# as below: # -# # -# We implemented and solved the model using PhysiCell (Version x.y.z) [1], # -# with BioFVM [2] to solve the transport equations. # -# # -# [1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin, # -# PhysiCell: an Open Source Physics-Based Cell Simulator for Multicellu- # -# lar Systems, PLoS Comput. Biol. 14(2): e1005991, 2018 # -# DOI: 10.1371/journal.pcbi.1005991 # -# # -# [2] A Ghaffarizadeh, SH Friedman, and P Macklin, BioFVM: an efficient para- # -# llelized diffusive transport solver for 3-D biological simulations, # -# Bioinformatics 32(8): 1256-8, 2016. DOI: 10.1093/bioinformatics/btv730 # -# # -############################################################################### -# # -# BSD 3-Clause License (see https://opensource.org/licenses/BSD-3-Clause) # -# # -# Copyright (c) 2015-2021, Paul Macklin and the PhysiCell Project # -# All rights reserved. # -# # -# Redistribution and use in source and binary forms, with or without # -# modification, are permitted provided that the following conditions are met: # -# # -# 1. Redistributions of source code must retain the above copyright notice, # -# this list of conditions and the following disclaimer. # -# # -# 2. Redistributions in binary form must reproduce the above copyright # -# notice, this list of conditions and the following disclaimer in the # -# documentation and/or other materials provided with the distribution. # -# # -# 3. Neither the name of the copyright holder nor the names of its # -# contributors may be used to endorse or promote products derived from this # -# software without specific prior written permission. # -# # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # -# POSSIBILITY OF SUCH DAMAGE. # -# # -############################################################################### -*/ - -#include "./custom.h" - -void create_cell_types( void ) -{ - // set the random seed - SeedRandom( parameters.ints("random_seed") ); - - /* - Put any modifications to default cell definition here if you - want to have "inherited" by other cell types. - - This is a good place to set default functions. - */ - - initialize_default_cell_definition(); - cell_defaults.phenotype.secretion.sync_to_microenvironment( µenvironment ); - - cell_defaults.functions.volume_update_function = standard_volume_update_function; - cell_defaults.functions.update_velocity = standard_update_cell_velocity; - - cell_defaults.functions.update_migration_bias = NULL; - cell_defaults.functions.update_phenotype = NULL; // update_cell_and_death_parameters_O2_based; - cell_defaults.functions.custom_cell_rule = NULL; - cell_defaults.functions.contact_function = NULL; - - cell_defaults.functions.add_cell_basement_membrane_interactions = NULL; - cell_defaults.functions.calculate_distance_to_membrane = NULL; - - /* - This parses the cell definitions in the XML config file. - */ - - initialize_cell_definitions_from_pugixml(); - - /* - This builds the map of cell definitions and summarizes the setup. - */ - - build_cell_definitions_maps(); - - /* - This intializes cell signal and response dictionaries - */ - - setup_signal_behavior_dictionaries(); - - /* - Put any modifications to individual cell definitions here. - - This is a good place to set custom functions. - */ - - cell_defaults.functions.update_phenotype = phenotype_function; - cell_defaults.functions.custom_cell_rule = custom_function; - cell_defaults.functions.contact_function = contact_function; - - /* - This builds the map of cell definitions and summarizes the setup. - */ - - display_cell_definitions( std::cout ); - - return; -} - -void setup_microenvironment( void ) -{ - // set domain parameters - - // put any custom code to set non-homogeneous initial conditions or - // extra Dirichlet nodes here. - - // initialize BioFVM - - initialize_microenvironment(); - - return; -} - -void setup_tissue( void ) -{ - double Xmin = microenvironment.mesh.bounding_box[0]; - double Ymin = microenvironment.mesh.bounding_box[1]; - double Zmin = microenvironment.mesh.bounding_box[2]; - - double Xmax = microenvironment.mesh.bounding_box[3]; - double Ymax = microenvironment.mesh.bounding_box[4]; - double Zmax = microenvironment.mesh.bounding_box[5]; - - if( default_microenvironment_options.simulate_2D == true ) - { - Zmin = 0.0; - Zmax = 0.0; - } - - double Xrange = Xmax - Xmin; - double Yrange = Ymax - Ymin; - double Zrange = Zmax - Zmin; - - // create some of each type of cell - - Cell* pC; - - for( int k=0; k < cell_definitions_by_index.size() ; k++ ) - { - Cell_Definition* pCD = cell_definitions_by_index[k]; - std::cout << "Placing cells of type " << pCD->name << " ... " << std::endl; - for( int n = 0 ; n < parameters.ints("number_of_cells") ; n++ ) - { - std::vector position = {0,0,0}; - position[0] = Xmin + UniformRandom()*Xrange; - position[1] = Ymin + UniformRandom()*Yrange; - position[2] = Zmin + UniformRandom()*Zrange; - - pC = create_cell( *pCD ); - pC->assign_position( position ); - } - } - std::cout << std::endl; - - // load cells from your CSV file (if enabled) - load_cells_from_pugixml(); - - return; -} - -std::vector my_coloring_function( Cell* pCell ) -{ return paint_by_number_cell_coloring(pCell); } - -void phenotype_function( Cell* pCell, Phenotype& phenotype, double dt ) -{ return; } - -void custom_function( Cell* pCell, Phenotype& phenotype , double dt ) -{ return; } - -void contact_function( Cell* pMe, Phenotype& phenoMe , Cell* pOther, Phenotype& phenoOther , double dt ) -{ return; } \ No newline at end of file diff --git a/custom_modules/custom.h b/custom_modules/custom.h deleted file mode 100644 index 0e6df8d02..000000000 --- a/custom_modules/custom.h +++ /dev/null @@ -1,92 +0,0 @@ -/* -############################################################################### -# If you use PhysiCell in your project, please cite PhysiCell and the version # -# number, such as below: # -# # -# We implemented and solved the model using PhysiCell (Version x.y.z) [1]. # -# # -# [1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin, # -# PhysiCell: an Open Source Physics-Based Cell Simulator for Multicellu- # -# lar Systems, PLoS Comput. Biol. 14(2): e1005991, 2018 # -# DOI: 10.1371/journal.pcbi.1005991 # -# # -# See VERSION.txt or call get_PhysiCell_version() to get the current version # -# x.y.z. Call display_citations() to get detailed information on all cite-# -# able software used in your PhysiCell application. # -# # -# Because PhysiCell extensively uses BioFVM, we suggest you also cite BioFVM # -# as below: # -# # -# We implemented and solved the model using PhysiCell (Version x.y.z) [1], # -# with BioFVM [2] to solve the transport equations. # -# # -# [1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin, # -# PhysiCell: an Open Source Physics-Based Cell Simulator for Multicellu- # -# lar Systems, PLoS Comput. Biol. 14(2): e1005991, 2018 # -# DOI: 10.1371/journal.pcbi.1005991 # -# # -# [2] A Ghaffarizadeh, SH Friedman, and P Macklin, BioFVM: an efficient para- # -# llelized diffusive transport solver for 3-D biological simulations, # -# Bioinformatics 32(8): 1256-8, 2016. DOI: 10.1093/bioinformatics/btv730 # -# # -############################################################################### -# # -# BSD 3-Clause License (see https://opensource.org/licenses/BSD-3-Clause) # -# # -# Copyright (c) 2015-2021, Paul Macklin and the PhysiCell Project # -# All rights reserved. # -# # -# Redistribution and use in source and binary forms, with or without # -# modification, are permitted provided that the following conditions are met: # -# # -# 1. Redistributions of source code must retain the above copyright notice, # -# this list of conditions and the following disclaimer. # -# # -# 2. Redistributions in binary form must reproduce the above copyright # -# notice, this list of conditions and the following disclaimer in the # -# documentation and/or other materials provided with the distribution. # -# # -# 3. Neither the name of the copyright holder nor the names of its # -# contributors may be used to endorse or promote products derived from this # -# software without specific prior written permission. # -# # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # -# POSSIBILITY OF SUCH DAMAGE. # -# # -############################################################################### -*/ - -#include "../core/PhysiCell.h" -#include "../modules/PhysiCell_standard_modules.h" - -using namespace BioFVM; -using namespace PhysiCell; - -// setup functions to help us along - -void create_cell_types( void ); -void setup_tissue( void ); - -// set up the BioFVM microenvironment -void setup_microenvironment( void ); - -// custom pathology coloring function - -std::vector my_coloring_function( Cell* ); - -// custom functions can go here - -void phenotype_function( Cell* pCell, Phenotype& phenotype, double dt ); -void custom_function( Cell* pCell, Phenotype& phenotype , double dt ); - -void contact_function( Cell* pMe, Phenotype& phenoMe , Cell* pOther, Phenotype& phenoOther , double dt ); - diff --git a/main-backup.cpp b/main-backup.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/main-blah.cpp b/main-blah.cpp deleted file mode 100644 index ac3303f1d..000000000 --- a/main-blah.cpp +++ /dev/null @@ -1,327 +0,0 @@ -/* -############################################################################### -# If you use PhysiCell in your project, please cite PhysiCell and the version # -# number, such as below: # -# # -# We implemented and solved the model using PhysiCell (Version x.y.z) [1]. # -# # -# [1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin, # -# PhysiCell: an Open Source Physics-Based Cell Simulator for Multicellu- # -# lar Systems, PLoS Comput. Biol. 14(2): e1005991, 2018 # -# DOI: 10.1371/journal.pcbi.1005991 # -# # -# See VERSION.txt or call get_PhysiCell_version() to get the current version # -# x.y.z. Call display_citations() to get detailed information on all cite-# -# able software used in your PhysiCell application. # -# # -# Because PhysiCell extensively uses BioFVM, we suggest you also cite BioFVM # -# as below: # -# # -# We implemented and solved the model using PhysiCell (Version x.y.z) [1], # -# with BioFVM [2] to solve the transport equations. # -# # -# [1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin, # -# PhysiCell: an Open Source Physics-Based Cell Simulator for Multicellu- # -# lar Systems, PLoS Comput. Biol. 14(2): e1005991, 2018 # -# DOI: 10.1371/journal.pcbi.1005991 # -# # -# [2] A Ghaffarizadeh, SH Friedman, and P Macklin, BioFVM: an efficient para- # -# llelized diffusive transport solver for 3-D biological simulations, # -# Bioinformatics 32(8): 1256-8, 2016. DOI: 10.1093/bioinformatics/btv730 # -# # -############################################################################### -# # -# BSD 3-Clause License (see https://opensource.org/licenses/BSD-3-Clause) # -# # -# Copyright (c) 2015-2022, Paul Macklin and the PhysiCell Project # -# All rights reserved. # -# # -# Redistribution and use in source and binary forms, with or without # -# modification, are permitted provided that the following conditions are met: # -# # -# 1. Redistributions of source code must retain the above copyright notice, # -# this list of conditions and the following disclaimer. # -# # -# 2. Redistributions in binary form must reproduce the above copyright # -# notice, this list of conditions and the following disclaimer in the # -# documentation and/or other materials provided with the distribution. # -# # -# 3. Neither the name of the copyright holder nor the names of its # -# contributors may be used to endorse or promote products derived from this # -# software without specific prior written permission. # -# # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # -# POSSIBILITY OF SUCH DAMAGE. # -# # -############################################################################### -*/ - -#include -#include -#include -#include -#include -#include -#include - -#include "./core/PhysiCell.h" -#include "./modules/PhysiCell_standard_modules.h" - -// put custom code modules here! - -#include "./custom_modules/custom.h" - -using namespace BioFVM; -using namespace PhysiCell; - -int main( int argc, char* argv[] ) -{ - // load and parse settings file(s) - - bool XML_status = false; - char copy_command [1024]; - if( argc > 1 ) - { - XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); - } - else - { - XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); - sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); - } - if( !XML_status ) - { exit(-1); } - - // copy config file to output directry - system( copy_command ); - - // OpenMP setup - omp_set_num_threads(PhysiCell_settings.omp_num_threads); - - // time setup - std::string time_units = "min"; - - /* Microenvironment setup */ - - setup_microenvironment(); // modify this in the custom code - - /* PhysiCell setup */ - - // set mechanics voxel size, and match the data structure to BioFVM - double mechanics_voxel_size = 30; - Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, mechanics_voxel_size ); - - /* Users typically start modifying here. START USERMODS */ - - create_cell_types(); - - setup_tissue(); - - /* Users typically stop modifying here. END USERMODS */ - - // set MultiCellDS save options - - set_save_biofvm_mesh_as_matlab( true ); - set_save_biofvm_data_as_matlab( true ); - set_save_biofvm_cell_data( true ); - set_save_biofvm_cell_data_as_custom_matlab( true ); - - // save a simulation snapshot - - char filename[1024]; - sprintf( filename , "%s/initial" , PhysiCell_settings.folder.c_str() ); - save_PhysiCell_to_MultiCellDS_xml_pugi( filename , microenvironment , PhysiCell_globals.current_time ); - - // save a quick SVG cross section through z = 0, after setting its - // length bar to 200 microns - - PhysiCell_SVG_options.length_bar = 200; - - // for simplicity, set a pathology coloring function - - std::vector (*cell_coloring_function)(Cell*) = my_coloring_function; - - sprintf( filename , "%s/initial.svg" , PhysiCell_settings.folder.c_str() ); - SVG_plot( filename , microenvironment, 0.0 , PhysiCell_globals.current_time, cell_coloring_function ); - - sprintf( filename , "%s/legend.svg" , PhysiCell_settings.folder.c_str() ); - create_plot_legend( filename , cell_coloring_function ); - - display_citations(); - - // set the performance timers - - BioFVM::RUNTIME_TIC(); - BioFVM::TIC(); - - std::ofstream report_file; - if( PhysiCell_settings.enable_legacy_saves == true ) - { - sprintf( filename , "%s/simulation_report.txt" , PhysiCell_settings.folder.c_str() ); - - report_file.open(filename); // create the data log file - report_file<<"simulated time\tnum cells\tnum division\tnum death\twall time"< sigs = get_signals( pC ); - std::cout << sigs << std::endl; - - std::vector b0 = get_base_behaviors( pC ); - - for( int i=0; i < b0.size(); i++ ) - { - std::vector indices = {i}; - std::vector params = {i + 0.0 }; - b0[i] = i + 0.00001; - // set_selected_behaviors(pC, indices, params ); - // set_single_behavior( pC, i , i+0.0 ); - } - - set_behaviors( pC, b0 ); - - b0 = get_behaviors( pC ); - - - std::cout.precision(10); - - for( int i=0; i < b0.size(); i++ ) - { - std::cout << i << " : " << behavior_name(i) << " : " << b0[i] << std::endl; - } - - // now let's test signals - int nV = pC->get_current_voxel_index(); - for( int i=0 ; i < microenvironment.number_of_densities() ; i++ ) - { - microenvironment(nV)[i] = i + 0.1; - pC->phenotype.molecular.internalized_total_substrates[i] = (-i - 0.1)*pC->phenotype.volume.total; -/* - pC->phenotype.secretion.secretion_rates[i] = 10*i+0.01; - pC->phenotype.secretion.saturation_densities[i] = 20*i+0.01; - pC->phenotype.secretion.uptake_rates[i] = 30*i+0.01; - pC->phenotype.secretion.net_export_rates[i] = 40*i+0.01; - - pC->phenotype.motility.chemotactic_sensitivities[i] = 50*i + 0.001; -*/ - } - - int n = cell_definitions_by_index.size(); - std::vector cell_probs( n , 1.0 / ( n + 0.0 ) ); - - for( int i=1; i < 100 ; i++ ) - { - Cell* pC1 = (*all_cells)[i]; - - // choose type - int nNT = choose_event( cell_probs ); - // transform cell - pC1->convert_to_cell_definition( *cell_definitions_by_index[nNT] ); - // dead or alive? - if( UniformRandom() <= 0.5 ) - { pC1->phenotype.death.dead = true; } - // add it to neighbors of pC - pC->state.neighbors.push_back( pC1 ); - } - - std::cout << std::endl; - sigs = get_signals( pC ); - for( int i=0; i < sigs.size(); i++ ) - { - std::cout << i << " : " << signal_name(i) << " : " << sigs[i] << " vs: " << get_single_signal(pC,i) << std::endl; - } - - - - - return 1; - - - try - { - while( PhysiCell_globals.current_time < PhysiCell_settings.max_time + 0.1*diffusion_dt ) - { - // save data if it's time. - if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_full_save_time ) < 0.01 * diffusion_dt ) - { - display_simulation_status( std::cout ); - if( PhysiCell_settings.enable_legacy_saves == true ) - { - log_output( PhysiCell_globals.current_time , PhysiCell_globals.full_output_index, microenvironment, report_file); - } - - if( PhysiCell_settings.enable_full_saves == true ) - { - sprintf( filename , "%s/output%08u" , PhysiCell_settings.folder.c_str(), PhysiCell_globals.full_output_index ); - - save_PhysiCell_to_MultiCellDS_xml_pugi( filename , microenvironment , PhysiCell_globals.current_time ); - } - - PhysiCell_globals.full_output_index++; - PhysiCell_globals.next_full_save_time += PhysiCell_settings.full_save_interval; - } - - // save SVG plot if it's time - if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_SVG_save_time ) < 0.01 * diffusion_dt ) - { - if( PhysiCell_settings.enable_SVG_saves == true ) - { - sprintf( filename , "%s/snapshot%08u.svg" , PhysiCell_settings.folder.c_str() , PhysiCell_globals.SVG_output_index ); - SVG_plot( filename , microenvironment, 0.0 , PhysiCell_globals.current_time, cell_coloring_function ); - - PhysiCell_globals.SVG_output_index++; - PhysiCell_globals.next_SVG_save_time += PhysiCell_settings.SVG_save_interval; - } - } - - // update the microenvironment - microenvironment.simulate_diffusion_decay( diffusion_dt ); - - // run PhysiCell - ((Cell_Container *)microenvironment.agent_container)->update_all_cells( PhysiCell_globals.current_time ); - - /* - Custom add-ons could potentially go here. - */ - - PhysiCell_globals.current_time += diffusion_dt; - } - - if( PhysiCell_settings.enable_legacy_saves == true ) - { - log_output(PhysiCell_globals.current_time, PhysiCell_globals.full_output_index, microenvironment, report_file); - report_file.close(); - } - } - catch( const std::exception& e ) - { // reference to the base of a polymorphic object - std::cout << e.what(); // information from length_error printed - } - - // save a final simulation snapshot - - sprintf( filename , "%s/final" , PhysiCell_settings.folder.c_str() ); - save_PhysiCell_to_MultiCellDS_xml_pugi( filename , microenvironment , PhysiCell_globals.current_time ); - - sprintf( filename , "%s/final.svg" , PhysiCell_settings.folder.c_str() ); - SVG_plot( filename , microenvironment, 0.0 , PhysiCell_globals.current_time, cell_coloring_function ); - - // timer - - std::cout << std::endl << "Total simulation runtime: " << std::endl; - BioFVM::display_stopwatch_value( std::cout , BioFVM::runtime_stopwatch_value() ); - - return 0; -} diff --git a/main.cpp b/main.cpp deleted file mode 100644 index ac3303f1d..000000000 --- a/main.cpp +++ /dev/null @@ -1,327 +0,0 @@ -/* -############################################################################### -# If you use PhysiCell in your project, please cite PhysiCell and the version # -# number, such as below: # -# # -# We implemented and solved the model using PhysiCell (Version x.y.z) [1]. # -# # -# [1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin, # -# PhysiCell: an Open Source Physics-Based Cell Simulator for Multicellu- # -# lar Systems, PLoS Comput. Biol. 14(2): e1005991, 2018 # -# DOI: 10.1371/journal.pcbi.1005991 # -# # -# See VERSION.txt or call get_PhysiCell_version() to get the current version # -# x.y.z. Call display_citations() to get detailed information on all cite-# -# able software used in your PhysiCell application. # -# # -# Because PhysiCell extensively uses BioFVM, we suggest you also cite BioFVM # -# as below: # -# # -# We implemented and solved the model using PhysiCell (Version x.y.z) [1], # -# with BioFVM [2] to solve the transport equations. # -# # -# [1] A Ghaffarizadeh, R Heiland, SH Friedman, SM Mumenthaler, and P Macklin, # -# PhysiCell: an Open Source Physics-Based Cell Simulator for Multicellu- # -# lar Systems, PLoS Comput. Biol. 14(2): e1005991, 2018 # -# DOI: 10.1371/journal.pcbi.1005991 # -# # -# [2] A Ghaffarizadeh, SH Friedman, and P Macklin, BioFVM: an efficient para- # -# llelized diffusive transport solver for 3-D biological simulations, # -# Bioinformatics 32(8): 1256-8, 2016. DOI: 10.1093/bioinformatics/btv730 # -# # -############################################################################### -# # -# BSD 3-Clause License (see https://opensource.org/licenses/BSD-3-Clause) # -# # -# Copyright (c) 2015-2022, Paul Macklin and the PhysiCell Project # -# All rights reserved. # -# # -# Redistribution and use in source and binary forms, with or without # -# modification, are permitted provided that the following conditions are met: # -# # -# 1. Redistributions of source code must retain the above copyright notice, # -# this list of conditions and the following disclaimer. # -# # -# 2. Redistributions in binary form must reproduce the above copyright # -# notice, this list of conditions and the following disclaimer in the # -# documentation and/or other materials provided with the distribution. # -# # -# 3. Neither the name of the copyright holder nor the names of its # -# contributors may be used to endorse or promote products derived from this # -# software without specific prior written permission. # -# # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # -# POSSIBILITY OF SUCH DAMAGE. # -# # -############################################################################### -*/ - -#include -#include -#include -#include -#include -#include -#include - -#include "./core/PhysiCell.h" -#include "./modules/PhysiCell_standard_modules.h" - -// put custom code modules here! - -#include "./custom_modules/custom.h" - -using namespace BioFVM; -using namespace PhysiCell; - -int main( int argc, char* argv[] ) -{ - // load and parse settings file(s) - - bool XML_status = false; - char copy_command [1024]; - if( argc > 1 ) - { - XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); - } - else - { - XML_status = load_PhysiCell_config_file( "./config/PhysiCell_settings.xml" ); - sprintf( copy_command , "cp ./config/PhysiCell_settings.xml %s" , PhysiCell_settings.folder.c_str() ); - } - if( !XML_status ) - { exit(-1); } - - // copy config file to output directry - system( copy_command ); - - // OpenMP setup - omp_set_num_threads(PhysiCell_settings.omp_num_threads); - - // time setup - std::string time_units = "min"; - - /* Microenvironment setup */ - - setup_microenvironment(); // modify this in the custom code - - /* PhysiCell setup */ - - // set mechanics voxel size, and match the data structure to BioFVM - double mechanics_voxel_size = 30; - Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, mechanics_voxel_size ); - - /* Users typically start modifying here. START USERMODS */ - - create_cell_types(); - - setup_tissue(); - - /* Users typically stop modifying here. END USERMODS */ - - // set MultiCellDS save options - - set_save_biofvm_mesh_as_matlab( true ); - set_save_biofvm_data_as_matlab( true ); - set_save_biofvm_cell_data( true ); - set_save_biofvm_cell_data_as_custom_matlab( true ); - - // save a simulation snapshot - - char filename[1024]; - sprintf( filename , "%s/initial" , PhysiCell_settings.folder.c_str() ); - save_PhysiCell_to_MultiCellDS_xml_pugi( filename , microenvironment , PhysiCell_globals.current_time ); - - // save a quick SVG cross section through z = 0, after setting its - // length bar to 200 microns - - PhysiCell_SVG_options.length_bar = 200; - - // for simplicity, set a pathology coloring function - - std::vector (*cell_coloring_function)(Cell*) = my_coloring_function; - - sprintf( filename , "%s/initial.svg" , PhysiCell_settings.folder.c_str() ); - SVG_plot( filename , microenvironment, 0.0 , PhysiCell_globals.current_time, cell_coloring_function ); - - sprintf( filename , "%s/legend.svg" , PhysiCell_settings.folder.c_str() ); - create_plot_legend( filename , cell_coloring_function ); - - display_citations(); - - // set the performance timers - - BioFVM::RUNTIME_TIC(); - BioFVM::TIC(); - - std::ofstream report_file; - if( PhysiCell_settings.enable_legacy_saves == true ) - { - sprintf( filename , "%s/simulation_report.txt" , PhysiCell_settings.folder.c_str() ); - - report_file.open(filename); // create the data log file - report_file<<"simulated time\tnum cells\tnum division\tnum death\twall time"< sigs = get_signals( pC ); - std::cout << sigs << std::endl; - - std::vector b0 = get_base_behaviors( pC ); - - for( int i=0; i < b0.size(); i++ ) - { - std::vector indices = {i}; - std::vector params = {i + 0.0 }; - b0[i] = i + 0.00001; - // set_selected_behaviors(pC, indices, params ); - // set_single_behavior( pC, i , i+0.0 ); - } - - set_behaviors( pC, b0 ); - - b0 = get_behaviors( pC ); - - - std::cout.precision(10); - - for( int i=0; i < b0.size(); i++ ) - { - std::cout << i << " : " << behavior_name(i) << " : " << b0[i] << std::endl; - } - - // now let's test signals - int nV = pC->get_current_voxel_index(); - for( int i=0 ; i < microenvironment.number_of_densities() ; i++ ) - { - microenvironment(nV)[i] = i + 0.1; - pC->phenotype.molecular.internalized_total_substrates[i] = (-i - 0.1)*pC->phenotype.volume.total; -/* - pC->phenotype.secretion.secretion_rates[i] = 10*i+0.01; - pC->phenotype.secretion.saturation_densities[i] = 20*i+0.01; - pC->phenotype.secretion.uptake_rates[i] = 30*i+0.01; - pC->phenotype.secretion.net_export_rates[i] = 40*i+0.01; - - pC->phenotype.motility.chemotactic_sensitivities[i] = 50*i + 0.001; -*/ - } - - int n = cell_definitions_by_index.size(); - std::vector cell_probs( n , 1.0 / ( n + 0.0 ) ); - - for( int i=1; i < 100 ; i++ ) - { - Cell* pC1 = (*all_cells)[i]; - - // choose type - int nNT = choose_event( cell_probs ); - // transform cell - pC1->convert_to_cell_definition( *cell_definitions_by_index[nNT] ); - // dead or alive? - if( UniformRandom() <= 0.5 ) - { pC1->phenotype.death.dead = true; } - // add it to neighbors of pC - pC->state.neighbors.push_back( pC1 ); - } - - std::cout << std::endl; - sigs = get_signals( pC ); - for( int i=0; i < sigs.size(); i++ ) - { - std::cout << i << " : " << signal_name(i) << " : " << sigs[i] << " vs: " << get_single_signal(pC,i) << std::endl; - } - - - - - return 1; - - - try - { - while( PhysiCell_globals.current_time < PhysiCell_settings.max_time + 0.1*diffusion_dt ) - { - // save data if it's time. - if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_full_save_time ) < 0.01 * diffusion_dt ) - { - display_simulation_status( std::cout ); - if( PhysiCell_settings.enable_legacy_saves == true ) - { - log_output( PhysiCell_globals.current_time , PhysiCell_globals.full_output_index, microenvironment, report_file); - } - - if( PhysiCell_settings.enable_full_saves == true ) - { - sprintf( filename , "%s/output%08u" , PhysiCell_settings.folder.c_str(), PhysiCell_globals.full_output_index ); - - save_PhysiCell_to_MultiCellDS_xml_pugi( filename , microenvironment , PhysiCell_globals.current_time ); - } - - PhysiCell_globals.full_output_index++; - PhysiCell_globals.next_full_save_time += PhysiCell_settings.full_save_interval; - } - - // save SVG plot if it's time - if( fabs( PhysiCell_globals.current_time - PhysiCell_globals.next_SVG_save_time ) < 0.01 * diffusion_dt ) - { - if( PhysiCell_settings.enable_SVG_saves == true ) - { - sprintf( filename , "%s/snapshot%08u.svg" , PhysiCell_settings.folder.c_str() , PhysiCell_globals.SVG_output_index ); - SVG_plot( filename , microenvironment, 0.0 , PhysiCell_globals.current_time, cell_coloring_function ); - - PhysiCell_globals.SVG_output_index++; - PhysiCell_globals.next_SVG_save_time += PhysiCell_settings.SVG_save_interval; - } - } - - // update the microenvironment - microenvironment.simulate_diffusion_decay( diffusion_dt ); - - // run PhysiCell - ((Cell_Container *)microenvironment.agent_container)->update_all_cells( PhysiCell_globals.current_time ); - - /* - Custom add-ons could potentially go here. - */ - - PhysiCell_globals.current_time += diffusion_dt; - } - - if( PhysiCell_settings.enable_legacy_saves == true ) - { - log_output(PhysiCell_globals.current_time, PhysiCell_globals.full_output_index, microenvironment, report_file); - report_file.close(); - } - } - catch( const std::exception& e ) - { // reference to the base of a polymorphic object - std::cout << e.what(); // information from length_error printed - } - - // save a final simulation snapshot - - sprintf( filename , "%s/final" , PhysiCell_settings.folder.c_str() ); - save_PhysiCell_to_MultiCellDS_xml_pugi( filename , microenvironment , PhysiCell_globals.current_time ); - - sprintf( filename , "%s/final.svg" , PhysiCell_settings.folder.c_str() ); - SVG_plot( filename , microenvironment, 0.0 , PhysiCell_globals.current_time, cell_coloring_function ); - - // timer - - std::cout << std::endl << "Total simulation runtime: " << std::endl; - BioFVM::display_stopwatch_value( std::cout , BioFVM::runtime_stopwatch_value() ); - - return 0; -}