Browse code

3.99.8: unity build

ramon diaz-uriarte (at Phelsuma) authored on 15/09/2022 19:29:51
Showing27 changed files

... ...
@@ -1,8 +1,8 @@
1 1
 Package: OncoSimulR
2 2
 Type: Package
3 3
 Title: Forward Genetic Simulation of Cancer Progression with Epistasis 
4
-Version: 3.99.7
5
-Date: 2022-09-13
4
+Version: 3.99.8
5
+Date: 2022-09-15
6 6
 Authors@R: c(
7 7
 	      person("Ramon", "Diaz-Uriarte", role = c("aut", "cre"),	
8 8
  	   		     email = "rdiaz02@gmail.com"),
... ...
@@ -1,3 +1,8 @@
1
+Changes in version 3.99.8 (2022-09-15):
2
+	- Using "Unity builds" to decrease build (compilation) time;
3
+	  see file inst/miscell/README_Unity_compilation.
4
+
5
+
1 6
 Changes in version 3.99.7 (2022-09-13):
2 7
 	- Use c++14 and, in windows, do not use -O3: try to minimize
3 8
 	  build time.
... ...
@@ -3,31 +3,16 @@ CC=gcc$(VER)
3 3
 CXX=g++$(VER)
4 4
 CXX11=g++$(VER)
5 5
 
6
+
6 7
 ## This is a C++11 package
7
-## But using C++14 leads to faster INSTALL. In my machine:
8
+## but using C++14 leads to faster INSTALL. In my machine:
8 9
 ## C++11: 6'30"
9 10
 ## C++14: 4'20"
10 11
 ## C++17: 5'08"
11 12
 CXX_STD = CXX14
12 13
 
13
-# This ain't needed
14
-# ONCOSIMUL_SRC = BNB_nr.cpp\
15
-# 	BNB_v1.cpp\
16
-# 	bnb_common.cpp\
17
-# 	new_restrict.cpp\
18
-# 	accessible_genotypes.cpp\
19
-# 	RcppExports.cpp\
20
-# 	OncoSimulR_init.c\
21
-# ONCOSIMUL_OBJECTS_TMP=$(ONCOSIMUL_SRC:.cpp=.o)
22
-# ONCOSIMUL_OBJECTS=$(ONCOSIMUL_OBJECTS_TMP:.c=.o)
23
-
24
-# .PHONY: all liblandscape.a
25
-# all: $(SHLIB)
26
-# all: liblandscape.a $(SHLIB)
27 14
 
28 15
 all: liblandscape.a fl_statistics fl_generate $(SHLIB)
29
-## all: liblandscape.a fl_statistics fl_generate fl_genchains $(SHLIB)
30
-
31 16
 
32 17
 
33 18
 MAGELLAN_SRC = FitnessLandscape/gamma.c\
... ...
@@ -47,7 +32,7 @@ MAGELLAN_SRC = FitnessLandscape/gamma.c\
47 32
         FitnessLandscape/decomposition.c\
48 33
         FitnessLandscape/models.c\
49 34
 	FitnessLandscape/verbose.c
50
-#        FitnessLandscape/common_drawings.c\ ## I do not use it and gives a warning
35
+
51 36
 MAGELLAN_OBJECTS = $(MAGELLAN_SRC:.c=.o)
52 37
 
53 38
 liblandscape.a: $(MAGELLAN_OBJECTS)
... ...
@@ -59,7 +44,6 @@ liblandscape.a: $(MAGELLAN_OBJECTS)
59 44
 MAGELLAN_LIBS = liblandscape.a
60 45
 MAGELLAN_LIBS_DIR = -L.
61 46
 MAGELLAN_LFLAGS = -llandscape
62
-## MAGELLAN_INCLUDE_DIR = -I. -I/FitnessLandscape/.
63 47
 MAGELLAN_INCLUDE_DIR = -I/FitnessLandscape/.
64 48
 MAGELLAN_ALLCFLAGS= -O -Wall
65 49
 
... ...
@@ -69,31 +53,5 @@ fl_statistics: FitnessLandscape/main_fl_statistics.c $(MAGELLAN_LIBS)
69 53
 fl_generate: FitnessLandscape/main_fl_generate.c  $(MAGELLAN_LIBS)
70 54
 	$(CC) $(MAGELLAN_ALLCFLAGS) -o $@ $(MAGELLAN_INCLUDE_DIR) $(MAGELLAN_LIBS_DIR) $< $(MAGELLAN_LFLAGS) -lm;
71 55
 
72
-# # Do we really need this?
73
-# fl_genchains: FitnessLandscape/main_generalizedchains_test.c $(MAGELLAN_LIBS)
74
-# 	$(CC) $(MAGELLAN_ALLCFLAGS) -o $@ $(MAGELLAN_INCLUDE_DIR) $(MAGELLAN_LIBS_DIR) $< $(MAGELLAN_LFLAGS) -lm #-g
75
-
76
-
77
-
78
-
79
-
80
-# fl_stats:
81
-# 	echo "make fl_statistics in FitnessLandscape/ ..."
82
-# 	(cd MAGELLAN; $(MAKE) fl_statistics)
83
-
84
-# fl_gen:
85
-# 	echo "make fl_generate in FitnessLandscape/ ..."
86
-# 	(cd MAGELLAN; $(MAKE) fl_generate)
87
-
88
-# liblandscape:
89
-# 	echo "make liblandscape in FitnessLandscape/ ..."
90
-# 	(cd MAGELLAN; $(MAKE) liblandscape.a)
91
-
92
-# magellanall:
93
-# 	echo "make all MAGELLAN in FitnessLandscape/ ..."
94
-# 	(cd MAGELLAN; $(MAKE) magellanall)
95
-# clean:
96
-# 	echo "mak clean in FitnessLandscape/ ..."
97
-# 	(cd MAGELLAN; $(MAKE) clean)
98 56
 
99 57
 
... ...
@@ -1,41 +1,17 @@
1
+## MAKEFLAGS += -j2
1 2
 VER=
2 3
 CC=gcc$(VER)
3 4
 CXX=g++$(VER)
4 5
 CXX11=g++$(VER)
5 6
 
6 7
 CXX_STD = CXX14
7
-## PKG_CXXFLAGS += -I../inst/miscell
8 8
 
9
-## We have issues under Windoze because of ExprTk, MINGW, etc.
10
-
11
-## Trick below from affxparser
12
-## as suggested by K. D. Hansen
13
-## on bioc-devel list on 2019-05-24
14
-
15
-## zz1
16 9
 MYCXXFLAGS = -Wa,-mbig-obj
17
-## MYCXXFLAGS = -Wa,-mbig-obj -O3
18
-## MYCXXFLAGS = -O0
19 10
 
20
-## zz1
21 11
 %.o: %.cpp
22 12
 	$(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) $(MYCXXFLAGS) -c $< -o $@
23 13
 
24
-# %.o: %.cpp
25
-# 	$(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c $< -o $@
26
-
27
-
28
-## Just in case, pass to the linker too. No effect?. See below.
29
-## z1
30
-## PKG_LIBS = -Wa,-mbig-obj -O3
31
-## PKG_LIBS = -O3
32
-
33
-#####################  MAGELLAN   ####################
34
-
35 14
 all: liblandscape.a fl_statistics fl_generate $(SHLIB)
36
-## all: liblandscape.a fl_statistics fl_generate fl_genchains $(SHLIB)
37
-
38
-
39 15
 
40 16
 MAGELLAN_SRC = FitnessLandscape/gamma.c\
41 17
         FitnessLandscape/landscape.c \
... ...
@@ -54,19 +30,15 @@ MAGELLAN_SRC = FitnessLandscape/gamma.c\
54 30
         FitnessLandscape/decomposition.c\
55 31
         FitnessLandscape/models.c\
56 32
 	FitnessLandscape/verbose.c
57
-#        FitnessLandscape/common_drawings.c\ ## I do not use it and gives a warning
58 33
 MAGELLAN_OBJECTS = $(MAGELLAN_SRC:.c=.o)
59 34
 
60 35
 liblandscape.a: $(MAGELLAN_OBJECTS)
61 36
 	$(AR) -r $@ $+ ;
62 37
 	$(RANLIB) $@;
63 38
 
64
-
65
-
66 39
 MAGELLAN_LIBS = liblandscape.a
67 40
 MAGELLAN_LIBS_DIR = -L.
68 41
 MAGELLAN_LFLAGS = -llandscape
69
-## MAGELLAN_INCLUDE_DIR = -I. -I/FitnessLandscape/.
70 42
 MAGELLAN_INCLUDE_DIR = -I/FitnessLandscape/.
71 43
 MAGELLAN_ALLCFLAGS= -O -Wall
72 44
 
... ...
@@ -76,21 +48,15 @@ fl_statistics: FitnessLandscape/main_fl_statistics.c $(MAGELLAN_LIBS)
76 48
 fl_generate: FitnessLandscape/main_fl_generate.c  $(MAGELLAN_LIBS)
77 49
 	$(CC) $(MAGELLAN_ALLCFLAGS) -o $@ $(MAGELLAN_INCLUDE_DIR) $(MAGELLAN_LIBS_DIR) $< $(MAGELLAN_LFLAGS) -lm;
78 50
 
79
-# # Do we really need this?
80
-# fl_genchains: FitnessLandscape/main_generalizedchains_test.c $(MAGELLAN_LIBS)
81
-# 	$(CC) $(MAGELLAN_ALLCFLAGS) -o $@ $(MAGELLAN_INCLUDE_DIR) $(MAGELLAN_LIBS_DIR) $< $(MAGELLAN_LFLAGS) -lm #-g
82
-
83
-
84
-#################### /MAGELLAN ##########################
85
-
86
-
87 51
 
88 52
 
89 53
 #########################################################
90 54
 #########################################################
91 55
 #########################################################
92 56
 
93
-## Open the msys2 shell and do (change path to R)
57
+## Doing this in Windows
58
+
59
+## Open the msys2 shell and do (change path to R, as needed)
94 60
 ## export PATH=/x86_64-w64-mingw32.static.posix/bin:$PATH
95 61
 
96 62
 ## Install
... ...
@@ -103,194 +69,6 @@ fl_generate: FitnessLandscape/main_fl_generate.c  $(MAGELLAN_LIBS)
103 69
 ## Check
104 70
 ## time /c/R/R-4.2.1/bin/R.exe CMD check --no-multiarch --no-vignettes --timings OncoSimulR_3.4.0.tar.gz
105 71
 
106
-
107
-## Build bin
108
-## time /c/R/R-4.2.1/bin/R.exe CMD INSTALL --build OncoSimulR_3.4.0.tar.gz
109
-
110
-
111
-
112
-####### OncoSimulR and ExprTk, Rtools35 (current as of 2019-05-24)
113
-##      gcc-4.9.3
114
-
115
-##### 64 bits: Rtools/mingw_64
116
-
117
-## Compiler: -03. Linker:  nothing.                 too many sections error
118
-## Compiler: -Wa,-mbig-obj -O3; Linker: nothing:    linker stays there forever 
119
-## Compiler: -Wa,-mbig-obj -O3; Linker: -O3:        linker stays there forever
120
-
121
-
122
-##### 32 bits Rtools/mingw_32
123
-
124
-## Here it always breaks compiling new_restrict.cpp
125
-## Compiler: -03. Linker:  nothing.                          too many sections error            
126
-## Compiler: -Wa,-mbig-obj -O3; Linker: nothing:             too many sections error            
127
-## Compiler: -Wa,-mbig-obj -O3; Linker: -O3:                 too many sections error            
128
-## Compiler: -Wa,-mbig-obj -O3; Linker:  -Wa,-mbig-obj -O3   too many sections error            
129
-
130
-
131
-
132
-####### OncoSimulR and ExprTk, Rtools40 (current as of 2019-05-24)
133
-##      gcc-8.3.0
134
-
135
-
136
-##### 64 bits: Rtools/mingw_64
137
-
138
-## From a MINGW64 shell do:  /c/R/R-testing/bin/x64/R CMD INSTALL --no-multiarch OncoSimulR
139
-
140
-## Compiler: -03. Linker:  nothing.                           linker stays there forever
141
-## Compiler: -Wa,-mbig-obj -O3; Linker: nothing:              OK
142
-## Compiler: -Wa,-mbig-obj -O3; Linker: -O3:                  ??
143
-## Compiler: -Wa,-mbig-obj -O3; Linker: -Wa,-mbig-obj -O3:    ??
144
-
145
-
146
-
147
-##### 32 bits Rtools/mingw_32
148
-
149
-## From a MINGW32 shell do:  /c/R/R-testing/bin/i386/R CMD INSTALL --no-multiarch OncoSimulR
150
-
151
-## Compiler: -03. Linker:  nothing.                          OK
152
-## Compiler: -Wa,-mbig-obj -O3; Linker: nothing:             OK
153
-## Compiler: -Wa,-mbig-obj -O3; Linker: -O3:                 ??
154
-## Compiler: -Wa,-mbig-obj -O3; Linker:  -Wa,-mbig-obj -O3   OK
155
-
156
-
157
-
158
-
159
-
160
-####### Compiling ExprTk directly.
161
-
162
-## Download ExprTk and do
163
-## make exprtk_test
164
-## (this is in the bug report https://sourceforge.net/p/mingw-w64/discussion/723797/thread/c6b70624/)
165
-
166
-
167
-## I try, with c:/Rtools/mingw_64/bin/g++
168
-## compiling ExprTk directly.
169
-## The makefile has -O1.
170
-## Without the -Wa,-mibg-obj I get the too many sections error
171
-## With it, it seems to stay there forever.
172
-
173
-
174
-## Using MSYS2 and gcc version 8.3.0 as provided by Rtools 40 (2019-05-24):
175
-
176
-## MINGW32 shell: -O1                          OK
177
-## MINGW32 shell: -O3, -Wa,-mbig-obj           OK
178
-## MINGW32 shell: -O1, -Wa,-mbig-obj           ??
179
-
180
-## MINGW64 shell: -O1                          nope: eternal
181
-## MINGW64 shell: -O3, -Wa,-mbig-obj           OK
182
-## MINGW64 shell: -O1, -Wa,-mbig-obj           OK 
183
-
184
-
185
-
186
-###### Route not taken (not needed): Check Natron: https://github.com/MrKepzie/Natron
187
-## as they use ExprTk (see refs above).
188
-## https://github.com/MrKepzie/Natron/blob/master/global.pri
189
-## suggests that Natron not using -Wa,-mbig.obj, as linker never returns
190
-## But
191
-##  https://github.com/MrKepzie/Natron/blob/master/Engine/ExprTk.cpp
192
-##  in the text, suggests otherwise.
193
-## The global.pri file suggests they are usin win32, which as per my table above
194
-## indicates that with gcc-8 and MSYS2 both would work.
195
-
196
-
197
-
198
-
199
-
200
-
201
-
202
-
203
-
204
-
205
-
206
-#### Older stuff
207
-
208
-
209
-
210
-
211
-
212
-
213
-## To the left of -O2, so useless
214
-## PKG_CXXFLAGS = -Wa,-mbig-obj -O3
215
-
216
-## To the left of -O2, so useless
217
-## PKG_CXXFLAGS += -Wa,-mbig-obj -O3  
218
-
219
-
220
-## Also to the left of -O2
221
-## PKG_CPPFLAGS = -Wa,-mbig-obj -O3
222
-
223
-## Also to the left of -O2
224
-## PKG_CPPFLAGS += -Wa,-mbig-obj -O3
225
-
226
-## Ignored
227
-## PKG_CXX11FLAGS = -Wa,-mbig-obj -O3  
228
-## Ignored
229
-## PKG_CXX11FLAGS += -Wa,-mbig-obj -O3  
230
-
231
-
232
-## Ignored for the individual c++ files, of course
233
-# PKG_CFLAGS = -Wa,-mbig-obj -O3
234
-# PKG_CFLAGS += -Wa,-mbig-obj -O3
235
-
236
-
237
-
238
-## -mbig-obj fails, because gcc does not recognize it. gcc version too old?
239
-## https://github.com/assimp/assimp/issues/2315
240
-## You have to give them together -Wa,-mbig-obj
241
-
242
-
243
-## All of these are, of course, ignored
244
-## CXX11FLAGS = Wa, -mbig-obj -O3 ## Ignored
245
-## CXX11FLAGS += Wa, -mbig-obj -O3 ## Ignored
246
-## CXX11PICFLAGS= -O3 ## Ignored
247
-## CXXFLAGS = -O3 ## Ignored
248
-## CFLAGS =  -Wa,-mbig-obj -O3 ## ignored
249
-
250
-
251
-
252
-
253
-## With 32 bits, it fails with the too many sections
254
-
255
-
256
-## Tried installing only the 64-bit version
257
-## https://stackoverflow.com/a/11298086
258
-## R CMD INSTALL --no-multiarch
259
-## The linker stays there forever, as originally reported
260
-## https://sourceforge.net/p/mingw-w64/discussion/723797/thread/c6b70624/
261
-## Comments in file 
262
-## https://github.com/MrKepzie/Natron/blob/master/global.pri
263
-## suggest that Natron not using -Wa,-mbig.obj, as linker never returns
264
-
265
-## Maybe Rtools 40, with MSYS2 will solve it?
266
-## https://stackoverflow.com/a/31907912
267
-
268
-
269
-## This is a C++11 package
270
-# PKG_CXXFLAGS = -O3
271
-# CXX11FLAGS += -Wa,-mbig-obj -O3 
272
-## PKG_CXXFLAGS = -I../inst/miscell -O3 
273
-## Do we need the -O3 to prevent mingw failure of too many sections?
274
-##  https://github.com/MrKepzie/Natron/blob/master/Engine/ExprTk.cpp
275
-##  https://discourse.mc-stan.org/t/too-many-sections/6261
276
-## But -O3 not placed after the default -O2:
277
-## https://stackoverflow.com/questions/23414448/r-makevars-file-to-overwrite-r-cmds-default-g-options
278
-## tested: -Wa,-mbig-obj does not solve it
279
-
280
-
281
-
282
-##################### Building the binary package
283
-##                    here, so I can just copy and paste in a MINGW64 shell
284
-## https://www.biostat.wisc.edu/~kbroman/Rintro/Rwinpack.html ande BioConductor
285
-## http://bioconductor.org/checkResults/devel/bioc-LATEST/OncoSimulR/tokay1-buildsrc.html
286
-## http://bioconductor.org/checkResults/devel/bioc-LATEST/OncoSimulR/tokay1-buildbin.html
287
-
288
-##    - obtain the tar.gz for Linux or build with Rtools40
289
-##    - /c/R/R-testing/bin/x64/R CMD INSTALL --build --compile-both  OncoSimulRxyz.tar.gz
290
-##    - might want to pass other options
291
-##          /c/R/R-testing/bin/x64/R CMD INSTALL --build --no-build-vignettes --no-manual --no-resave-data --keep-empty-dirs OncoSimulRxyz.tar.gz
292
-
293
-
294 72
 ## Recall I need pandoc and git
295 73
 ## Install pandoc at C:/pandoc
296 74
 ## Git is at C:\Program Files
... ...
@@ -299,17 +77,11 @@ fl_generate: FitnessLandscape/main_fl_generate.c  $(MAGELLAN_LIBS)
299 77
 ## ##now, pdflatex
300 78
 ## export PATH=$PATH:/c/Users/ramon/AppData/Roaming/TinyTeX/bin/win32
301 79
 
302
-#####    Full, BioC-like
303
-##  /c/R/R-testing/bin/x64/R CMD build --keep-empty-dirs --no-resave-data  OncoSimulR
304
-##  /c/R/R-testing/bin/x64/R CMD check --force-multiarch --no-vignettes --timings OncoSimulR_2.zzz.tar.gz
305
-##  /c/R/R-testing/bin/x64/R CMD INSTALL --merge-multiarch --build OncoSimulR_xyz0.tar.gz
80
+## Build bin
81
+## time /c/R/R-4.2.1/bin/R.exe CMD INSTALL --build OncoSimulR_3.4.0.tar.gz
82
+
306 83
 
307
-## this next will not work with Rtools40, of course
308
-##  /c/R/R-testing/bin/x64/R CMD INSTALL OncoSimulR_xyz0.zip
309 84
 
310 85
 
311
-#####    Faster, shorter
312
-##  /c/R/R-testing/bin/x64/R CMD build --keep-empty-dirs --no-resave-data --no-build-vignettes OncoSimulR
313
-##  /c/R/R-testing/bin/x64/R CMD INSTALL --merge-multiarch --build --no-build-vignettes --no-manual OncoSimulR_xyz0.tar.gz
314 86
 
315 87
 
316 88
similarity index 100%
317 89
rename from src/BNB_nr.cpp
318 90
rename to src/UnityOncoSimul/BNB_nr.cpp
319 91
similarity index 100%
320 92
rename from src/accessible_genotypes.cpp
321 93
rename to src/UnityOncoSimul/accessible_genotypes.cpp
322 94
similarity index 100%
323 95
rename from src/bnb_common.cpp
324 96
rename to src/UnityOncoSimul/bnb_common.cpp
325 97
similarity index 100%
326 98
rename from src/bnb_common.h
327 99
rename to src/UnityOncoSimul/bnb_common.h
328 100
similarity index 100%
329 101
rename from src/common_classes.h
330 102
rename to src/UnityOncoSimul/common_classes.h
331 103
similarity index 100%
332 104
rename from src/debug_common.h
333 105
rename to src/UnityOncoSimul/debug_common.h
334 106
similarity index 100%
335 107
rename from src/exprtk.h
336 108
rename to src/UnityOncoSimul/exprtk.h
337 109
new file mode 100644
338 110
Binary files /dev/null and b/src/UnityOncoSimul/exprtk.h.gch differ
339 111
new file mode 100644
... ...
@@ -0,0 +1,139 @@
1
+//     Copyright 2013-2021 Ramon Diaz-Uriarte
2
+
3
+//     This program is free software: you can redistribute it and/or modify
4
+//     it under the terms of the GNU General Public License as published by
5
+//     the Free Software Foundation, either version 3 of the License, or
6
+//     (at your option) any later version.
7
+
8
+//     This program is distributed in the hope that it will be useful,
9
+//     but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
+//     GNU General Public License for more details.
12
+
13
+//     You should have received a copy of the GNU General Public License
14
+//     along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
+
16
+#include "intervention.h"
17
+
18
+
19
+
20
+InterventionsInfo addIntervention(InterventionsInfo iif, Intervention i){
21
+    //TODO: controlar que no exista ya una intervención con las mismas caracteristicas
22
+
23
+    for(size_t k=0; k<iif.interventions.size(); k++){
24
+        if(compareInterventions(iif.interventions[k], i) == 0){
25
+            Rcpp::Rcout << "There are two interventions that are the same:";
26
+            printIntervention(iif.interventions[k]);
27
+            printIntervention(i);
28
+            return iif;
29
+        }
30
+    }
31
+
32
+    iif.interventions.push_back(i);
33
+    
34
+    return iif;
35
+}
36
+
37
+// function that creates an intervention in memory
38
+Intervention createIntervention(std::string id, 
39
+                                std::string trigger, 
40
+                                std::string what_happens, 
41
+                                float periodicity, 
42
+                                int repetitions){
43
+    Intervention i;
44
+    i.id = id;
45
+    i.trigger = trigger;
46
+    i.what_happens = what_happens;
47
+    i.periodicity = periodicity;
48
+    i.repetitions = repetitions;
49
+    i.lastTimeExecuted = 0.0;
50
+    return i;
51
+}
52
+
53
+InterventionsInfo createInterventionsInfo(Rcpp::List interventions, 
54
+                                          const fitnessEffectsAll& fitnessEffects, 
55
+                                          const std::vector<spParamsP>& popParams, 
56
+                                          std::vector<Genotype> Genotypes){
57
+   
58
+    // we declare the variables needed
59
+    InterventionsInfo iif;
60
+    Intervention iv;
61
+    int totalEntries;
62
+    //we use auxiliar variables to store the values from R
63
+    std::vector<Rcpp::List> vectorOfList;
64
+    std::vector<std::string> auxIDIntervention;
65
+    std::vector<std::string> auxTriggerIntervention;
66
+    std::vector<std::string> auxWhatHappensIntervention;
67
+    std::vector<int> auxRepetitionsIntervention;
68
+    std::vector<float> auxPeriodicityIntervention;
69
+
70
+    for(int i=0; i<interventions.length(); i++){
71
+        vectorOfList.push_back(Rcpp::as<Rcpp::List>(interventions[i]));
72
+    }
73
+
74
+    for(int i=0; i<interventions.length(); i++){
75
+        Rcpp::List listItem = vectorOfList[i];
76
+
77
+        auxIDIntervention.push_back(Rcpp::as<std::string>(listItem["ID"]));
78
+        auxTriggerIntervention.push_back(Rcpp::as<std::string>(listItem["Trigger"]));
79
+        auxWhatHappensIntervention.push_back(Rcpp::as<std::string>(listItem["WhatHappens"]));
80
+        auxRepetitionsIntervention.push_back(Rcpp::as<int>(listItem["Repetitions"]));
81
+        auxPeriodicityIntervention.push_back(Rcpp::as<float>(listItem["Periodicity"]));
82
+    }
83
+
84
+    totalEntries = interventions.length();
85
+
86
+    //now we dump the info in the structs created
87
+    for(int i=0; i<totalEntries; i++){
88
+        iv = createIntervention(auxIDIntervention.at(i), auxTriggerIntervention.at(i), auxWhatHappensIntervention.at(i), auxPeriodicityIntervention.at(i), auxRepetitionsIntervention.at(i));
89
+        iif = addIntervention(iif, iv);
90
+    }
91
+
92
+    // mapping for the genes and their population
93
+    iif.mapGenoToPop = evalFVars(fitnessEffects, Genotypes, popParams, true);
94
+
95
+    return iif;
96
+}
97
+
98
+int compareInterventions(Intervention i1, Intervention i2){
99
+
100
+    // it is not allowed to have 2 interventions with the same ID.
101
+    if(i1.id == i2.id){
102
+        return 1;
103
+    } 
104
+
105
+    if (i1.trigger != i2.trigger) {
106
+        return -1;
107
+    }
108
+    
109
+    if (i1.what_happens != i2.what_happens){
110
+        return -1;
111
+    }
112
+    
113
+    if(i1.repetitions != i2.repetitions){
114
+        return -1;
115
+    } 
116
+    
117
+    if(i1.periodicity != i2.periodicity){
118
+        return -1;
119
+    }
120
+    
121
+    if(i1.lastTimeExecuted != i2.lastTimeExecuted){
122
+        return -1;
123
+    }
124
+    // if they are equal in all aspects, then returns 0
125
+    return 0;
126
+}
127
+
128
+
129
+InterventionsInfo destroyIntervention(InterventionsInfo iif, Intervention i){
130
+    
131
+    for (size_t z = 0; z < iif.interventions.size(); z++){
132
+        if(compareInterventions(iif.interventions.at(z), i) == 0){
133
+            iif.interventions.erase(iif.interventions.begin() + z);
134
+            return iif;
135
+        }
136
+    }
137
+
138
+    return iif;
139
+}
0 140
similarity index 81%
1 141
rename from src/intervention.h
2 142
rename to src/UnityOncoSimul/intervention.h
... ...
@@ -99,4 +99,25 @@ int compareInterventions(Intervention i1, Intervention i2);
99 99
 void printInterventionsInfo(InterventionsInfo iif);
100 100
 void printIntervention(Intervention i);
101 101
 
102
+
103
+
104
+//  These were the private functions
105
+bool isValidEquation(std::string equation);
106
+void parseWhatHappens(InterventionsInfo& iif, 
107
+                     UserVarsInfo& uvif,
108
+                     Intervention intervention,
109
+                     double &totPopSize, double currentTime);
110
+bool updatePopulations(InterventionsInfo& iif, 
111
+                       const fitnessEffectsAll& fitnessEffects, 
112
+                       const std::vector<Genotype>& Genotypes, 
113
+                       std::vector<spParamsP>& popParams);
114
+// functions for debugging
115
+//void printIntervention(Intervention i);
116
+//void printInterventionsInfo(InterventionsInfo iif);
117
+// function that applies hypergeometric progressions to the reduction of the population 
118
+void reduceTotalPopulation(InterventionsInfo& iif, 
119
+                           double target, 
120
+                           double totPopSize);
121
+
122
+
102 123
 #endif
103 124
new file mode 100644
... ...
@@ -0,0 +1,164 @@
1
+#include "intervention.h"
2
+
3
+
4
+
5
+
6
+bool executeInterventions(InterventionsInfo& iif,
7
+                         UserVarsInfo& uvif, 
8
+                         double &totPopSize, 
9
+                         double &currentTime, 
10
+                         const fitnessEffectsAll& fitnessEffects, 
11
+                         std::vector<Genotype> Genotypes, 
12
+                         std::vector<spParamsP>& popParams){
13
+
14
+    // Now we add all the info needed for the symbol table so exprtk can operate 
15
+    symbol_table_t symbol_table;
16
+
17
+    for(auto& iterator : uvif.userVars) {
18
+        symbol_table.add_variable(iterator.first, iterator.second);
19
+    }
20
+
21
+    for(auto& iterator : iif.mapGenoToPop) {
22
+        symbol_table.add_variable(iterator.first, iterator.second);
23
+    } 
24
+
25
+    double N = totPopSize;
26
+
27
+    if(N == 0){
28
+        throw std::invalid_argument("Total Population = 0. There is nothing to intervene.\n");
29
+    }
30
+
31
+    double T = currentTime;
32
+
33
+    symbol_table.add_constant("N", N);//We reserve N to total population size
34
+    symbol_table.add_constant("T", T); //Pass current time to exprtk
35
+    symbol_table.add_constants();
36
+
37
+    expression_t expression;
38
+    expression.register_symbol_table(symbol_table);
39
+
40
+    bool interventionDone = false;
41
+
42
+    //we iterate over the user-specified interventions 
43
+    for(auto& intervention: iif.interventions){
44
+        parser_t parser_trigger;
45
+        //if parser fails to compile, throws exception
46
+        if (!parser_trigger.compile(intervention.trigger, expression)){
47
+            // error control, just in case the parsing it's not correct
48
+            Rcpp::Rcout << "\nexprtk parser error: \n" << std::endl;
49
+
50
+            for (std::size_t i = 0; i < parser_trigger.error_count(); ++i){
51
+                typedef exprtk::parser_error::type error_t;
52
+                error_t error = parser_trigger.get_error(i);
53
+                // FIXMEmaybe: Use warning or error to capture it easily in tests?
54
+                REprintf("Error[%02zu] Position: %02zu Type: [%14s] Msg: %s Expression: %s\n",
55
+                    i,
56
+                    error.token.position,
57
+                    exprtk::parser_error::to_str(error.mode).c_str(),
58
+                    error.diagnostic.c_str(),
59
+                    intervention.trigger.c_str());
60
+            }
61
+            std::string errorMessage = "The expression was imposible to parse.";
62
+            throw std::invalid_argument(errorMessage);
63
+        } else {
64
+            //a trigger is just a TRUE/FALSE condition
65
+            if(expression.value() == 1){
66
+                parser_t parser_wh;
67
+                if(intervention.repetitions >= 0 && intervention.periodicity == NOT_PERIODICITY){ // case where interventions are based only in repetitions
68
+                    //if parser fails to compile, throws exception
69
+                    if (!parser_wh.compile(intervention.what_happens, expression)){
70
+                        // error control, just in case the parsing it's not correct
71
+                        Rcpp::Rcout << "\nexprtk parser error: \n" << std::endl;
72
+
73
+                        for (std::size_t i = 0; i < parser_wh.error_count(); ++i){
74
+                            typedef exprtk::parser_error::type error_t;
75
+                            error_t error = parser_wh.get_error(i);
76
+                            // FIXMEmaybe: Use warning or error to capture it easily in tests?
77
+                            REprintf("Error[%02zu] Position: %02zu Type: [%14s] Msg: %s Expression: %s\n",
78
+                                i,
79
+                                error.token.position,
80
+                                exprtk::parser_error::to_str(error.mode).c_str(),
81
+                                error.diagnostic.c_str(),
82
+                                intervention.what_happens.c_str());
83
+                        }
84
+                        std::string errorMessage = "The expression was imposible to parse.";
85
+                        throw std::invalid_argument(errorMessage);
86
+                    } else 
87
+                        parseWhatHappens(iif, uvif, intervention, N, T);
88
+                    // we reduce by one the number of interventions
89
+                    intervention.repetitions--;
90
+                    // we update the last time it was executed (debugging purposes)
91
+                    intervention.lastTimeExecuted = T;
92
+                    // we update interventionDone flag
93
+                    interventionDone = true;
94
+
95
+                } else if(intervention.repetitions >= 0 && intervention.periodicity > 0) { // case there is periodicity but also repetitions
96
+                    if((T - intervention.lastTimeExecuted) >= intervention.periodicity){ // with condition satisfied we execute the intervention
97
+
98
+                        if (!parser_wh.compile(intervention.what_happens, expression)){
99
+                            Rcpp::Rcout << "\nexprtk parser error: \n" << std::endl;
100
+
101
+                            for (std::size_t i = 0; i < parser_wh.error_count(); ++i){
102
+                                typedef exprtk::parser_error::type error_t;
103
+                                error_t error = parser_wh.get_error(i);
104
+                                // FIXMEmaybe: Use warning or error to capture it easily in tests?
105
+                                REprintf("Error[%02zu] Position: %02zu Type: [%14s] Msg: %s Expression: %s\n",
106
+                                    i,
107
+                                    error.token.position,
108
+                                    exprtk::parser_error::to_str(error.mode).c_str(),
109
+                                    error.diagnostic.c_str(),
110
+                                    intervention.what_happens.c_str());
111
+                            }
112
+                            std::string errorMessage = "The expression was imposible to parse.";
113
+                            throw std::invalid_argument(errorMessage);
114
+                        } else 
115
+                            parseWhatHappens(iif, uvif, intervention, N, T);
116
+                        // update new lastTimeExecuted
117
+                        intervention.lastTimeExecuted = T;
118
+                        //  update amount of repetitions
119
+                        intervention.repetitions--;
120
+                        // we update interventionDone flag
121
+                        interventionDone = true;
122
+                    } 
123
+                } else if (intervention.periodicity > 0 && intervention.repetitions == NOT_REPS) { // case where only periodicty is specified
124
+                    if((T - intervention.lastTimeExecuted) >= intervention.periodicity){
125
+                        if (!parser_wh.compile(intervention.what_happens, expression)){
126
+                            Rcpp::Rcout << "\nexprtk parser error: \n" << std::endl;
127
+
128
+                            for (std::size_t i = 0; i < parser_wh.error_count(); ++i){
129
+                                typedef exprtk::parser_error::type error_t;
130
+                                error_t error = parser_wh.get_error(i);
131
+                                // FIXMEmaybe: Use warning or error to capture it easily in tests?
132
+                                REprintf("Error[%02zu] Position: %02zu Type: [%14s] Msg: %s Expression: %s\n",
133
+                                    i,
134
+                                    error.token.position,
135
+                                    exprtk::parser_error::to_str(error.mode).c_str(),
136
+                                    error.diagnostic.c_str(),
137
+                                    intervention.what_happens.c_str());
138
+                            }
139
+                            std::string errorMessage = "The expression was imposible to parse.";
140
+                            throw std::invalid_argument(errorMessage);
141
+                        } else 
142
+                            parseWhatHappens(iif, uvif, intervention, N, T);
143
+                        // update new lastTimeExecuted
144
+                        intervention.lastTimeExecuted = T;
145
+                        // we update interventionDone flag
146
+                        interventionDone = true;
147
+                    }
148
+                }
149
+            }
150
+        }
151
+    }
152
+
153
+    // Now with the structure storing all the changes, we need to store the data in their own
154
+    // original structures where the data was sourced from 
155
+    // once the structure is updated, we update the structures that store the info while the simulation is running
156
+    if(interventionDone){
157
+        if(!updatePopulations(iif, fitnessEffects, Genotypes, popParams)){
158
+                throw std::runtime_error("There was an issue updating the populations while intervening.\n");
159
+        }
160
+        return true;
161
+    }
162
+    return false;   
163
+}
164
+
0 165
new file mode 100644
... ...
@@ -0,0 +1,113 @@
1
+#include "intervention.h"
2
+
3
+
4
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
5
+///////////////////////////////////////////////////////////// PRIVATE FUNCTIONS ////////////////////////////////////////////////////////
6
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
7
+
8
+void parseWhatHappens(InterventionsInfo& iif,
9
+                     UserVarsInfo& uvif,
10
+                     Intervention intervention, 
11
+                     double &totPopSize, 
12
+                     double currentTime){
13
+    
14
+    // now we need to parse the "what_happens" intervention
15
+    // TODO: raise exception, malformed what_happens specification
16
+    if(!isValidEquation(intervention.what_happens)){
17
+        throw std::runtime_error("The intervention was wrongfully specified.\n");
18
+    }
19
+
20
+    bool totalPopFlag = false;
21
+
22
+    symbol_table_t symbol_table;
23
+
24
+    for(auto& iterator : uvif.userVars) {
25
+        symbol_table.add_variable(iterator.first, iterator.second);
26
+    }
27
+    
28
+    for(auto& iterator : iif.mapGenoToPop) {
29
+        symbol_table.add_variable(iterator.first, iterator.second);
30
+    } 
31
+
32
+    double N = totPopSize;
33
+    double T = currentTime;
34
+
35
+    symbol_table.add_constant("N", N);//We reserve N to total population size
36
+    symbol_table.add_constant("T", T); //Pass current time to exprtk
37
+    symbol_table.add_constants();
38
+
39
+    expression_t expression;
40
+    expression.register_symbol_table(symbol_table);
41
+    
42
+    //Variables needed for tokeninzing
43
+    std::vector <std::string> tokens;
44
+    std::stringstream check1(intervention.what_happens); 
45
+    std::string intermediate; 
46
+
47
+    // Tokenizing whathappens '=' 
48
+    while(getline(check1, intermediate, '=')){ 
49
+        tokens.push_back(intermediate); 
50
+    } 
51
+    // now we see if the operation affects total population or genotype popolation
52
+    std::string leftMostWhatHappens = tokens[0];
53
+    leftMostWhatHappens.erase(std::remove(leftMostWhatHappens.begin(), leftMostWhatHappens.end(), ' '), leftMostWhatHappens.end());
54
+    if(leftMostWhatHappens.compare("N") == 0)
55
+        totalPopFlag = true;
56
+
57
+    // we use the right-most side of the equation
58
+    std::string rightMostWhatHappens = tokens[1];
59
+    parser_t parser_rwh;
60
+    if (!parser_rwh.compile(rightMostWhatHappens, expression)){
61
+        // error control, just in case the parsing it's not correct
62
+        Rcpp::Rcout << "\nexprtk parser error: \n" << std::endl;
63
+
64
+        for (std::size_t i = 0; i < parser_rwh.error_count(); ++i){
65
+            typedef exprtk::parser_error::type error_t;
66
+            error_t error = parser_rwh.get_error(i);
67
+            // FIXMEmaybe: Use warning or error to capture it easily in tests?
68
+            REprintf("Error[%02zu] Position: %02zu Type: [%14s] Msg: %s Expression: %s\n",
69
+                i,
70
+                error.token.position,
71
+                exprtk::parser_error::to_str(error.mode).c_str(),
72
+                error.diagnostic.c_str(),
73
+                rightMostWhatHappens.c_str());
74
+        }
75
+        std::string errorMessage = "The expression was imposible to parse.";
76
+        throw std::invalid_argument(errorMessage);
77
+    } else{
78
+        // value cant have decimals (can't exist a half-cell)
79
+        double res = floor(expression.value());
80
+
81
+        // once the value is calculated, we must assure if the operation is for the total population
82
+        // or for some specific-genotype
83
+        if (totalPopFlag && (res > N)) {
84
+            // TODO: Throw exception of some kind, this CANNOT happen by any means
85
+            throw std::runtime_error("You have specified an intervention that is not allowed.");
86
+        } 
87
+
88
+        // check that user does not create a WhatHappens that creates population: n_A = n_A * 2
89
+        if(!totalPopFlag){
90
+            try { //check with the left part of the equation finding the value for the n_*
91
+                const double& value = iif.mapGenoToPop.at(leftMostWhatHappens);
92
+                if(res > value){
93
+                    Rcpp::Rcerr << "In intervention:" << intervention.id << " with WhatHappens: " << intervention.what_happens << ". You cannot intervene to generate more population.";
94
+                    throw std::runtime_error("You have specified an intervention that is not allowed.");
95
+                }
96
+            }
97
+            catch (const std::out_of_range&) {
98
+                Rcpp::Rcout << "Key \"" << leftMostWhatHappens.c_str() << "\" not found" << std::endl;
99
+            }
100
+        }
101
+
102
+        if(totalPopFlag && res == N){ // this case is absurd, but it might happen, we just return.
103
+            return;
104
+        } else if(totalPopFlag && (res < N)){// reduce total amount of population using hipergeometric distribution
105
+            reduceTotalPopulation(iif, res, totPopSize);
106
+        } else { // update new value for genotype
107
+            std::map<std::string, double>::iterator it = iif.mapGenoToPop.find(leftMostWhatHappens); 
108
+            if(it != iif.mapGenoToPop.end()){
109
+                it->second = res; 
110
+            }
111
+        }
112
+    }
113
+}
0 114
new file mode 100644
... ...
@@ -0,0 +1,46 @@
1
+#include "intervention.h"
2
+
3
+
4
+// This function is needed if what we are trying to descrease is the whole population, and not just the population of 1 genotype
5
+// nn by default is equal 1
6
+// n array con las poblaciones de cada genotipo y su ncols(diferentes tipos de genotipos en la población)
7
+// target is the target size, to which number the population would get reduced to.
8
+void reduceTotalPopulation(InterventionsInfo& iif, double target, double totPopSize){
9
+    
10
+    // first we take all the population from the structure, and we create a vector with its populations
11
+    std::vector<double> populations;
12
+    Rcpp::NumericMatrix rcpp_mhgeo_distribution; 
13
+    Rcpp::NumericMatrix rcpp_populations_matrix;
14
+    Rcpp::NumericVector rcpp_populations;
15
+    Rcpp::NumericVector rcpp_target;
16
+    //auxiliar variable to check the structure (and the atribute mapGenoToPop) is well populated
17
+    double totalPop = 0.0;
18
+    for(auto map : iif.mapGenoToPop){
19
+        totalPop += map.second;
20
+        populations.push_back(map.second);
21
+    }
22
+    // we convert the vector to something R can understand
23
+    rcpp_populations = Rcpp::wrap(populations);
24
+    rcpp_populations.attr("dim") = Dimension(1, populations.size());
25
+
26
+    rcpp_populations_matrix = Rcpp::wrap(rcpp_populations);
27
+    rcpp_target = Rcpp::wrap(target);
28
+    
29
+    // then, we specify the total genotypes of the populations and we obtain a distribution
30
+    rcpp_mhgeo_distribution = my_rmvhyper(1, rcpp_populations_matrix, rcpp_target);
31
+
32
+    populations = Rcpp::as<std::vector<double>>(rcpp_mhgeo_distribution);
33
+
34
+    //quick check before creating the matrix CANT BE DONE HERE (totPopSize is not updated until crude is filled)
35
+    //if(totPopSize != totalPop){
36
+    //    throw std::runtime_error("TotalPop != totPopSize, exiting...");
37
+    //}
38
+
39
+    int i=0;
40
+    for(auto &map : iif.mapGenoToPop){
41
+        //check if it goes out of bounds
42
+        map.second = populations[i];
43
+        i++;
44
+    }
45
+    
46
+}
0 47
new file mode 100644
... ...
@@ -0,0 +1,85 @@
1
+#include "intervention.h"
2
+
3
+
4
+// this function updates the population by genotypes
5
+bool updatePopulations(InterventionsInfo& iif, 
6
+                       const fitnessEffectsAll& fitnessEffects, 
7
+                       const std::vector<Genotype>& Genotypes, 
8
+                       std::vector<spParamsP>& popParams){
9
+
10
+    
11
+    std::map<std::string, std::string> fvarsmap = fitnessEffects.fitnessLandscape.flfVarsBmap;
12
+    if(fvarsmap.empty()){
13
+        fvarsmap = fitnessEffects.fitnessLandscape.flfVarsDmap;
14
+    }
15
+    if(fvarsmap.empty()){
16
+        return false;
17
+    }
18
+    std::string freqType = fitnessEffects.frequencyType;
19
+
20
+    for(auto map : iif.mapGenoToPop){
21
+        // find the population associated to a genotype
22
+        for(const auto& iterator : fvarsmap){
23
+            if(map.first == iterator.second){
24
+                std::vector<int> genotype = stringVectorToIntVector(iterator.first);//genotype (as int vector)
25
+                int position = findPositionInGenotypes(Genotypes, genotype);
26
+                //just to make sure...
27
+                if(position != 0){
28
+                    int realPos = position - 1;
29
+                    if(freqType == "abs"){
30
+                        popParams[realPos].popSize = map.second;
31
+                        // maybe add "rel" in the future?
32
+                    } else {
33
+                        return false;
34
+                    }
35
+                }
36
+            }
37
+        }
38
+    }
39
+
40
+    return true;
41
+}
42
+
43
+void printIntervention(Intervention i){
44
+
45
+    Rcpp::Rcout << i.id << " info:\n";
46
+    Rcpp::Rcout << "\t Trigger: " << i.trigger << "\n";
47
+    Rcpp::Rcout << "\t What Happens: " << i.what_happens << "\n";
48
+    Rcpp::Rcout << "\t Repetitions: " << i.repetitions << "\n";
49
+    Rcpp::Rcout << "\t Periodicity: " << i.periodicity << "\n";
50
+    Rcpp::Rcout << "\t Last Time Executed: " << i.lastTimeExecuted << "\n";
51
+}
52
+
53
+void printInterventionsInfo(InterventionsInfo iif){
54
+
55
+    for(auto intervention: iif.interventions){
56
+        printIntervention(intervention);
57
+        // print the info associated with genotypes and their population 
58
+    }
59
+
60
+    for(auto map : iif.mapGenoToPop) {
61
+            Rcpp::Rcout << "Genotype: " << map.first << " Population: " << map.second << "\n";
62
+    }
63
+
64
+}
65
+
66
+// private function that checks that the equations specified by the user are correctly specified
67
+// if no "=" or two "0" are found, returns false, if just one "=" is found, the returns true.
68
+bool isValidEquation(std::string equation){
69
+    bool flag = false;
70
+    for(std::string::size_type i=0; i<equation.size(); i++){
71
+        if (flag == true){
72
+            if(equation[i] == '='){
73
+                return false;
74
+            }
75
+        }
76
+        if(equation[i] == '='){
77
+            flag = true;
78
+        }
79
+    }
80
+
81
+    return flag;
82
+}
83
+
84
+
85
+
0 86
similarity index 100%
1 87
rename from src/multivariate_hypergeometric.cpp
2 88
rename to src/UnityOncoSimul/multivariate_hypergeometric.cpp
3 89
similarity index 92%
4 90
rename from src/multivariate_hypergeometric.h
5 91
rename to src/UnityOncoSimul/multivariate_hypergeometric.h
... ...
@@ -5,6 +5,8 @@
5 5
 // License: GPL-2
6 6
 // Downloaded on 2020-03-18
7 7
 
8
+#ifndef _MULTIVAR_HYPERGEOM__
9
+#define _MULTIVAR_HYPERGEOM__
8 10
 
9 11
 #include <Rcpp.h>
10 12
 using namespace Rcpp ;
... ...
@@ -27,3 +29,5 @@ static const double MIN_DIFF_EPS = 1e-8;
27 29
 #define VALID_PROB(p)   ((p >= 0.0) && (p <= 1.0))
28 30
 
29 31
 Rcpp::NumericMatrix my_rmvhyper(const int nn, const Rcpp::NumericMatrix n, const NumericVector k);
32
+
33
+#endif
30 34
similarity index 100%
31 35
rename from src/new_restrict.cpp
32 36
rename to src/UnityOncoSimul/new_restrict.cpp
33 37
similarity index 100%
34 38
rename from src/new_restrict.h
35 39
rename to src/UnityOncoSimul/new_restrict.h
36 40
similarity index 100%
37 41
rename from src/user_var.cpp
38 42
rename to src/UnityOncoSimul/user_var.cpp
39 43
similarity index 100%
40 44
rename from src/user_var.h
41 45
rename to src/UnityOncoSimul/user_var.h
42 46
deleted file mode 100644
... ...
@@ -1,550 +0,0 @@
1
-//     Copyright 2013-2021 Ramon Diaz-Uriarte
2
-
3
-//     This program is free software: you can redistribute it and/or modify
4
-//     it under the terms of the GNU General Public License as published by
5
-//     the Free Software Foundation, either version 3 of the License, or
6
-//     (at your option) any later version.
7
-
8
-//     This program is distributed in the hope that it will be useful,
9
-//     but WITHOUT ANY WARRANTY; without even the implied warranty of
10
-//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
-//     GNU General Public License for more details.
12
-
13
-//     You should have received a copy of the GNU General Public License
14
-//     along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
-
16
-#include "intervention.h"
17
-
18
-bool isValidEquation(std::string equation);
19
-void parseWhatHappens(InterventionsInfo& iif, 
20
-                     UserVarsInfo& uvif,
21
-                     Intervention intervention,
22
-                     double &totPopSize, double currentTime);
23
-bool updatePopulations(InterventionsInfo& iif, 
24
-                       const fitnessEffectsAll& fitnessEffects, 
25
-                       const std::vector<Genotype>& Genotypes, 
26
-                       std::vector<spParamsP>& popParams);
27
-// functions for debugging
28
-//void printIntervention(Intervention i);
29
-//void printInterventionsInfo(InterventionsInfo iif);
30
-// function that applies hypergeometric progressions to the reduction of the population 
31
-void reduceTotalPopulation(InterventionsInfo& iif, 
32
-                           double target, 
33
-                           double totPopSize);
34
-
35
-InterventionsInfo addIntervention(InterventionsInfo iif, Intervention i){
36
-    //TODO: controlar que no exista ya una intervención con las mismas caracteristicas
37
-
38
-    for(size_t k=0; k<iif.interventions.size(); k++){
39
-        if(compareInterventions(iif.interventions[k], i) == 0){
40
-            Rcpp::Rcout << "There are two interventions that are the same:";
41
-            printIntervention(iif.interventions[k]);
42
-            printIntervention(i);
43
-            return iif;
44
-        }
45
-    }
46
-
47
-    iif.interventions.push_back(i);
48
-    
49
-    return iif;
50
-}
51
-
52
-// function that creates an intervention in memory
53
-Intervention createIntervention(std::string id, 
54
-                                std::string trigger, 
55
-                                std::string what_happens, 
56
-                                float periodicity, 
57
-                                int repetitions){
58
-    Intervention i;
59
-    i.id = id;
60
-    i.trigger = trigger;
61
-    i.what_happens = what_happens;
62
-    i.periodicity = periodicity;
63
-    i.repetitions = repetitions;
64
-    i.lastTimeExecuted = 0.0;
65
-    return i;
66
-}
67
-
68
-InterventionsInfo createInterventionsInfo(Rcpp::List interventions, 
69
-                                          const fitnessEffectsAll& fitnessEffects, 
70
-                                          const std::vector<spParamsP>& popParams, 
71
-                                          std::vector<Genotype> Genotypes){
72
-   
73
-    // we declare the variables needed
74
-    InterventionsInfo iif;
75
-    Intervention iv;
76
-    int totalEntries;
77
-    //we use auxiliar variables to store the values from R
78
-    std::vector<Rcpp::List> vectorOfList;
79
-    std::vector<std::string> auxIDIntervention;
80
-    std::vector<std::string> auxTriggerIntervention;
81
-    std::vector<std::string> auxWhatHappensIntervention;
82
-    std::vector<int> auxRepetitionsIntervention;
83
-    std::vector<float> auxPeriodicityIntervention;
84
-
85
-    for(int i=0; i<interventions.length(); i++){
86
-        vectorOfList.push_back(Rcpp::as<Rcpp::List>(interventions[i]));
87
-    }
88
-
89
-    for(int i=0; i<interventions.length(); i++){
90
-        Rcpp::List listItem = vectorOfList[i];
91
-
92
-        auxIDIntervention.push_back(Rcpp::as<std::string>(listItem["ID"]));
93
-        auxTriggerIntervention.push_back(Rcpp::as<std::string>(listItem["Trigger"]));
94
-        auxWhatHappensIntervention.push_back(Rcpp::as<std::string>(listItem["WhatHappens"]));
95
-        auxRepetitionsIntervention.push_back(Rcpp::as<int>(listItem["Repetitions"]));
96
-        auxPeriodicityIntervention.push_back(Rcpp::as<float>(listItem["Periodicity"]));
97
-    }
98
-
99
-    totalEntries = interventions.length();
100
-
101
-    //now we dump the info in the structs created
102
-    for(int i=0; i<totalEntries; i++){
103
-        iv = createIntervention(auxIDIntervention.at(i), auxTriggerIntervention.at(i), auxWhatHappensIntervention.at(i), auxPeriodicityIntervention.at(i), auxRepetitionsIntervention.at(i));
104
-        iif = addIntervention(iif, iv);
105
-    }
106
-
107
-    // mapping for the genes and their population
108
-    iif.mapGenoToPop = evalFVars(fitnessEffects, Genotypes, popParams, true);
109
-
110
-    return iif;
111
-}
112
-
113
-int compareInterventions(Intervention i1, Intervention i2){
114
-
115
-    // it is not allowed to have 2 interventions with the same ID.
116
-    if(i1.id == i2.id){
117
-        return 1;
118
-    } 
119
-
120
-    if (i1.trigger != i2.trigger) {
121
-        return -1;
122
-    }
123
-    
124
-    if (i1.what_happens != i2.what_happens){
125
-        return -1;
126
-    }
127
-    
128
-    if(i1.repetitions != i2.repetitions){
129
-        return -1;
130
-    } 
131
-    
132
-    if(i1.periodicity != i2.periodicity){
133
-        return -1;
134
-    }
135
-    
136
-    if(i1.lastTimeExecuted != i2.lastTimeExecuted){
137
-        return -1;
138
-    }
139
-    // if they are equal in all aspects, then returns 0
140
-    return 0;
141
-}
142
-
143
-InterventionsInfo destroyIntervention(InterventionsInfo iif, Intervention i){
144
-    
145
-    for (size_t z = 0; z < iif.interventions.size(); z++){
146
-        if(compareInterventions(iif.interventions.at(z), i) == 0){
147
-            iif.interventions.erase(iif.interventions.begin() + z);
148
-            return iif;
149
-        }
150
-    }
151
-
152
-    return iif;
153
-}
154
-
155
-bool executeInterventions(InterventionsInfo& iif,
156
-                         UserVarsInfo& uvif, 
157
-                         double &totPopSize, 
158
-                         double &currentTime, 
159
-                         const fitnessEffectsAll& fitnessEffects, 
160
-                         std::vector<Genotype> Genotypes, 
161
-                         std::vector<spParamsP>& popParams){
162
-
163
-    // Now we add all the info needed for the symbol table so exprtk can operate 
164
-    symbol_table_t symbol_table;
165
-
166
-    for(auto& iterator : uvif.userVars) {
167
-        symbol_table.add_variable(iterator.first, iterator.second);
168
-    }
169
-
170
-    for(auto& iterator : iif.mapGenoToPop) {
171
-        symbol_table.add_variable(iterator.first, iterator.second);
172
-    } 
173
-
174
-    double N = totPopSize;
175
-
176
-    if(N == 0){
177
-        throw std::invalid_argument("Total Population = 0. There is nothing to intervene.\n");
178
-    }
179
-
180
-    double T = currentTime;
181
-
182
-    symbol_table.add_constant("N", N);//We reserve N to total population size
183
-    symbol_table.add_constant("T", T); //Pass current time to exprtk
184
-    symbol_table.add_constants();
185
-
186
-    expression_t expression;
187
-    expression.register_symbol_table(symbol_table);
188
-
189
-    bool interventionDone = false;
190
-
191
-    //we iterate over the user-specified interventions 
192
-    for(auto& intervention: iif.interventions){
193
-        parser_t parser_trigger;
194
-        //if parser fails to compile, throws exception
195
-        if (!parser_trigger.compile(intervention.trigger, expression)){
196
-            // error control, just in case the parsing it's not correct
197
-            Rcpp::Rcout << "\nexprtk parser error: \n" << std::endl;
198
-
199
-            for (std::size_t i = 0; i < parser_trigger.error_count(); ++i){
200
-                typedef exprtk::parser_error::type error_t;
201
-                error_t error = parser_trigger.get_error(i);
202
-                // FIXMEmaybe: Use warning or error to capture it easily in tests?
203
-                REprintf("Error[%02zu] Position: %02zu Type: [%14s] Msg: %s Expression: %s\n",
204
-                    i,
205
-                    error.token.position,
206
-                    exprtk::parser_error::to_str(error.mode).c_str(),
207
-                    error.diagnostic.c_str(),
208
-                    intervention.trigger.c_str());
209
-            }
210
-            std::string errorMessage = "The expression was imposible to parse.";
211
-            throw std::invalid_argument(errorMessage);
212
-        } else {
213
-            //a trigger is just a TRUE/FALSE condition
214
-            if(expression.value() == 1){
215
-                parser_t parser_wh;
216
-                if(intervention.repetitions >= 0 && intervention.periodicity == NOT_PERIODICITY){ // case where interventions are based only in repetitions
217
-                    //if parser fails to compile, throws exception
218
-                    if (!parser_wh.compile(intervention.what_happens, expression)){
219
-                        // error control, just in case the parsing it's not correct
220
-                        Rcpp::Rcout << "\nexprtk parser error: \n" << std::endl;
221
-
222
-                        for (std::size_t i = 0; i < parser_wh.error_count(); ++i){
223
-                            typedef exprtk::parser_error::type error_t;
224
-                            error_t error = parser_wh.get_error(i);
225
-                            // FIXMEmaybe: Use warning or error to capture it easily in tests?
226
-                            REprintf("Error[%02zu] Position: %02zu Type: [%14s] Msg: %s Expression: %s\n",
227
-                                i,
228
-                                error.token.position,
229
-                                exprtk::parser_error::to_str(error.mode).c_str(),
230
-                                error.diagnostic.c_str(),
231
-                                intervention.what_happens.c_str());
232
-                        }
233
-                        std::string errorMessage = "The expression was imposible to parse.";
234
-                        throw std::invalid_argument(errorMessage);
235
-                    } else 
236
-                        parseWhatHappens(iif, uvif, intervention, N, T);
237
-                    // we reduce by one the number of interventions
238
-                    intervention.repetitions--;
239
-                    // we update the last time it was executed (debugging purposes)
240
-                    intervention.lastTimeExecuted = T;
241
-                    // we update interventionDone flag
242
-                    interventionDone = true;
243
-
244
-                } else if(intervention.repetitions >= 0 && intervention.periodicity > 0) { // case there is periodicity but also repetitions
245
-                    if((T - intervention.lastTimeExecuted) >= intervention.periodicity){ // with condition satisfied we execute the intervention
246
-
247
-                        if (!parser_wh.compile(intervention.what_happens, expression)){
248
-                            Rcpp::Rcout << "\nexprtk parser error: \n" << std::endl;
249
-
250
-                            for (std::size_t i = 0; i < parser_wh.error_count(); ++i){
251
-                                typedef exprtk::parser_error::type error_t;
252
-                                error_t error = parser_wh.get_error(i);
253
-                                // FIXMEmaybe: Use warning or error to capture it easily in tests?
254
-                                REprintf("Error[%02zu] Position: %02zu Type: [%14s] Msg: %s Expression: %s\n",
255
-                                    i,
256
-                                    error.token.position,
257
-                                    exprtk::parser_error::to_str(error.mode).c_str(),
258
-                                    error.diagnostic.c_str(),
259
-                                    intervention.what_happens.c_str());
260
-                            }
261
-                            std::string errorMessage = "The expression was imposible to parse.";
262
-                            throw std::invalid_argument(errorMessage);
263
-                        } else 
264
-                            parseWhatHappens(iif, uvif, intervention, N, T);
265
-                        // update new lastTimeExecuted
266
-                        intervention.lastTimeExecuted = T;
267
-                        //  update amount of repetitions
268
-                        intervention.repetitions--;
269
-                        // we update interventionDone flag
270
-                        interventionDone = true;
271
-                    } 
272
-                } else if (intervention.periodicity > 0 && intervention.repetitions == NOT_REPS) { // case where only periodicty is specified
273
-                    if((T - intervention.lastTimeExecuted) >= intervention.periodicity){
274
-                        if (!parser_wh.compile(intervention.what_happens, expression)){
275
-                            Rcpp::Rcout << "\nexprtk parser error: \n" << std::endl;
276
-
277
-                            for (std::size_t i = 0; i < parser_wh.error_count(); ++i){
278
-                                typedef exprtk::parser_error::type error_t;
279
-                                error_t error = parser_wh.get_error(i);
280
-                                // FIXMEmaybe: Use warning or error to capture it easily in tests?
281
-                                REprintf("Error[%02zu] Position: %02zu Type: [%14s] Msg: %s Expression: %s\n",
282
-                                    i,
283
-                                    error.token.position,
284
-                                    exprtk::parser_error::to_str(error.mode).c_str(),
285
-                                    error.diagnostic.c_str(),
286
-                                    intervention.what_happens.c_str());
287
-                            }
288
-                            std::string errorMessage = "The expression was imposible to parse.";
289
-                            throw std::invalid_argument(errorMessage);
290
-                        } else 
291
-                            parseWhatHappens(iif, uvif, intervention, N, T);
292
-                        // update new lastTimeExecuted
293
-                        intervention.lastTimeExecuted = T;
294
-                        // we update interventionDone flag
295
-                        interventionDone = true;
296
-                    }
297
-                }
298
-            }
299
-        }
300
-    }
301
-
302
-    // Now with the structure storing all the changes, we need to store the data in their own
303
-    // original structures where the data was sourced from 
304
-    // once the structure is updated, we update the structures that store the info while the simulation is running
305
-    if(interventionDone){
306
-        if(!updatePopulations(iif, fitnessEffects, Genotypes, popParams)){
307
-                throw std::runtime_error("There was an issue updating the populations while intervening.\n");
308
-        }
309
-        return true;
310
-    }
311
-    return false;   
312
-}
313
-
314
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
315
-///////////////////////////////////////////////////////////// PRIVATE FUNCTIONS ////////////////////////////////////////////////////////
316
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
317
-
318
-void parseWhatHappens(InterventionsInfo& iif,
319
-                     UserVarsInfo& uvif,
320
-                     Intervention intervention, 
321
-                     double &totPopSize, 
322
-                     double currentTime){
323
-    
324
-    // now we need to parse the "what_happens" intervention
325
-    // TODO: raise exception, malformed what_happens specification
326
-    if(!isValidEquation(intervention.what_happens)){
327
-        throw std::runtime_error("The intervention was wrongfully specified.\n");
328
-    }
329
-
330
-    bool totalPopFlag = false;
331
-
332
-    symbol_table_t symbol_table;
333
-
334
-    for(auto& iterator : uvif.userVars) {
335
-        symbol_table.add_variable(iterator.first, iterator.second);
336
-    }
337
-    
338
-    for(auto& iterator : iif.mapGenoToPop) {
339
-        symbol_table.add_variable(iterator.first, iterator.second);
340
-    } 
341
-
342
-    double N = totPopSize;
343
-    double T = currentTime;
344
-
345
-    symbol_table.add_constant("N", N);//We reserve N to total population size
346
-    symbol_table.add_constant("T", T); //Pass current time to exprtk
347
-    symbol_table.add_constants();
348
-
349
-    expression_t expression;
350
-    expression.register_symbol_table(symbol_table);
351
-    
352
-    //Variables needed for tokeninzing
353
-    std::vector <std::string> tokens;
354
-    std::stringstream check1(intervention.what_happens); 
355
-    std::string intermediate; 
356
-
357
-    // Tokenizing whathappens '=' 
358
-    while(getline(check1, intermediate, '=')){ 
359
-        tokens.push_back(intermediate); 
360
-    } 
361
-    // now we see if the operation affects total population or genotype popolation
362
-    std::string leftMostWhatHappens = tokens[0];
363
-    leftMostWhatHappens.erase(std::remove(leftMostWhatHappens.begin(), leftMostWhatHappens.end(), ' '), leftMostWhatHappens.end());
364
-    if(leftMostWhatHappens.compare("N") == 0)
365
-        totalPopFlag = true;
366
-
367
-    // we use the right-most side of the equation
368
-    std::string rightMostWhatHappens = tokens[1];
369
-    parser_t parser_rwh;
370
-    if (!parser_rwh.compile(rightMostWhatHappens, expression)){
371
-        // error control, just in case the parsing it's not correct
372
-        Rcpp::Rcout << "\nexprtk parser error: \n" << std::endl;
373
-
374
-        for (std::size_t i = 0; i < parser_rwh.error_count(); ++i){
375
-            typedef exprtk::parser_error::type error_t;
376
-            error_t error = parser_rwh.get_error(i);
377
-            // FIXMEmaybe: Use warning or error to capture it easily in tests?
378
-            REprintf("Error[%02zu] Position: %02zu Type: [%14s] Msg: %s Expression: %s\n",
379
-                i,
380
-                error.token.position,
381
-                exprtk::parser_error::to_str(error.mode).c_str(),
382
-                error.diagnostic.c_str(),
383
-                rightMostWhatHappens.c_str());
384
-        }
385
-        std::string errorMessage = "The expression was imposible to parse.";
386
-        throw std::invalid_argument(errorMessage);
387
-    } else{
388
-        // value cant have decimals (can't exist a half-cell)
389
-        double res = floor(expression.value());
390
-
391
-        // once the value is calculated, we must assure if the operation is for the total population
392
-        // or for some specific-genotype
393
-        if (totalPopFlag && (res > N)) {
394
-            // TODO: Throw exception of some kind, this CANNOT happen by any means
395
-            throw std::runtime_error("You have specified an intervention that is not allowed.");
396
-        } 
397
-
398
-        // check that user does not create a WhatHappens that creates population: n_A = n_A * 2
399
-        if(!totalPopFlag){
400
-            try { //check with the left part of the equation finding the value for the n_*
401
-                const double& value = iif.mapGenoToPop.at(leftMostWhatHappens);
402
-                if(res > value){
403
-                    Rcpp::Rcerr << "In intervention:" << intervention.id << " with WhatHappens: " << intervention.what_happens << ". You cannot intervene to generate more population.";
404
-                    throw std::runtime_error("You have specified an intervention that is not allowed.");
405
-                }
406
-            }
407
-            catch (const std::out_of_range&) {
408
-                Rcpp::Rcout << "Key \"" << leftMostWhatHappens.c_str() << "\" not found" << std::endl;
409
-            }
410
-        }
411
-
412
-        if(totalPopFlag && res == N){ // this case is absurd, but it might happen, we just return.
413
-            return;
414
-        } else if(totalPopFlag && (res < N)){// reduce total amount of population using hipergeometric distribution
415
-            reduceTotalPopulation(iif, res, totPopSize);
416
-        } else { // update new value for genotype
417
-            std::map<std::string, double>::iterator it = iif.mapGenoToPop.find(leftMostWhatHappens); 
418
-            if(it != iif.mapGenoToPop.end()){
419
-                it->second = res; 
420
-            }
421
-        }
422
-    }
423
-}
424
-
425
-// This function is needed if what we are trying to descrease is the whole population, and not just the population of 1 genotype
426
-// nn by default is equal 1
427
-// n array con las poblaciones de cada genotipo y su ncols(diferentes tipos de genotipos en la población)
428
-// target is the target size, to which number the population would get reduced to.
429
-void reduceTotalPopulation(InterventionsInfo& iif, double target, double totPopSize){
430
-    
431
-    // first we take all the population from the structure, and we create a vector with its populations
432
-    std::vector<double> populations;
433
-    Rcpp::NumericMatrix rcpp_mhgeo_distribution; 
434
-    Rcpp::NumericMatrix rcpp_populations_matrix;
435
-    Rcpp::NumericVector rcpp_populations;
436
-    Rcpp::NumericVector rcpp_target;
437
-    //auxiliar variable to check the structure (and the atribute mapGenoToPop) is well populated
438
-    double totalPop = 0.0;
439
-    for(auto map : iif.mapGenoToPop){
440
-        totalPop += map.second;
441
-        populations.push_back(map.second);
442
-    }
443
-    // we convert the vector to something R can understand
444
-    rcpp_populations = Rcpp::wrap(populations);
445
-    rcpp_populations.attr("dim") = Dimension(1, populations.size());
446
-
447
-    rcpp_populations_matrix = Rcpp::wrap(rcpp_populations);
448
-    rcpp_target = Rcpp::wrap(target);
449
-    
450
-    // then, we specify the total genotypes of the populations and we obtain a distribution
451
-    rcpp_mhgeo_distribution = my_rmvhyper(1, rcpp_populations_matrix, rcpp_target);
452
-
453
-    populations = Rcpp::as<std::vector<double>>(rcpp_mhgeo_distribution);
454
-
455
-    //quick check before creating the matrix CANT BE DONE HERE (totPopSize is not updated until crude is filled)
456
-    //if(totPopSize != totalPop){
457
-    //    throw std::runtime_error("TotalPop != totPopSize, exiting...");
458
-    //}
459
-
460
-    int i=0;
461
-    for(auto &map : iif.mapGenoToPop){
462
-        //check if it goes out of bounds
463
-        map.second = populations[i];
464
-        i++;
465
-    }
466
-    
467
-}
468
-
469
-// this function updates the population by genotypes
470
-bool updatePopulations(InterventionsInfo& iif, 
471
-                       const fitnessEffectsAll& fitnessEffects, 
472
-                       const std::vector<Genotype>& Genotypes, 
473
-                       std::vector<spParamsP>& popParams){
474
-
475
-    
476
-    std::map<std::string, std::string> fvarsmap = fitnessEffects.fitnessLandscape.flfVarsBmap;
477
-    if(fvarsmap.empty()){
478
-        fvarsmap = fitnessEffects.fitnessLandscape.flfVarsDmap;
479
-    }
480
-    if(fvarsmap.empty()){
481
-        return false;
482
-    }
483
-    std::string freqType = fitnessEffects.frequencyType;
484
-
485
-    for(auto map : iif.mapGenoToPop){
486
-        // find the population associated to a genotype
487
-        for(const auto& iterator : fvarsmap){
488
-            if(map.first == iterator.second){
489
-                std::vector<int> genotype = stringVectorToIntVector(iterator.first);//genotype (as int vector)
490
-                int position = findPositionInGenotypes(Genotypes, genotype);
491
-                //just to make sure...
492
-                if(position != 0){
493
-                    int realPos = position - 1;
494
-                    if(freqType == "abs"){
495
-                        popParams[realPos].popSize = map.second;
496
-                        // maybe add "rel" in the future?
497
-                    } else {
498
-                        return false;
499
-                    }
500
-                }
501
-            }
502
-        }
503
-    }
504
-
505
-    return true;
506
-}
507
-
508
-void printIntervention(Intervention i){
509
-
510
-    Rcpp::Rcout << i.id << " info:\n";
511
-    Rcpp::Rcout << "\t Trigger: " << i.trigger << "\n";
512
-    Rcpp::Rcout << "\t What Happens: " << i.what_happens << "\n";
513
-    Rcpp::Rcout << "\t Repetitions: " << i.repetitions << "\n";
514
-    Rcpp::Rcout << "\t Periodicity: " << i.periodicity << "\n";
515
-    Rcpp::Rcout << "\t Last Time Executed: " << i.lastTimeExecuted << "\n";
516
-}
517
-
518
-void printInterventionsInfo(InterventionsInfo iif){
519
-
520
-    for(auto intervention: iif.interventions){
521
-        printIntervention(intervention);
522
-        // print the info associated with genotypes and their population 
523
-    }
524
-
525
-    for(auto map : iif.mapGenoToPop) {
526
-            Rcpp::Rcout << "Genotype: " << map.first << " Population: " << map.second << "\n";
527
-    }
528
-
529
-}
530
-
531
-// private function that checks that the equations specified by the user are correctly specified
532
-// if no "=" or two "0" are found, returns false, if just one "=" is found, the returns true.
533
-bool isValidEquation(std::string equation){
534
-    bool flag = false;
535
-    for(std::string::size_type i=0; i<equation.size(); i++){
536
-        if (flag == true){
537
-            if(equation[i] == '='){
538
-                return false;
539
-            }
540
-        }
541
-        if(equation[i] == '='){
542
-            flag = true;
543
-        }
544
-    }
545
-
546
-    return flag;
547
-}
548
-
549
-
550
-
551 0
new file mode 100644
... ...
@@ -0,0 +1,11 @@
1
+#include "UnityOncoSimul/accessible_genotypes.cpp"
2
+#include "UnityOncoSimul/user_var.cpp"
3
+#include "UnityOncoSimul/new_restrict.cpp"
4
+#include "UnityOncoSimul/BNB_nr.cpp"
5
+#include "UnityOncoSimul/bnb_common.cpp"
6
+#include "UnityOncoSimul/multivariate_hypergeometric.cpp"
7
+#include "UnityOncoSimul/intervention.cpp"
8
+#include "UnityOncoSimul/intervention_2.cpp"
9
+#include "UnityOncoSimul/intervention_private.cpp"
10
+#include "UnityOncoSimul/intervention_private_2.cpp"
11
+#include "UnityOncoSimul/intervention_private_3.cpp"
... ...
@@ -1,15 +1,15 @@
1 1
 \usepackage[%
2
-		shash={ba4087e},
3
-		lhash={ba4087ece38225431d51d7379f18937c3802e8ac},
2
+		shash={7dc1136},
3
+		lhash={7dc113658dd77a3386396aed1d4400c5d059485a},
4 4
 		authname={ramon diaz-uriarte (at Phelsuma)},
5 5
 		authemail={rdiaz02@gmail.com},
6
-		authsdate={2022-07-19},
7
-		authidate={2022-07-19 14:45:26 +0200},
8
-		authudate={1658234726},
6
+		authsdate={2022-09-15},
7
+		authidate={2022-09-15 20:00:06 +0200},
8
+		authudate={1663264806},
9 9
 		commname={ramon diaz-uriarte (at Phelsuma)},
10 10
 		commemail={rdiaz02@gmail.com},
11
-		commsdate={2022-07-19},
12
-		commidate={2022-07-19 14:45:26 +0200},
13
-		commudate={1658234726},
14
-		refnames={ (HEAD -> master, origin/master, origin/HEAD)}
11
+		commsdate={2022-09-15},
12
+		commidate={2022-09-15 20:00:06 +0200},
13
+		commudate={1663264806},
14
+		refnames={ (HEAD -> master, origin/unity-compile, unity-compile)}
15 15
 	]{gitsetinfo}
16 16
\ No newline at end of file