diff --git a/Makefile b/Makefile index a5d3a9c..6b8ac7c 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ VERSION := $(shell grep . VERSION.txt | cut -f1 -d:) -PROGRAM_NAME := project +PROGRAM_NAME := PhysiBoSS_Cell_Lines CC := g++ # CC := g++-mp-7 # typical macports compiler name @@ -14,7 +14,7 @@ endif ### MaBoSS configuration # MaBoSS max nodes ifndef MABOSS_MAX_NODES -MABOSS_MAX_NODES = 256 +MABOSS_MAX_NODES = 64 endif # MaBoSS directory @@ -86,12 +86,12 @@ PhysiCell_signal_behavior.o PhysiCell_rules.o PhysiCell_module_OBJECTS := PhysiCell_SVG.o PhysiCell_pathology.o PhysiCell_MultiCellDS.o PhysiCell_various_outputs.o \ PhysiCell_pugixml.o PhysiCell_settings.o PhysiCell_geometry.o -# put your custom objects here (they should be in the custom_modules directory) +# put your custom objects here (they should be in the custom_modules directory) MaBoSS := ./addons/PhysiBoSS/MaBoSS/engine/src/BooleanNetwork.h PhysiBoSS_OBJECTS := maboss_network.o maboss_intracellular.o -PhysiCell_custom_module_OBJECTS := custom.o +PhysiCell_custom_module_OBJECTS := custom.o pugixml_OBJECTS := pugixml.o @@ -102,7 +102,7 @@ ALL_OBJECTS := $(PhysiCell_OBJECTS) $(PhysiCell_custom_module_OBJECTS) $(PhysiBo all: main.cpp $(ALL_OBJECTS) $(MaBoSS) $(COMPILE_COMMAND) $(INC) -o $(PROGRAM_NAME) $(ALL_OBJECTS) main.cpp $(LIB) - make name + make name static: main.cpp $(ALL_OBJECTS) $(MaBoSS) $(LINK_COMMAND) $(INC) -o $(PROGRAM_NAME) $(ALL_OBJECTS) main.cpp $(LIB) -static-libgcc -static-libstdc++ $(STATIC_OPENMP) @@ -134,13 +134,13 @@ PhysiCell_utilities.o: ./core/PhysiCell_utilities.cpp PhysiCell_custom.o: ./core/PhysiCell_custom.cpp $(COMPILE_COMMAND) -c ./core/PhysiCell_custom.cpp - + PhysiCell_constants.o: ./core/PhysiCell_constants.cpp - $(COMPILE_COMMAND) -c ./core/PhysiCell_constants.cpp + $(COMPILE_COMMAND) -c ./core/PhysiCell_constants.cpp PhysiCell_signal_behavior.o: ./core/PhysiCell_signal_behavior.cpp $(COMPILE_COMMAND) -c ./core/PhysiCell_signal_behavior.cpp - + PhysiCell_rules.o: ./core/PhysiCell_rules.cpp $(COMPILE_COMMAND) -c ./core/PhysiCell_rules.cpp @@ -194,14 +194,14 @@ 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 Compile_MaBoSS: ./addons/PhysiBoSS/MaBoSS/engine/src/BooleanNetwork.h @@ -234,7 +234,7 @@ reset: touch ./core/PhysiCell_cell.cpp rm ALL_CITATIONS.txt cp ./config/PhysiCell_settings-backup.xml ./config/PhysiCell_settings.xml - rm -fr ./config/cells.csv ./config/cell_rules.csv + rm -rf ./config/model_*.bnd ./config/model.cfg ./config/cells.csv rm -rf ./scripts MaBoSS-clean: @@ -245,15 +245,17 @@ clean: rm -f $(PROGRAM_NAME)* data-cleanup: - rm -rf ./output - mkdir ./output + rm -f *.mat + rm -f *.xml + rm -f *.svg + rm -f ./output/* touch ./output/empty.txt # archival - + checkpoint: zip -r $$(date +%b_%d_%Y_%H%M).zip Makefile *.cpp *.h config/*.xml custom_modules/* - + zip: zip -r latest.zip Makefile* *.cpp *.h BioFVM/* config/* core/* custom_modules/* matlab/* modules/* sample_projects/* cp latest.zip $$(date +%b_%d_%Y_%H%M).zip @@ -274,25 +276,9 @@ untar: cp ./archives/latest.tar . tar -xzf latest.tar -# easier animation - -FRAMERATE := 24 -OUTPUT := output - -jpeg: - @magick identify -format "%h" $(OUTPUT)/initial.svg > __H.txt - @magick identify -format "%w" $(OUTPUT)/initial.svg > __W.txt - @expr 2 \* \( $$(grep . __H.txt) / 2 \) > __H1.txt - @expr 2 \* \( $$(grep . __W.txt) / 2 \) > __W1.txt - @echo "$$(grep . __W1.txt)!x$$(grep . __H1.txt)!" > __resize.txt - @magick mogrify -format jpg -resize $$(grep . __resize.txt) $(OUTPUT)/s*.svg - rm -f __H*.txt __W*.txt __resize.txt - -gif: - magick convert $(OUTPUT)/s*.svg $(OUTPUT)/out.gif - movie: - ffmpeg -r $(FRAMERATE) -f image2 -i $(OUTPUT)/snapshot%08d.jpg -vcodec libx264 -pix_fmt yuv420p -strict -2 -tune animation -crf 15 -acodec none $(OUTPUT)/out.mp4 + ffmpeg -r 25 -i output/snapshot%08d.svg -pix_fmt yuv420p output.mp4 + vlc output.mp4 # upgrade rules @@ -322,7 +308,7 @@ upgrade: $(SOURCE) mv -f PhysiCell/documentation/User_Guide.pdf documentation rm -f -r PhysiCell rm -f $(SOURCE) - + # use: make save PROJ=your_project_name PROJ := my_project diff --git a/README.md b/README.md index 6ebe806..da93e83 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,3 @@ -# About +# PhyiBoSS Cell Lines model -This repository is a template for PhysiBoSS models, that can be used to submit a new model to the database. - -# Getting started - -- Fork this repository. -- Make a new branch from main for your PhysiBoSS model. -- Update the new branch with your model -- Update model.yml metadata file, as well as the readme for a quick description of the model -- Open a pull request. Building of your model will be tested on Windows, Mac and Linux. -- When your pull request is accepted by the editors a new repository will be created in the github PhysiBoSS-Models organization, and build/upload of your model will automatically be triggered. Once complete, the model is available on PhysiBoSS-Models. +This model was the toy model for testing the implementation of the XML definition of a PhysiBoSS model, for PhysiBoSS 2.0 \ No newline at end of file diff --git a/config/PhysiCell_settings.xml b/config/PhysiCell_settings.xml index 4723bb4..4cc65ec 100644 --- a/config/PhysiCell_settings.xml +++ b/config/PhysiCell_settings.xml @@ -1,350 +1,1068 @@ - - + - + + -100 + 200 + -100 + 100 + -20 + 20 + 10 + 10 + 10 + false + - - - -500 - 500 - -500 - 500 - -10 - 10 - 20 - 20 - 20 - true - - - - 1440 - min - micron - - 0.01 - 0.1 - 6 - - - - 6 - - - - output + + 200 + min + micron + 0.02 + 0.1 + 0.5 + - - 60 - true - - - - 60 - true - - - - false - - - - - false - true - false - + + 6 + - - - - 100000.0 - 10 - - 0 - 0 - - - - - - true - true - - - ./config/initial.mat - - - - ./config/dirichlet.mat - - - - - - - - - + + output + + 10 + true + + + 10 + true + + + true + + - - - - - - - 300.0 - 480 - 240 - 60 - - - - - - 5.31667e-05 - - - - 516 - - - 0.05 - 0 - 1.66667e-02 - 5.83333e-03 - 0 - 2.0 - - + + false + false + true + - - 0.0 - - - - - 0 - 86400 - - - - 1.11667e-2 - 8.33333e-4 - 5.33333e-5 - 2.16667e-3 - 0 - 2.0 - - - + + + + 100000.0 + .1 + + 38.0 + 38.0 + + 0 + 0 + 0 + 0 + 0 + 0 + + + + true + true + + ./config/initial.mat + + + ./config/dirichlet.mat + + + - - 2494 - 0.75 - 540 - - 0.05 - 0.0045 - 0.0055 - - 0 - 0 - - 2.0 - - - - 0.4 - 10.0 - 1.25 - - 1 - - - 1.8 - 15.12 - + + + + + + 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 + 540 + 0.0 + 0.0 + 0.0 + 0 + 0 + 2.0 + + + 0 + 10.0 + 1.25 + + 1.0 + 1.0 + 1.0 + 1.0 + 1.0 + 1.0 + + + 1.8 + 15.12 + 4.0 10.0 - 0.01 - 0.0 - 0.0 - - - - 1 - 1 - .5 - - - false - true - - false - substrate - 1 - - - - - - - 0 - 1 - 0 - 0 - - - - - 0 - - 0 - - - 0 - - 1 - - 0 - - - - - 0 - - + 0.01 + 10.0 + 0.0 + + + 0.25 + 5 + 0.5 + + false + false + + false + oxygen + 1 + + + false + false + + 0.0 + + + + + + + 0 + 38 + 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 + + 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 + + + + ./config/model_0.bnd + ./config/model.cfg + + 1 + 0 + + + 1 + 0.0 + 1.0 + 0.0 + + + + + + + 1.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 + 540 + 0.0 + 0.0 + 0.0 + 0 + 0 + 2.0 + + + 0 + 10.0 + 1.25 + + 1.0 + 1.0 + 1.0 + 1.0 + 1.0 + 1.0 + + + 1.8 + 15.12 + + 4.0 + 10.0 + 0.01 + 10.0 + 0.0 + + + 0.25 + 5 + 0.5 + + false + false + + false + oxygen + 1 + + + false + false + + 0.0 + + + + + + + 0 + 38 + 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 + + 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 + + + + ./config/model_1.bnd + ./config/model.cfg + + 1 + 0 + + + 1 + 0.0 + 1.0 + 0.0 + + + + + + + 1.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 + 540 + 0.0 + 0.0 + 0.0 + 0 + 0 + 2.0 + + + 0 + 10.0 + 1.25 + + 1.0 + 1.0 + 1.0 + 1.0 + 1.0 + 1.0 + + + 1.8 + 15.12 + + 4.0 + 10.0 + 0.01 + 10.0 + 0.0 + + + 0.25 + 5 + 0.5 + + false + false + + false + oxygen + 1 + + + false + false + + 0.0 + + + + + + + 0 + 38 + 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 + + 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 + + + + ./config/model_0.bnd + ./config/model.cfg + + 1 + 0 + + + 1 + 0.0 + 1.0 + 0.0 + + + 0 + + + + + + + 1.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 + 540 + 0.0 + 0.0 + 0.0 + 0 + 0 + 2.0 + + + 0 + 10.0 + 1.25 + + 1.0 + 1.0 + 1.0 + 1.0 + 1.0 + 1.0 + + + 1.8 + 15.12 + + 4.0 + 10.0 + 0.01 + 10.0 + 0.0 + + + 0.25 + 5 + 0.5 + + false + false + + false + oxygen + 1 + + + false + false + + 0.0 + + + + + + + 0 + 38 + 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 + + 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 + + + + ./config/model_0.bnd + ./config/model.cfg + + 1 + 0 + + + 1 + 0.0 + 1.0 + 0.0 + + + 0.2 + + + + + + + 1.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 + 540 + 0.0 + 0.0 + 0.0 + 0 + 0 + 2.0 + + + 0 + 10.0 + 1.25 + + 1.0 + 1.0 + 1.0 + 1.0 + 1.0 + 1.0 + + + 1.8 + 15.12 + + 4.0 + 10.0 + 0.01 + 10.0 + 0.0 + + + 0.25 + 5 + 0.5 + + false + false + + false + oxygen + 1 + + + false + false + + 0.0 + + + + + + + 0 + 38 + 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 + + 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 + + + + ./config/model_0.bnd + ./config/model.cfg + + 1 + 0 + + + 1 + 0.0 + 0.25 + 0.0 + + + + + + + 1.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 + 540 + 0.0 + 0.0 + 0.0 + 0 + 0 + 2.0 + + + 0 + 10.0 + 1.25 + + 1.0 + 1.0 + 1.0 + 1.0 + 1.0 + 1.0 + + + 1.8 + 15.12 + + 4.0 + 10.0 + 0.01 + 10.0 + 0.0 + + + 0.25 + 5 + 0.5 + + false + false + + false + oxygen + 1 + + + false + false + + 0.0 + + + + + + + 0 + 38 + 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 + + 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 + + + + ./config/model_0.bnd + ./config/model.cfg + + 0 + 1 + + + 1 + 0.0 + 1.0 + 0.0 + + + 0.0 + + + + + + + 1.0 + + + + + + ./config + cells.csv + + - - - - 1.0 - - - - - - - ./config - cells.csv - - - - - - - ./config - cell_rules.csv - - - - - - - 0 - - - - - 5 - - + + 0 + C + diff --git a/config/cells.csv b/config/cells.csv index 734bdc7..ea9ee3c 100644 --- a/config/cells.csv +++ b/config/cells.csv @@ -1 +1,486 @@ -0,0,0,0 \ No newline at end of file +-10,-10,0,0 +10,-10,0,1 +-10,10,0,2 +10,10,0,3 +110,10,0,4 +110,-10,0,5 +-10,-20,0,0 +10,-20,0,1 +-10,20,0,2 +10,20,0,3 +110,20,0,4 +110,-20,0,5 +-10,-30,0,0 +10,-30,0,1 +-10,30,0,2 +10,30,0,3 +110,30,0,4 +110,-30,0,5 +-10,-40,0,0 +10,-40,0,1 +-10,40,0,2 +10,40,0,3 +110,40,0,4 +110,-40,0,5 +-10,-50,0,0 +10,-50,0,1 +-10,50,0,2 +10,50,0,3 +110,50,0,4 +110,-50,0,5 +-10,-60,0,0 +10,-60,0,1 +-10,60,0,2 +10,60,0,3 +110,60,0,4 +110,-60,0,5 +-10,-70,0,0 +10,-70,0,1 +-10,70,0,2 +10,70,0,3 +110,70,0,4 +110,-70,0,5 +-10,-80,0,0 +10,-80,0,1 +-10,80,0,2 +10,80,0,3 +110,80,0,4 +110,-80,0,5 +-10,-90,0,0 +10,-90,0,1 +-10,90,0,2 +10,90,0,3 +110,90,0,4 +110,-90,0,5 +-20,-10,0,0 +20,-10,0,1 +-20,10,0,2 +20,10,0,3 +120,10,0,4 +120,-10,0,5 +-20,-20,0,0 +20,-20,0,1 +-20,20,0,2 +20,20,0,3 +120,20,0,4 +120,-20,0,5 +-20,-30,0,0 +20,-30,0,1 +-20,30,0,2 +20,30,0,3 +120,30,0,4 +120,-30,0,5 +-20,-40,0,0 +20,-40,0,1 +-20,40,0,2 +20,40,0,3 +120,40,0,4 +120,-40,0,5 +-20,-50,0,0 +20,-50,0,1 +-20,50,0,2 +20,50,0,3 +120,50,0,4 +120,-50,0,5 +-20,-60,0,0 +20,-60,0,1 +-20,60,0,2 +20,60,0,3 +120,60,0,4 +120,-60,0,5 +-20,-70,0,0 +20,-70,0,1 +-20,70,0,2 +20,70,0,3 +120,70,0,4 +120,-70,0,5 +-20,-80,0,0 +20,-80,0,1 +-20,80,0,2 +20,80,0,3 +120,80,0,4 +120,-80,0,5 +-20,-90,0,0 +20,-90,0,1 +-20,90,0,2 +20,90,0,3 +120,90,0,4 +120,-90,0,5 +-30,-10,0,0 +30,-10,0,1 +-30,10,0,2 +30,10,0,3 +130,10,0,4 +130,-10,0,5 +-30,-20,0,0 +30,-20,0,1 +-30,20,0,2 +30,20,0,3 +130,20,0,4 +130,-20,0,5 +-30,-30,0,0 +30,-30,0,1 +-30,30,0,2 +30,30,0,3 +130,30,0,4 +130,-30,0,5 +-30,-40,0,0 +30,-40,0,1 +-30,40,0,2 +30,40,0,3 +130,40,0,4 +130,-40,0,5 +-30,-50,0,0 +30,-50,0,1 +-30,50,0,2 +30,50,0,3 +130,50,0,4 +130,-50,0,5 +-30,-60,0,0 +30,-60,0,1 +-30,60,0,2 +30,60,0,3 +130,60,0,4 +130,-60,0,5 +-30,-70,0,0 +30,-70,0,1 +-30,70,0,2 +30,70,0,3 +130,70,0,4 +130,-70,0,5 +-30,-80,0,0 +30,-80,0,1 +-30,80,0,2 +30,80,0,3 +130,80,0,4 +130,-80,0,5 +-30,-90,0,0 +30,-90,0,1 +-30,90,0,2 +30,90,0,3 +130,90,0,4 +130,-90,0,5 +-40,-10,0,0 +40,-10,0,1 +-40,10,0,2 +40,10,0,3 +140,10,0,4 +140,-10,0,5 +-40,-20,0,0 +40,-20,0,1 +-40,20,0,2 +40,20,0,3 +140,20,0,4 +140,-20,0,5 +-40,-30,0,0 +40,-30,0,1 +-40,30,0,2 +40,30,0,3 +140,30,0,4 +140,-30,0,5 +-40,-40,0,0 +40,-40,0,1 +-40,40,0,2 +40,40,0,3 +140,40,0,4 +140,-40,0,5 +-40,-50,0,0 +40,-50,0,1 +-40,50,0,2 +40,50,0,3 +140,50,0,4 +140,-50,0,5 +-40,-60,0,0 +40,-60,0,1 +-40,60,0,2 +40,60,0,3 +140,60,0,4 +140,-60,0,5 +-40,-70,0,0 +40,-70,0,1 +-40,70,0,2 +40,70,0,3 +140,70,0,4 +140,-70,0,5 +-40,-80,0,0 +40,-80,0,1 +-40,80,0,2 +40,80,0,3 +140,80,0,4 +140,-80,0,5 +-40,-90,0,0 +40,-90,0,1 +-40,90,0,2 +40,90,0,3 +140,90,0,4 +140,-90,0,5 +-50,-10,0,0 +50,-10,0,1 +-50,10,0,2 +50,10,0,3 +150,10,0,4 +150,-10,0,5 +-50,-20,0,0 +50,-20,0,1 +-50,20,0,2 +50,20,0,3 +150,20,0,4 +150,-20,0,5 +-50,-30,0,0 +50,-30,0,1 +-50,30,0,2 +50,30,0,3 +150,30,0,4 +150,-30,0,5 +-50,-40,0,0 +50,-40,0,1 +-50,40,0,2 +50,40,0,3 +150,40,0,4 +150,-40,0,5 +-50,-50,0,0 +50,-50,0,1 +-50,50,0,2 +50,50,0,3 +150,50,0,4 +150,-50,0,5 +-50,-60,0,0 +50,-60,0,1 +-50,60,0,2 +50,60,0,3 +150,60,0,4 +150,-60,0,5 +-50,-70,0,0 +50,-70,0,1 +-50,70,0,2 +50,70,0,3 +150,70,0,4 +150,-70,0,5 +-50,-80,0,0 +50,-80,0,1 +-50,80,0,2 +50,80,0,3 +150,80,0,4 +150,-80,0,5 +-50,-90,0,0 +50,-90,0,1 +-50,90,0,2 +50,90,0,3 +150,90,0,4 +150,-90,0,5 +-60,-10,0,0 +60,-10,0,1 +-60,10,0,2 +60,10,0,3 +160,10,0,4 +160,-10,0,5 +-60,-20,0,0 +60,-20,0,1 +-60,20,0,2 +60,20,0,3 +160,20,0,4 +160,-20,0,5 +-60,-30,0,0 +60,-30,0,1 +-60,30,0,2 +60,30,0,3 +160,30,0,4 +160,-30,0,5 +-60,-40,0,0 +60,-40,0,1 +-60,40,0,2 +60,40,0,3 +160,40,0,4 +160,-40,0,5 +-60,-50,0,0 +60,-50,0,1 +-60,50,0,2 +60,50,0,3 +160,50,0,4 +160,-50,0,5 +-60,-60,0,0 +60,-60,0,1 +-60,60,0,2 +60,60,0,3 +160,60,0,4 +160,-60,0,5 +-60,-70,0,0 +60,-70,0,1 +-60,70,0,2 +60,70,0,3 +160,70,0,4 +160,-70,0,5 +-60,-80,0,0 +60,-80,0,1 +-60,80,0,2 +60,80,0,3 +160,80,0,4 +160,-80,0,5 +-60,-90,0,0 +60,-90,0,1 +-60,90,0,2 +60,90,0,3 +160,90,0,4 +160,-90,0,5 +-70,-10,0,0 +70,-10,0,1 +-70,10,0,2 +70,10,0,3 +170,10,0,4 +170,-10,0,5 +-70,-20,0,0 +70,-20,0,1 +-70,20,0,2 +70,20,0,3 +170,20,0,4 +170,-20,0,5 +-70,-30,0,0 +70,-30,0,1 +-70,30,0,2 +70,30,0,3 +170,30,0,4 +170,-30,0,5 +-70,-40,0,0 +70,-40,0,1 +-70,40,0,2 +70,40,0,3 +170,40,0,4 +170,-40,0,5 +-70,-50,0,0 +70,-50,0,1 +-70,50,0,2 +70,50,0,3 +170,50,0,4 +170,-50,0,5 +-70,-60,0,0 +70,-60,0,1 +-70,60,0,2 +70,60,0,3 +170,60,0,4 +170,-60,0,5 +-70,-70,0,0 +70,-70,0,1 +-70,70,0,2 +70,70,0,3 +170,70,0,4 +170,-70,0,5 +-70,-80,0,0 +70,-80,0,1 +-70,80,0,2 +70,80,0,3 +170,80,0,4 +170,-80,0,5 +-70,-90,0,0 +70,-90,0,1 +-70,90,0,2 +70,90,0,3 +170,90,0,4 +170,-90,0,5 +-80,-10,0,0 +80,-10,0,1 +-80,10,0,2 +80,10,0,3 +180,10,0,4 +180,-10,0,5 +-80,-20,0,0 +80,-20,0,1 +-80,20,0,2 +80,20,0,3 +180,20,0,4 +180,-20,0,5 +-80,-30,0,0 +80,-30,0,1 +-80,30,0,2 +80,30,0,3 +180,30,0,4 +180,-30,0,5 +-80,-40,0,0 +80,-40,0,1 +-80,40,0,2 +80,40,0,3 +180,40,0,4 +180,-40,0,5 +-80,-50,0,0 +80,-50,0,1 +-80,50,0,2 +80,50,0,3 +180,50,0,4 +180,-50,0,5 +-80,-60,0,0 +80,-60,0,1 +-80,60,0,2 +80,60,0,3 +180,60,0,4 +180,-60,0,5 +-80,-70,0,0 +80,-70,0,1 +-80,70,0,2 +80,70,0,3 +180,70,0,4 +180,-70,0,5 +-80,-80,0,0 +80,-80,0,1 +-80,80,0,2 +80,80,0,3 +180,80,0,4 +180,-80,0,5 +-80,-90,0,0 +80,-90,0,1 +-80,90,0,2 +80,90,0,3 +180,90,0,4 +180,-90,0,5 +-90,-10,0,0 +90,-10,0,1 +-90,10,0,2 +90,10,0,3 +190,10,0,4 +190,-10,0,5 +-90,-20,0,0 +90,-20,0,1 +-90,20,0,2 +90,20,0,3 +190,20,0,4 +190,-20,0,5 +-90,-30,0,0 +90,-30,0,1 +-90,30,0,2 +90,30,0,3 +190,30,0,4 +190,-30,0,5 +-90,-40,0,0 +90,-40,0,1 +-90,40,0,2 +90,40,0,3 +190,40,0,4 +190,-40,0,5 +-90,-50,0,0 +90,-50,0,1 +-90,50,0,2 +90,50,0,3 +190,50,0,4 +190,-50,0,5 +-90,-60,0,0 +90,-60,0,1 +-90,60,0,2 +90,60,0,3 +190,60,0,4 +190,-60,0,5 +-90,-70,0,0 +90,-70,0,1 +-90,70,0,2 +90,70,0,3 +190,70,0,4 +190,-70,0,5 +-90,-80,0,0 +90,-80,0,1 +-90,80,0,2 +90,80,0,3 +190,80,0,4 +190,-80,0,5 +-90,-90,0,0 +90,-90,0,1 +-90,90,0,2 +90,90,0,3 +190,90,0,4 +190,-90,0,5 diff --git a/config/model.cfg b/config/model.cfg new file mode 100644 index 0000000..c71e514 --- /dev/null +++ b/config/model.cfg @@ -0,0 +1,12 @@ +$time_scale = 0.05; +$oxygen_concentration = 0.0; + +discrete_time = 0; +use_physrandgen = FALSE; +seed_pseudorandom = 100; +sample_count = 10; + +max_time = 1; +time_tick = 0.1; + +thread_count = 1; diff --git a/config/model_0.bnd b/config/model_0.bnd new file mode 100644 index 0000000..556018b --- /dev/null +++ b/config/model_0.bnd @@ -0,0 +1,17 @@ +Node A { + logic = A; + rate_up = @logic ? $time_scale : 0; + rate_down = @logic ? 0 : $time_scale; +} + +Node B { + logic = B; + rate_up = @logic ? $time_scale : 0; + rate_down = @logic ? 0 : $time_scale; +} + +Node C { + logic = A & B; + rate_up = @logic ? $time_scale : 0; + rate_down = @logic ? 0 : $time_scale; +} diff --git a/config/model_1.bnd b/config/model_1.bnd new file mode 100644 index 0000000..340bb2c --- /dev/null +++ b/config/model_1.bnd @@ -0,0 +1,17 @@ +Node A { + logic = A; + rate_up = @logic ? $time_scale : 0; + rate_down = @logic ? 0 : $time_scale; +} + +Node B { + logic = B; + rate_up = @logic ? $time_scale : 0; + rate_down = @logic ? 0 : $time_scale; +} + +Node C { + logic = A | B; + rate_up = @logic ? $time_scale : 0; + rate_down = @logic ? 0 : $time_scale; +} diff --git a/config/rules.csv b/config/rules.csv new file mode 100644 index 0000000..e69de29 diff --git a/custom_modules/custom.cpp b/custom_modules/custom.cpp index d3b6fda..9fcb7bb 100644 --- a/custom_modules/custom.cpp +++ b/custom_modules/custom.cpp @@ -33,7 +33,7 @@ # # # BSD 3-Clause License (see https://opensource.org/licenses/BSD-3-Clause) # # # -# Copyright (c) 2015-2021, Paul Macklin and the PhysiCell Project # +# Copyright (c) 2015-2018, Paul Macklin and the PhysiCell Project # # All rights reserved. # # # # Redistribution and use in source and binary forms, with or without # @@ -65,7 +65,13 @@ ############################################################################### */ -#include "./custom.h" +#include "custom.h" +#include "../BioFVM/BioFVM.h" +using namespace BioFVM; + +// declare cell definitions here + +std::vector nodes; void create_cell_types( void ) { @@ -81,61 +87,54 @@ void create_cell_types( void ) 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.volume_update_function = standard_volume_update_function; + cell_defaults.functions.update_velocity = NULL; + cell_defaults.functions.update_phenotype = NULL; cell_defaults.functions.update_migration_bias = NULL; - cell_defaults.functions.update_phenotype = NULL; // update_cell_and_death_parameters_O2_based; + cell_defaults.functions.pre_update_intracellular = pre_update_intracellular; + cell_defaults.functions.post_update_intracellular = post_update_intracellular; 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; + cell_defaults.custom_data.add_variable(parameters.strings("node_to_visualize"), "dimensionless", 0.0 ); //for paraview visualization + /* This parses the cell definitions in the XML config file. */ initialize_cell_definitions_from_pugixml(); - + + /* + Put any modifications to individual cell definitions here. + + This is a good place to set custom functions. + */ + /* 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(); + setup_signal_behavior_dictionaries(); /* - Cell rule definitions + This summarizes the setup. */ - - setup_cell_rules(); - - /* - 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; } @@ -155,92 +154,44 @@ void setup_microenvironment( void ) 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 your CSV file 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 pre_update_intracellular( Cell* pCell, Phenotype& phenotype, double dt ) +{ + if (PhysiCell::PhysiCell_globals.current_time >= 100.0 + && pCell->phenotype.intracellular->get_parameter_value("$time_scale") == 0.0 + ){ + pCell->phenotype.intracellular->set_parameter_value("$time_scale", 0.1); + } -void custom_function( Cell* pCell, Phenotype& phenotype , double dt ) -{ return; } +} -void contact_function( Cell* pMe, Phenotype& phenoMe , Cell* pOther, Phenotype& phenoOther , double dt ) -{ return; } +void post_update_intracellular( Cell* pCell, Phenotype& phenotype, double dt ) +{ + color_node(pCell); +} -void treatment_function () +std::vector my_coloring_function( Cell* pCell ) { - if (PhysiCell::parameters.bools.find_index("treatment") != -1) + std::vector< std::string > output( 4 , "rgb(0,0,0)" ); + + if ( !pCell->phenotype.intracellular->get_boolean_variable_value( parameters.strings("node_to_visualize") ) ) { - int treatment_substrate_index = BioFVM::microenvironment.find_density_index(PhysiCell::parameters.strings("treatment_substrate")); - - if (PhysiCell::parameters.bools("treatment")){ + output[0] = "rgb(255,0,0)"; + output[2] = "rgb(125,0,0)"; - if ( - (((int)PhysiCell::PhysiCell_globals.current_time) % PhysiCell::parameters.ints("treatment_period")) == 0 - && !BioFVM::microenvironment.get_substrate_dirichlet_activation(treatment_substrate_index) - ) - { - std::cout << PhysiCell::parameters.strings("treatment_substrate") << " activation at t=" << PhysiCell::PhysiCell_globals.current_time << std::endl; - BioFVM::microenvironment.set_substrate_dirichlet_activation(treatment_substrate_index, true); - } - - if ( - (((int)PhysiCell::PhysiCell_globals.current_time) % PhysiCell::parameters.ints("treatment_period")) == PhysiCell::parameters.ints("treatment_duration") - && BioFVM::microenvironment.get_substrate_dirichlet_activation(treatment_substrate_index) - ) - { - std::cout << PhysiCell::parameters.strings("treatment_substrate") << " inactivation at t=" << PhysiCell::PhysiCell_globals.current_time << std::endl; - BioFVM::microenvironment.set_substrate_dirichlet_activation(treatment_substrate_index, false); - } - - } else if ( BioFVM::microenvironment.get_substrate_dirichlet_activation(treatment_substrate_index) ){ - std::cout << PhysiCell::parameters.strings("treatment_substrate") << " inactivation (NO TREATMENT) at t=" << PhysiCell::PhysiCell_globals.current_time << std::endl; - BioFVM::microenvironment.set_substrate_dirichlet_activation(treatment_substrate_index, false); - } } + else{ + output[0] = "rgb(0, 255,0)"; + output[2] = "rgb(0, 125,0)"; + } + + return output; +} + +void color_node(Cell* pCell){ + std::string node_name = parameters.strings("node_to_visualize"); + pCell->custom_data[node_name] = pCell->phenotype.intracellular->get_boolean_variable_value(node_name); } \ No newline at end of file diff --git a/custom_modules/custom.h b/custom_modules/custom.h index bb5843d..cc7a6cc 100644 --- a/custom_modules/custom.h +++ b/custom_modules/custom.h @@ -33,7 +33,7 @@ # # # BSD 3-Clause License (see https://opensource.org/licenses/BSD-3-Clause) # # # -# Copyright (c) 2015-2021, Paul Macklin and the PhysiCell Project # +# Copyright (c) 2015-2018, Paul Macklin and the PhysiCell Project # # All rights reserved. # # # # Redistribution and use in source and binary forms, with or without # @@ -64,6 +64,8 @@ # # ############################################################################### */ +#ifndef __Custom_h__ +#define __Custom_h__ #include "../core/PhysiCell.h" #include "../modules/PhysiCell_standard_modules.h" @@ -72,22 +74,18 @@ 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 ); +// custom cell phenotype functions could go here +void pre_update_intracellular( Cell* pCell, Phenotype& phenotype, double dt ); +void post_update_intracellular( Cell* pCell, Phenotype& phenotype, double dt ); +void color_node(Cell* pCell); -void treatment_function (); \ No newline at end of file +#endif diff --git a/main.cpp b/main.cpp index e1dfd12..152051d 100644 --- a/main.cpp +++ b/main.cpp @@ -33,7 +33,7 @@ # # # BSD 3-Clause License (see https://opensource.org/licenses/BSD-3-Clause) # # # -# Copyright (c) 2015-2022, Paul Macklin and the PhysiCell Project # +# Copyright (c) 2015-2018, Paul Macklin and the PhysiCell Project # # All rights reserved. # # # # Redistribution and use in source and binary forms, with or without # @@ -75,12 +75,11 @@ #include "./core/PhysiCell.h" #include "./modules/PhysiCell_standard_modules.h" - // put custom code modules here! #include "./custom_modules/custom.h" #include "./addons/PhysiBoSS/src/maboss_intracellular.h" - + using namespace BioFVM; using namespace PhysiCell; @@ -93,7 +92,7 @@ int main( int argc, char* argv[] ) if( argc > 1 ) { XML_status = load_PhysiCell_config_file( argv[1] ); - sprintf( copy_command , "cp %s %s/PhysiCell_settings.xml" , argv[1] , PhysiCell_settings.folder.c_str() ); + sprintf( copy_command , "cp %s %s" , argv[1] , PhysiCell_settings.folder.c_str() ); } else { @@ -119,7 +118,7 @@ int main( int argc, char* argv[] ) /* PhysiCell setup */ // set mechanics voxel size, and match the data structure to BioFVM - double mechanics_voxel_size = 30; + double mechanics_voxel_size = 10; Cell_Container* cell_container = create_cell_container_for_microenvironment( microenvironment, mechanics_voxel_size ); /* Users typically start modifying here. START USERMODS */ @@ -128,6 +127,7 @@ int main( int argc, char* argv[] ) setup_tissue(); + /* Users typically stop modifying here. END USERMODS */ // set MultiCellDS save options @@ -139,8 +139,11 @@ int main( int argc, char* argv[] ) // save a simulation snapshot + //mkdir("../output"); + char filename[1024]; sprintf( filename , "%s/initial" , PhysiCell_settings.folder.c_str() ); + save_PhysiCell_to_MultiCellDS_v2( filename , microenvironment , PhysiCell_globals.current_time ); // save a quick SVG cross section through z = 0, after setting its @@ -150,7 +153,7 @@ int main( int argc, char* argv[] ) // for simplicity, set a pathology coloring function - std::vector (*cell_coloring_function)(Cell*) = my_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 ); @@ -215,8 +218,10 @@ int main( int argc, char* argv[] ) } } - // Configure treatments - treatment_function(); + /* + Custom add-ons could potentially go here. + */ + // update the microenvironment microenvironment.simulate_diffusion_decay( diffusion_dt ); @@ -224,13 +229,11 @@ int main( int argc, char* argv[] ) // run PhysiCell ((Cell_Container *)microenvironment.agent_container)->update_all_cells( PhysiCell_globals.current_time ); - /* - Custom add-ons could potentially go here. - */ + //std::cout<< "done" << std::endl; 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); @@ -249,7 +252,7 @@ int main( int argc, char* argv[] ) 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; diff --git a/model.yml b/model.yml index 0245cd9..705ad1d 100644 --- a/model.yml +++ b/model.yml @@ -1,5 +1,5 @@ -short_name: template-model +short_name: physiboss-cell-lines version: 1.0.0 -binary: project +binary: PhysiBoSS_Cell_Lines config: - config/PhysiCell_settings.xml diff --git a/sample_projects/physiboss-cell-lines/Makefile b/sample_projects/physiboss-cell-lines/Makefile new file mode 100644 index 0000000..b620591 --- /dev/null +++ b/sample_projects/physiboss-cell-lines/Makefile @@ -0,0 +1,355 @@ +VERSION := $(shell grep . VERSION.txt | cut -f1 -d:) +PROGRAM_NAME := PhysiBoSS_Cell_Lines + +CC := g++ +# CC := g++-mp-7 # typical macports compiler name +# CC := g++-7 # typical homebrew compiler name + +# Check for environment definitions of compiler +# e.g., on CC = g++-7 on OSX +ifdef PHYSICELL_CPP + CC := $(PHYSICELL_CPP) +endif + +### MaBoSS configuration +# MaBoSS max nodes +ifndef MABOSS_MAX_NODES +MABOSS_MAX_NODES = 64 +endif + +# MaBoSS directory +MABOSS_DIR = addons/PhysiBoSS/MaBoSS/engine +CUR_DIR = $(shell pwd) +CUSTOM_DIR = sample_projects/Arnau_model/custom_modules + +ifneq ($(OS), Windows_NT) + LDL_FLAG = -ldl +endif + +LIB := -L$(CUR_DIR)/$(MABOSS_DIR)/lib -lMaBoSS-static $(LDL_FLAG) +INC := -DADDON_PHYSIBOSS -I$(CUR_DIR)/$(MABOSS_DIR)/include -DMAXNODES=$(MABOSS_MAX_NODES) + + +# If max nodes > 64, change lib path +ifeq ($(shell expr $(MABOSS_MAX_NODES) '>' 64), 1) +LIB := -L$(CUR_DIR)/$(MABOSS_DIR)/lib -lMaBoSS_$(MABOSS_MAX_NODES)n-static $(LDL_FLAG) +endif + +ifndef STATIC_OPENMP + STATIC_OPENMP = -fopenmp +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 + +# CFLAGS := -march=$(ARCH) -Ofast -s -fomit-frame-pointer -mfpmath=both -fopenmp -m64 -std=c++11 +CFLAGS := -march=$(ARCH) -O3 -fomit-frame-pointer -mfpmath=both -fopenmp -m64 -std=c++11 + +ifeq ($(OS),Windows_NT) +else + UNAME_S := $(shell uname -s) + ifeq ($(UNAME_S),Darwin) + UNAME_P := $(shell uname -p) + var := $(shell which $(CC) | xargs file) + ifeq ($(lastword $(var)),arm64) + CFLAGS := -march=$(ARCH) -O3 -fomit-frame-pointer -fopenmp -m64 -std=c++11 + endif + endif +endif + +CFLAGS_LINK := $(shell echo $(CFLAGS) | sed -e "s/-fopenmp//g") +COMPILE_COMMAND := $(CC) $(CFLAGS) $(EXTRA_FLAGS) +LINK_COMMAND := $(CC) $(CFLAGS_LINK) $(EXTRA_FLAGS) + +BioFVM_OBJECTS := BioFVM_vector.o BioFVM_mesh.o BioFVM_microenvironment.o BioFVM_solvers.o BioFVM_matlab.o \ +BioFVM_utilities.o BioFVM_basic_agent.o BioFVM_MultiCellDS.o BioFVM_agent_container.o + +PhysiCell_core_OBJECTS := PhysiCell_phenotype.o PhysiCell_cell_container.o PhysiCell_standard_models.o \ +PhysiCell_cell.o PhysiCell_custom.o PhysiCell_utilities.o PhysiCell_constants.o PhysiCell_basic_signaling.o \ +PhysiCell_signal_behavior.o PhysiCell_rules.o + +PhysiCell_module_OBJECTS := PhysiCell_SVG.o PhysiCell_pathology.o PhysiCell_MultiCellDS.o PhysiCell_various_outputs.o \ +PhysiCell_pugixml.o PhysiCell_settings.o PhysiCell_geometry.o + +# put your custom objects here (they should be in the custom_modules directory) +MaBoSS := ./addons/PhysiBoSS/MaBoSS/engine/src/BooleanNetwork.h + +PhysiBoSS_OBJECTS := maboss_network.o maboss_intracellular.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) $(PhysiBoSS_OBJECTS) + +# compile the project + +all: main.cpp $(ALL_OBJECTS) $(MaBoSS) + $(COMPILE_COMMAND) $(INC) -o $(PROGRAM_NAME) $(ALL_OBJECTS) main.cpp $(LIB) + make name + +static: main.cpp $(ALL_OBJECTS) $(MaBoSS) + $(LINK_COMMAND) $(INC) -o $(PROGRAM_NAME) $(ALL_OBJECTS) main.cpp $(LIB) -static-libgcc -static-libstdc++ $(STATIC_OPENMP) + +name: + @echo "" + @echo "Executable name is" $(PROGRAM_NAME) + @echo "" + +# PhysiCell core components + +PhysiCell_phenotype.o: ./core/PhysiCell_phenotype.cpp + $(COMPILE_COMMAND) -c ./core/PhysiCell_phenotype.cpp + +PhysiCell_digital_cell_line.o: ./core/PhysiCell_digital_cell_line.cpp + $(COMPILE_COMMAND) -c ./core/PhysiCell_digital_cell_line.cpp + +PhysiCell_cell.o: ./core/PhysiCell_cell.cpp $(MaBoSS) + $(COMPILE_COMMAND) $(INC) -c ./core/PhysiCell_cell.cpp + +PhysiCell_cell_container.o: ./core/PhysiCell_cell_container.cpp + $(COMPILE_COMMAND) -c ./core/PhysiCell_cell_container.cpp + +PhysiCell_standard_models.o: ./core/PhysiCell_standard_models.cpp + $(COMPILE_COMMAND) -c ./core/PhysiCell_standard_models.cpp + +PhysiCell_utilities.o: ./core/PhysiCell_utilities.cpp + $(COMPILE_COMMAND) -c ./core/PhysiCell_utilities.cpp + +PhysiCell_custom.o: ./core/PhysiCell_custom.cpp + $(COMPILE_COMMAND) -c ./core/PhysiCell_custom.cpp + +PhysiCell_constants.o: ./core/PhysiCell_constants.cpp + $(COMPILE_COMMAND) -c ./core/PhysiCell_constants.cpp + +PhysiCell_signal_behavior.o: ./core/PhysiCell_signal_behavior.cpp + $(COMPILE_COMMAND) -c ./core/PhysiCell_signal_behavior.cpp + +PhysiCell_rules.o: ./core/PhysiCell_rules.cpp + $(COMPILE_COMMAND) -c ./core/PhysiCell_rules.cpp + +# BioFVM core components (needed by PhysiCell) + +BioFVM_vector.o: ./BioFVM/BioFVM_vector.cpp + $(COMPILE_COMMAND) -c ./BioFVM/BioFVM_vector.cpp + +BioFVM_agent_container.o: ./BioFVM/BioFVM_agent_container.cpp + $(COMPILE_COMMAND) -c ./BioFVM/BioFVM_agent_container.cpp + +BioFVM_mesh.o: ./BioFVM/BioFVM_mesh.cpp + $(COMPILE_COMMAND) -c ./BioFVM/BioFVM_mesh.cpp + +BioFVM_microenvironment.o: ./BioFVM/BioFVM_microenvironment.cpp + $(COMPILE_COMMAND) -c ./BioFVM/BioFVM_microenvironment.cpp + +BioFVM_solvers.o: ./BioFVM/BioFVM_solvers.cpp + $(COMPILE_COMMAND) -c ./BioFVM/BioFVM_solvers.cpp + +BioFVM_utilities.o: ./BioFVM/BioFVM_utilities.cpp + $(COMPILE_COMMAND) -c ./BioFVM/BioFVM_utilities.cpp + +BioFVM_basic_agent.o: ./BioFVM/BioFVM_basic_agent.cpp + $(COMPILE_COMMAND) -c ./BioFVM/BioFVM_basic_agent.cpp + +BioFVM_matlab.o: ./BioFVM/BioFVM_matlab.cpp + $(COMPILE_COMMAND) -c ./BioFVM/BioFVM_matlab.cpp + +BioFVM_MultiCellDS.o: ./BioFVM/BioFVM_MultiCellDS.cpp + $(COMPILE_COMMAND) -c ./BioFVM/BioFVM_MultiCellDS.cpp + +pugixml.o: ./BioFVM/pugixml.cpp + $(COMPILE_COMMAND) -c ./BioFVM/pugixml.cpp + +# standard PhysiCell modules + +PhysiCell_SVG.o: ./modules/PhysiCell_SVG.cpp + $(COMPILE_COMMAND) -c ./modules/PhysiCell_SVG.cpp + +PhysiCell_pathology.o: ./modules/PhysiCell_pathology.cpp + $(COMPILE_COMMAND) -c ./modules/PhysiCell_pathology.cpp + +PhysiCell_MultiCellDS.o: ./modules/PhysiCell_MultiCellDS.cpp $(MaBoSS) + $(COMPILE_COMMAND) $(INC) -c ./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 + +PhysiCell_basic_signaling.o: ./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 + +Compile_MaBoSS: ./addons/PhysiBoSS/MaBoSS/engine/src/BooleanNetwork.h + cd ./addons/PhysiBoSS/MaBoSS/engine/src;make CXX=$(CC) MAXNODES=$(MABOSS_MAX_NODES) install_alib;make clean; cd ../../../../.. + +$(MaBoSS): +ifeq ($(OS), Windows_NT) + python addons/PhysiBoSS/setup_libmaboss.py +else + python3 addons/PhysiBoSS/setup_libmaboss.py +endif + +maboss_network.o: ./addons/PhysiBoSS/src/maboss_network.cpp $(MaBoSS) + $(COMPILE_COMMAND) $(INC) -c ./addons/PhysiBoSS/src/maboss_network.cpp + +maboss_intracellular.o: ./addons/PhysiBoSS/src/maboss_intracellular.cpp $(MaBoSS) + $(COMPILE_COMMAND) $(INC) -c ./addons/PhysiBoSS/src/maboss_intracellular.cpp + +custom.o: ./custom_modules/custom.cpp $(MaBoSS) + $(COMPILE_COMMAND) $(INC) -c ./custom_modules/custom.cpp + +# cleanup + +reset: + rm -f *.cpp + cp ./sample_projects/Makefile-default Makefile + rm -f ./custom_modules/* + touch ./custom_modules/empty.txt + touch ALL_CITATIONS.txt + touch ./core/PhysiCell_cell.cpp + rm ALL_CITATIONS.txt + cp ./config/PhysiCell_settings-backup.xml ./config/PhysiCell_settings.xml + rm -rf ./config/model_*.bnd ./config/model.cfg ./config/cells.csv + rm -rf ./scripts + +MaBoSS-clean: + rm -fr addons/PhysiBoSS/MaBoSS + +clean: + rm -f *.o + rm -f $(PROGRAM_NAME)* + +data-cleanup: + rm -f *.mat + rm -f *.xml + rm -f *.svg + rm -f ./output/* + touch ./output/empty.txt + +# archival + +checkpoint: + zip -r $$(date +%b_%d_%Y_%H%M).zip Makefile *.cpp *.h config/*.xml custom_modules/* + +zip: + zip -r latest.zip Makefile* *.cpp *.h BioFVM/* config/* core/* custom_modules/* matlab/* modules/* sample_projects/* + cp latest.zip $$(date +%b_%d_%Y_%H%M).zip + cp latest.zip VERSION_$(VERSION).zip + mv *.zip archives/ + +tar: + tar --ignore-failed-read -czf latest.tar Makefile* *.cpp *.h BioFVM/* config/* core/* custom_modules/* matlab/* modules/* sample_projects/* + cp latest.tar $$(date +%b_%d_%Y_%H%M).tar + cp latest.tar VERSION_$(VERSION).tar + mv *.tar archives/ + +unzip: + cp ./archives/latest.zip . + unzip latest.zip + +untar: + cp ./archives/latest.tar . + tar -xzf latest.tar + +movie: + ffmpeg -r 25 -i output/snapshot%08d.svg -pix_fmt yuv420p output.mp4 + vlc output.mp4 + +# upgrade rules + +SOURCE := PhysiCell_upgrade.zip +get-upgrade: + @echo $$(curl https://raw.githubusercontent.com/MathCancer/PhysiCell/master/VERSION.txt) > VER.txt + @echo https://github.com/MathCancer/PhysiCell/releases/download/$$(grep . VER.txt)/PhysiCell_V.$$(grep . VER.txt).zip > DL_FILE.txt + rm -f VER.txt + $$(curl -L $$(grep . DL_FILE.txt) --output PhysiCell_upgrade.zip) + rm -f DL_FILE.txt + +PhysiCell_upgrade.zip: + make get-upgrade + +upgrade: $(SOURCE) + unzip $(SOURCE) PhysiCell/VERSION.txt + mv -f PhysiCell/VERSION.txt . + unzip $(SOURCE) PhysiCell/core/* + cp -r PhysiCell/core/* core + unzip $(SOURCE) PhysiCell/modules/* + cp -r PhysiCell/modules/* modules + unzip $(SOURCE) PhysiCell/sample_projects/* + cp -r PhysiCell/sample_projects/* sample_projects + unzip $(SOURCE) PhysiCell/BioFVM/* + cp -r PhysiCell/BioFVM/* BioFVM + unzip $(SOURCE) PhysiCell/documentation/User_Guide.pdf + mv -f PhysiCell/documentation/User_Guide.pdf documentation + rm -f -r PhysiCell + rm -f $(SOURCE) + +# use: make save PROJ=your_project_name +PROJ := my_project + +save: + echo "Saving project as $(PROJ) ... " + mkdir -p ./user_projects + mkdir -p ./user_projects/$(PROJ) + mkdir -p ./user_projects/$(PROJ)/custom_modules + mkdir -p ./user_projects/$(PROJ)/config + cp main.cpp ./user_projects/$(PROJ) + cp Makefile ./user_projects/$(PROJ) + cp VERSION.txt ./user_projects/$(PROJ) + cp -r ./config/* ./user_projects/$(PROJ)/config + cp -r ./custom_modules/* ./user_projects/$(PROJ)/custom_modules + +load: + echo "Loading project from $(PROJ) ... " + cp ./user_projects/$(PROJ)/main.cpp . + cp ./user_projects/$(PROJ)/Makefile . + cp -r ./user_projects/$(PROJ)/config/* ./config/ + cp -r ./user_projects/$(PROJ)/custom_modules/* ./custom_modules/ + +pack: + @echo " " + @echo "Preparing project $(PROJ) for sharing ... " + @echo " " + cd ./user_projects && zip -r $(PROJ).zip $(PROJ) + @echo " " + @echo "Share ./user_projects/$(PROJ).zip ... " + @echo "Other users can unzip $(PROJ).zip in their ./user_projects, compile, and run." + @echo " " + +unpack: + @echo " " + @echo "Preparing shared project $(PROJ).zip for use ... " + @echo " " + cd ./user_projects && unzip $(PROJ).zip + @echo " " + @echo "Load this project via make load PROJ=$(PROJ) ... " + @echo " " + +list-user-projects: + @echo "user projects::" + @cd ./user_projects && ls -dt1 * | grep . | sed 's!empty.txt!!' diff --git a/sample_projects/physiboss-cell-lines/README.md b/sample_projects/physiboss-cell-lines/README.md new file mode 100644 index 0000000..da93e83 --- /dev/null +++ b/sample_projects/physiboss-cell-lines/README.md @@ -0,0 +1,3 @@ +# PhyiBoSS Cell Lines model + +This model was the toy model for testing the implementation of the XML definition of a PhysiBoSS model, for PhysiBoSS 2.0 \ No newline at end of file diff --git a/sample_projects/physiboss-cell-lines/config/PhysiCell_settings.xml b/sample_projects/physiboss-cell-lines/config/PhysiCell_settings.xml new file mode 100644 index 0000000..b41a3fc --- /dev/null +++ b/sample_projects/physiboss-cell-lines/config/PhysiCell_settings.xml @@ -0,0 +1,1068 @@ + + + + -100 + 200 + -100 + 100 + -20 + 20 + 10 + 10 + 10 + false + + + + 200 + min + micron + 0.02 + 0.1 + 0.5 + + + + 6 + + + + output + + 10 + true + + + 10 + true + + + true + + + + + false + false + true + + + + + + 100000.0 + .1 + + 38.0 + 38.0 + + 0 + 0 + 0 + 0 + 0 + 0 + + + + true + true + + ./config/initial.mat + + + ./config/dirichlet.mat + + + + + + + + + + 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 + 540 + 0.0 + 0.0 + 0.0 + 0 + 0 + 2.0 + + + 0 + 10.0 + 1.25 + + 1.0 + 1.0 + 1.0 + 1.0 + 1.0 + 1.0 + + + 1.8 + 15.12 + + 4.0 + 10.0 + 0.01 + 10.0 + 0.0 + + + 0.25 + 5 + 0.5 + + false + false + + false + oxygen + 1 + + + false + false + + 0.0 + + + + + + + 0 + 38 + 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 + + 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 + + + + ./config/model_0.bnd + ./config/model.cfg + + 1 + 0 + + + 1 + 0.0 + 1.0 + 0.0 + + + + + + + 1.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 + 540 + 0.0 + 0.0 + 0.0 + 0 + 0 + 2.0 + + + 0 + 10.0 + 1.25 + + 1.0 + 1.0 + 1.0 + 1.0 + 1.0 + 1.0 + + + 1.8 + 15.12 + + 4.0 + 10.0 + 0.01 + 10.0 + 0.0 + + + 0.25 + 5 + 0.5 + + false + false + + false + oxygen + 1 + + + false + false + + 0.0 + + + + + + + 0 + 38 + 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 + + 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 + + + + ./config/model_1.bnd + ./config/model.cfg + + 1 + 0 + + + 1 + 0.0 + 1.0 + 0.0 + + + + + + + 1.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 + 540 + 0.0 + 0.0 + 0.0 + 0 + 0 + 2.0 + + + 0 + 10.0 + 1.25 + + 1.0 + 1.0 + 1.0 + 1.0 + 1.0 + 1.0 + + + 1.8 + 15.12 + + 4.0 + 10.0 + 0.01 + 10.0 + 0.0 + + + 0.25 + 5 + 0.5 + + false + false + + false + oxygen + 1 + + + false + false + + 0.0 + + + + + + + 0 + 38 + 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 + + 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 + + + + ./config/model_0.bnd + ./config/model.cfg + + 1 + 0 + + + 1 + 0.0 + 1.0 + 0.0 + + + 0 + + + + + + + 1.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 + 540 + 0.0 + 0.0 + 0.0 + 0 + 0 + 2.0 + + + 0 + 10.0 + 1.25 + + 1.0 + 1.0 + 1.0 + 1.0 + 1.0 + 1.0 + + + 1.8 + 15.12 + + 4.0 + 10.0 + 0.01 + 10.0 + 0.0 + + + 0.25 + 5 + 0.5 + + false + false + + false + oxygen + 1 + + + false + false + + 0.0 + + + + + + + 0 + 38 + 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 + + 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 + + + + ./config/model_0.bnd + ./config/model.cfg + + 1 + 0 + + + 1 + 0.0 + 1.0 + 0.0 + + + 0.2 + + + + + + + 1.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 + 540 + 0.0 + 0.0 + 0.0 + 0 + 0 + 2.0 + + + 0 + 10.0 + 1.25 + + 1.0 + 1.0 + 1.0 + 1.0 + 1.0 + 1.0 + + + 1.8 + 15.12 + + 4.0 + 10.0 + 0.01 + 10.0 + 0.0 + + + 0.25 + 5 + 0.5 + + false + false + + false + oxygen + 1 + + + false + false + + 0.0 + + + + + + + 0 + 38 + 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 + + 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 + + + + ./config/model_0.bnd + ./config/model.cfg + + 1 + 0 + + + 1 + 0.0 + 0.25 + 0.0 + + + + + + + 1.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 + 540 + 0.0 + 0.0 + 0.0 + 0 + 0 + 2.0 + + + 0 + 10.0 + 1.25 + + 1.0 + 1.0 + 1.0 + 1.0 + 1.0 + 1.0 + + + 1.8 + 15.12 + + 4.0 + 10.0 + 0.01 + 10.0 + 0.0 + + + 0.25 + 5 + 0.5 + + false + false + + false + oxygen + 1 + + + false + false + + 0.0 + + + + + + + 0 + 38 + 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 + + 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 + + + + ./config/model_0.bnd + ./config/model.cfg + + 0 + 1 + + + 1 + 0.0 + 1.0 + 0.0 + + + 0.0 + + + + + + + 1.0 + + + + + + + ./config + cells.csv + + + + + 0 + C + + \ No newline at end of file diff --git a/sample_projects/physiboss-cell-lines/config/cells.csv b/sample_projects/physiboss-cell-lines/config/cells.csv new file mode 100644 index 0000000..186e7d3 --- /dev/null +++ b/sample_projects/physiboss-cell-lines/config/cells.csv @@ -0,0 +1,486 @@ +-10,-10,0,0 +10,-10,0,1 +-10,10,0,2 +10,10,0,3 +110,10,0,4 +110,-10,0,5 +-10,-20,0,0 +10,-20,0,1 +-10,20,0,2 +10,20,0,3 +110,20,0,4 +110,-20,0,5 +-10,-30,0,0 +10,-30,0,1 +-10,30,0,2 +10,30,0,3 +110,30,0,4 +110,-30,0,5 +-10,-40,0,0 +10,-40,0,1 +-10,40,0,2 +10,40,0,3 +110,40,0,4 +110,-40,0,5 +-10,-50,0,0 +10,-50,0,1 +-10,50,0,2 +10,50,0,3 +110,50,0,4 +110,-50,0,5 +-10,-60,0,0 +10,-60,0,1 +-10,60,0,2 +10,60,0,3 +110,60,0,4 +110,-60,0,5 +-10,-70,0,0 +10,-70,0,1 +-10,70,0,2 +10,70,0,3 +110,70,0,4 +110,-70,0,5 +-10,-80,0,0 +10,-80,0,1 +-10,80,0,2 +10,80,0,3 +110,80,0,4 +110,-80,0,5 +-10,-90,0,0 +10,-90,0,1 +-10,90,0,2 +10,90,0,3 +110,90,0,4 +110,-90,0,5 +-20,-10,0,0 +20,-10,0,1 +-20,10,0,2 +20,10,0,3 +120,10,0,4 +120,-10,0,5 +-20,-20,0,0 +20,-20,0,1 +-20,20,0,2 +20,20,0,3 +120,20,0,4 +120,-20,0,5 +-20,-30,0,0 +20,-30,0,1 +-20,30,0,2 +20,30,0,3 +120,30,0,4 +120,-30,0,5 +-20,-40,0,0 +20,-40,0,1 +-20,40,0,2 +20,40,0,3 +120,40,0,4 +120,-40,0,5 +-20,-50,0,0 +20,-50,0,1 +-20,50,0,2 +20,50,0,3 +120,50,0,4 +120,-50,0,5 +-20,-60,0,0 +20,-60,0,1 +-20,60,0,2 +20,60,0,3 +120,60,0,4 +120,-60,0,5 +-20,-70,0,0 +20,-70,0,1 +-20,70,0,2 +20,70,0,3 +120,70,0,4 +120,-70,0,5 +-20,-80,0,0 +20,-80,0,1 +-20,80,0,2 +20,80,0,3 +120,80,0,4 +120,-80,0,5 +-20,-90,0,0 +20,-90,0,1 +-20,90,0,2 +20,90,0,3 +120,90,0,4 +120,-90,0,5 +-30,-10,0,0 +30,-10,0,1 +-30,10,0,2 +30,10,0,3 +130,10,0,4 +130,-10,0,5 +-30,-20,0,0 +30,-20,0,1 +-30,20,0,2 +30,20,0,3 +130,20,0,4 +130,-20,0,5 +-30,-30,0,0 +30,-30,0,1 +-30,30,0,2 +30,30,0,3 +130,30,0,4 +130,-30,0,5 +-30,-40,0,0 +30,-40,0,1 +-30,40,0,2 +30,40,0,3 +130,40,0,4 +130,-40,0,5 +-30,-50,0,0 +30,-50,0,1 +-30,50,0,2 +30,50,0,3 +130,50,0,4 +130,-50,0,5 +-30,-60,0,0 +30,-60,0,1 +-30,60,0,2 +30,60,0,3 +130,60,0,4 +130,-60,0,5 +-30,-70,0,0 +30,-70,0,1 +-30,70,0,2 +30,70,0,3 +130,70,0,4 +130,-70,0,5 +-30,-80,0,0 +30,-80,0,1 +-30,80,0,2 +30,80,0,3 +130,80,0,4 +130,-80,0,5 +-30,-90,0,0 +30,-90,0,1 +-30,90,0,2 +30,90,0,3 +130,90,0,4 +130,-90,0,5 +-40,-10,0,0 +40,-10,0,1 +-40,10,0,2 +40,10,0,3 +140,10,0,4 +140,-10,0,5 +-40,-20,0,0 +40,-20,0,1 +-40,20,0,2 +40,20,0,3 +140,20,0,4 +140,-20,0,5 +-40,-30,0,0 +40,-30,0,1 +-40,30,0,2 +40,30,0,3 +140,30,0,4 +140,-30,0,5 +-40,-40,0,0 +40,-40,0,1 +-40,40,0,2 +40,40,0,3 +140,40,0,4 +140,-40,0,5 +-40,-50,0,0 +40,-50,0,1 +-40,50,0,2 +40,50,0,3 +140,50,0,4 +140,-50,0,5 +-40,-60,0,0 +40,-60,0,1 +-40,60,0,2 +40,60,0,3 +140,60,0,4 +140,-60,0,5 +-40,-70,0,0 +40,-70,0,1 +-40,70,0,2 +40,70,0,3 +140,70,0,4 +140,-70,0,5 +-40,-80,0,0 +40,-80,0,1 +-40,80,0,2 +40,80,0,3 +140,80,0,4 +140,-80,0,5 +-40,-90,0,0 +40,-90,0,1 +-40,90,0,2 +40,90,0,3 +140,90,0,4 +140,-90,0,5 +-50,-10,0,0 +50,-10,0,1 +-50,10,0,2 +50,10,0,3 +150,10,0,4 +150,-10,0,5 +-50,-20,0,0 +50,-20,0,1 +-50,20,0,2 +50,20,0,3 +150,20,0,4 +150,-20,0,5 +-50,-30,0,0 +50,-30,0,1 +-50,30,0,2 +50,30,0,3 +150,30,0,4 +150,-30,0,5 +-50,-40,0,0 +50,-40,0,1 +-50,40,0,2 +50,40,0,3 +150,40,0,4 +150,-40,0,5 +-50,-50,0,0 +50,-50,0,1 +-50,50,0,2 +50,50,0,3 +150,50,0,4 +150,-50,0,5 +-50,-60,0,0 +50,-60,0,1 +-50,60,0,2 +50,60,0,3 +150,60,0,4 +150,-60,0,5 +-50,-70,0,0 +50,-70,0,1 +-50,70,0,2 +50,70,0,3 +150,70,0,4 +150,-70,0,5 +-50,-80,0,0 +50,-80,0,1 +-50,80,0,2 +50,80,0,3 +150,80,0,4 +150,-80,0,5 +-50,-90,0,0 +50,-90,0,1 +-50,90,0,2 +50,90,0,3 +150,90,0,4 +150,-90,0,5 +-60,-10,0,0 +60,-10,0,1 +-60,10,0,2 +60,10,0,3 +160,10,0,4 +160,-10,0,5 +-60,-20,0,0 +60,-20,0,1 +-60,20,0,2 +60,20,0,3 +160,20,0,4 +160,-20,0,5 +-60,-30,0,0 +60,-30,0,1 +-60,30,0,2 +60,30,0,3 +160,30,0,4 +160,-30,0,5 +-60,-40,0,0 +60,-40,0,1 +-60,40,0,2 +60,40,0,3 +160,40,0,4 +160,-40,0,5 +-60,-50,0,0 +60,-50,0,1 +-60,50,0,2 +60,50,0,3 +160,50,0,4 +160,-50,0,5 +-60,-60,0,0 +60,-60,0,1 +-60,60,0,2 +60,60,0,3 +160,60,0,4 +160,-60,0,5 +-60,-70,0,0 +60,-70,0,1 +-60,70,0,2 +60,70,0,3 +160,70,0,4 +160,-70,0,5 +-60,-80,0,0 +60,-80,0,1 +-60,80,0,2 +60,80,0,3 +160,80,0,4 +160,-80,0,5 +-60,-90,0,0 +60,-90,0,1 +-60,90,0,2 +60,90,0,3 +160,90,0,4 +160,-90,0,5 +-70,-10,0,0 +70,-10,0,1 +-70,10,0,2 +70,10,0,3 +170,10,0,4 +170,-10,0,5 +-70,-20,0,0 +70,-20,0,1 +-70,20,0,2 +70,20,0,3 +170,20,0,4 +170,-20,0,5 +-70,-30,0,0 +70,-30,0,1 +-70,30,0,2 +70,30,0,3 +170,30,0,4 +170,-30,0,5 +-70,-40,0,0 +70,-40,0,1 +-70,40,0,2 +70,40,0,3 +170,40,0,4 +170,-40,0,5 +-70,-50,0,0 +70,-50,0,1 +-70,50,0,2 +70,50,0,3 +170,50,0,4 +170,-50,0,5 +-70,-60,0,0 +70,-60,0,1 +-70,60,0,2 +70,60,0,3 +170,60,0,4 +170,-60,0,5 +-70,-70,0,0 +70,-70,0,1 +-70,70,0,2 +70,70,0,3 +170,70,0,4 +170,-70,0,5 +-70,-80,0,0 +70,-80,0,1 +-70,80,0,2 +70,80,0,3 +170,80,0,4 +170,-80,0,5 +-70,-90,0,0 +70,-90,0,1 +-70,90,0,2 +70,90,0,3 +170,90,0,4 +170,-90,0,5 +-80,-10,0,0 +80,-10,0,1 +-80,10,0,2 +80,10,0,3 +180,10,0,4 +180,-10,0,5 +-80,-20,0,0 +80,-20,0,1 +-80,20,0,2 +80,20,0,3 +180,20,0,4 +180,-20,0,5 +-80,-30,0,0 +80,-30,0,1 +-80,30,0,2 +80,30,0,3 +180,30,0,4 +180,-30,0,5 +-80,-40,0,0 +80,-40,0,1 +-80,40,0,2 +80,40,0,3 +180,40,0,4 +180,-40,0,5 +-80,-50,0,0 +80,-50,0,1 +-80,50,0,2 +80,50,0,3 +180,50,0,4 +180,-50,0,5 +-80,-60,0,0 +80,-60,0,1 +-80,60,0,2 +80,60,0,3 +180,60,0,4 +180,-60,0,5 +-80,-70,0,0 +80,-70,0,1 +-80,70,0,2 +80,70,0,3 +180,70,0,4 +180,-70,0,5 +-80,-80,0,0 +80,-80,0,1 +-80,80,0,2 +80,80,0,3 +180,80,0,4 +180,-80,0,5 +-80,-90,0,0 +80,-90,0,1 +-80,90,0,2 +80,90,0,3 +180,90,0,4 +180,-90,0,5 +-90,-10,0,0 +90,-10,0,1 +-90,10,0,2 +90,10,0,3 +190,10,0,4 +190,-10,0,5 +-90,-20,0,0 +90,-20,0,1 +-90,20,0,2 +90,20,0,3 +190,20,0,4 +190,-20,0,5 +-90,-30,0,0 +90,-30,0,1 +-90,30,0,2 +90,30,0,3 +190,30,0,4 +190,-30,0,5 +-90,-40,0,0 +90,-40,0,1 +-90,40,0,2 +90,40,0,3 +190,40,0,4 +190,-40,0,5 +-90,-50,0,0 +90,-50,0,1 +-90,50,0,2 +90,50,0,3 +190,50,0,4 +190,-50,0,5 +-90,-60,0,0 +90,-60,0,1 +-90,60,0,2 +90,60,0,3 +190,60,0,4 +190,-60,0,5 +-90,-70,0,0 +90,-70,0,1 +-90,70,0,2 +90,70,0,3 +190,70,0,4 +190,-70,0,5 +-90,-80,0,0 +90,-80,0,1 +-90,80,0,2 +90,80,0,3 +190,80,0,4 +190,-80,0,5 +-90,-90,0,0 +90,-90,0,1 +-90,90,0,2 +90,90,0,3 +190,90,0,4 +190,-90,0,5 \ No newline at end of file diff --git a/sample_projects/physiboss-cell-lines/config/model.cfg b/sample_projects/physiboss-cell-lines/config/model.cfg new file mode 100644 index 0000000..c71e514 --- /dev/null +++ b/sample_projects/physiboss-cell-lines/config/model.cfg @@ -0,0 +1,12 @@ +$time_scale = 0.05; +$oxygen_concentration = 0.0; + +discrete_time = 0; +use_physrandgen = FALSE; +seed_pseudorandom = 100; +sample_count = 10; + +max_time = 1; +time_tick = 0.1; + +thread_count = 1; diff --git a/sample_projects/physiboss-cell-lines/config/model_0.bnd b/sample_projects/physiboss-cell-lines/config/model_0.bnd new file mode 100644 index 0000000..556018b --- /dev/null +++ b/sample_projects/physiboss-cell-lines/config/model_0.bnd @@ -0,0 +1,17 @@ +Node A { + logic = A; + rate_up = @logic ? $time_scale : 0; + rate_down = @logic ? 0 : $time_scale; +} + +Node B { + logic = B; + rate_up = @logic ? $time_scale : 0; + rate_down = @logic ? 0 : $time_scale; +} + +Node C { + logic = A & B; + rate_up = @logic ? $time_scale : 0; + rate_down = @logic ? 0 : $time_scale; +} diff --git a/sample_projects/physiboss-cell-lines/config/model_1.bnd b/sample_projects/physiboss-cell-lines/config/model_1.bnd new file mode 100644 index 0000000..340bb2c --- /dev/null +++ b/sample_projects/physiboss-cell-lines/config/model_1.bnd @@ -0,0 +1,17 @@ +Node A { + logic = A; + rate_up = @logic ? $time_scale : 0; + rate_down = @logic ? 0 : $time_scale; +} + +Node B { + logic = B; + rate_up = @logic ? $time_scale : 0; + rate_down = @logic ? 0 : $time_scale; +} + +Node C { + logic = A | B; + rate_up = @logic ? $time_scale : 0; + rate_down = @logic ? 0 : $time_scale; +} diff --git a/sample_projects/physiboss-cell-lines/config/rules.csv b/sample_projects/physiboss-cell-lines/config/rules.csv new file mode 100644 index 0000000..e69de29 diff --git a/sample_projects/physiboss-cell-lines/custom_modules/custom.cpp b/sample_projects/physiboss-cell-lines/custom_modules/custom.cpp new file mode 100644 index 0000000..c89c8e0 --- /dev/null +++ b/sample_projects/physiboss-cell-lines/custom_modules/custom.cpp @@ -0,0 +1,197 @@ +/* +############################################################################### +# 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-2018, 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" +#include "../BioFVM/BioFVM.h" +using namespace BioFVM; + +// declare cell definitions here + +std::vector nodes; + +void create_cell_types( void ) +{ + // set the random seed + if (parameters.ints.find_index("random_seed") != -1) + { + 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 = NULL; + cell_defaults.functions.update_phenotype = NULL; + cell_defaults.functions.update_migration_bias = NULL; + cell_defaults.functions.pre_update_intracellular = pre_update_intracellular; + cell_defaults.functions.post_update_intracellular = post_update_intracellular; + cell_defaults.functions.custom_cell_rule = NULL; + + cell_defaults.functions.add_cell_basement_membrane_interactions = NULL; + cell_defaults.functions.calculate_distance_to_membrane = NULL; + + cell_defaults.custom_data.add_variable(parameters.strings("node_to_visualize"), "dimensionless", 0.0 ); //for paraview visualization + + /* + This parses the cell definitions in the XML config file. + */ + + initialize_cell_definitions_from_pugixml(); + + /* + Put any modifications to individual cell definitions here. + + This is a good place to set custom functions. + */ + + /* + 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(); + + /* + This 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 ) +{ + // load cells from your CSV file + load_cells_from_pugixml(); +} + +void pre_update_intracellular( Cell* pCell, Phenotype& phenotype, double dt ) +{ + if (PhysiCell::PhysiCell_globals.current_time >= 100.0 + && pCell->phenotype.intracellular->get_parameter_value("$time_scale") == 0.0 + ){ + pCell->phenotype.intracellular->set_parameter_value("$time_scale", 0.1); + } + +} + +void post_update_intracellular( Cell* pCell, Phenotype& phenotype, double dt ) +{ + color_node(pCell); +} + +std::vector my_coloring_function( Cell* pCell ) +{ + std::vector< std::string > output( 4 , "rgb(0,0,0)" ); + + if ( !pCell->phenotype.intracellular->get_boolean_variable_value( parameters.strings("node_to_visualize") ) ) + { + output[0] = "rgb(255,0,0)"; + output[2] = "rgb(125,0,0)"; + + } + else{ + output[0] = "rgb(0, 255,0)"; + output[2] = "rgb(0, 125,0)"; + } + + return output; +} + +void color_node(Cell* pCell){ + std::string node_name = parameters.strings("node_to_visualize"); + pCell->custom_data[node_name] = pCell->phenotype.intracellular->get_boolean_variable_value(node_name); +} \ No newline at end of file diff --git a/sample_projects/physiboss-cell-lines/custom_modules/custom.h b/sample_projects/physiboss-cell-lines/custom_modules/custom.h new file mode 100644 index 0000000..44cd833 --- /dev/null +++ b/sample_projects/physiboss-cell-lines/custom_modules/custom.h @@ -0,0 +1,91 @@ +/* +############################################################################### +# 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-2018, 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. # +# # +############################################################################### +*/ +#ifndef __Custom_h__ +#define __Custom_h__ + +#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 cell phenotype functions could go here +void pre_update_intracellular( Cell* pCell, Phenotype& phenotype, double dt ); +void post_update_intracellular( Cell* pCell, Phenotype& phenotype, double dt ); +void color_node(Cell* pCell); + +#endif \ No newline at end of file diff --git a/sample_projects/physiboss-cell-lines/custom_modules/empty.txt b/sample_projects/physiboss-cell-lines/custom_modules/empty.txt new file mode 100644 index 0000000..e69de29 diff --git a/sample_projects/physiboss-cell-lines/main.cpp b/sample_projects/physiboss-cell-lines/main.cpp new file mode 100644 index 0000000..0f57542 --- /dev/null +++ b/sample_projects/physiboss-cell-lines/main.cpp @@ -0,0 +1,262 @@ +/* +############################################################################### +# 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-2018, 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" +#include "./addons/PhysiBoSS/src/maboss_intracellular.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 = 10; + 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 + + //mkdir("../output"); + + char filename[1024]; + sprintf( filename , "%s/initial" , PhysiCell_settings.folder.c_str() ); + + save_PhysiCell_to_MultiCellDS_v2( 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 ); + + add_software_citation( "PhysiBoSS" , PhysiBoSS_Version , PhysiBoSS_DOI, PhysiBoSS_URL); + + 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"< PhysiCell_globals.next_full_save_time - 0.5 * 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_v2( 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( PhysiCell_globals.current_time > PhysiCell_globals.next_SVG_save_time - 0.5 * 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; + } + } + + /* + Custom add-ons could potentially go here. + */ + + + // update the microenvironment + microenvironment.simulate_diffusion_decay( diffusion_dt ); + + // run PhysiCell + ((Cell_Container *)microenvironment.agent_container)->update_all_cells( PhysiCell_globals.current_time ); + + //std::cout<< "done" << std::endl; + + 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_v2( 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; +} \ No newline at end of file diff --git a/sample_projects/physiboss-cell-lines/model.yml b/sample_projects/physiboss-cell-lines/model.yml new file mode 100644 index 0000000..8e88cdf --- /dev/null +++ b/sample_projects/physiboss-cell-lines/model.yml @@ -0,0 +1,5 @@ +short_name: phyiboss-cell-lines +version: 1.0.0 +binary: PhysiBoSS_Cell_Lines +config: + - config/PhysiCell_settings.xml diff --git a/sample_projects/physiboss-cell-lines/scripts/empty.txt b/sample_projects/physiboss-cell-lines/scripts/empty.txt new file mode 100644 index 0000000..e69de29