... | ... |
@@ -1,7 +1,7 @@ |
1 | 1 |
Package: OncoSimulR |
2 | 2 |
Type: Package |
3 | 3 |
Title: Forward Genetic Simulation of Cancer Progression with Epistasis |
4 |
-Version: 3.99.10 |
|
4 |
+Version: 3.99.11 |
|
5 | 5 |
Date: 2022-10-13 |
6 | 6 |
Authors@R: c( |
7 | 7 |
person("Ramon", "Diaz-Uriarte", role = c("aut", "cre"), |
... | ... |
@@ -154,7 +154,7 @@ Author: Ramon Diaz-Uriarte [aut, cre], |
154 | 154 |
Rafael Barrero Rodriguez [ctb], |
155 | 155 |
Silvia Talavera Marcos [ctb] |
156 | 156 |
Maintainer: Ramon Diaz-Uriarte <rdiaz02@gmail.com> |
157 |
-Description: Functions for forward population genetic simulation in asexual populations, with special focus on cancer progression. Fitness can be an arbitrary function of genetic interactions between multiple genes or modules of genes, including epistasis, order restrictions in mutation accumulation, and order effects. Fitness (including just birth, just death, or both and death) can also be a function of the relative and absolute frequencies of other genotypes (i.e., frequency-dependent fitness). Mutation rates can differ between genes, and we can include mutator/antimutator genes (to model mutator phenotypes). Simulating multi-species scenarios and therapeutic interventions, including adaptive therapy, is also possible. Simulations use continuous-time models and can include driver and passenger genes and modules. Also included are functions for: simulating random DAGs of the type found in Oncogenetic Trees, Conjunctive Bayesian Networks, and other cancer progression models; plotting and sampling from single or multiple realizations of the simulations, including single-cell sampling; plotting the parent-child relationships of the clones; generating random fitness landscapes (Rough Mount Fuji, House of Cards, additive, NK, Ising, and Eggbox models) and plotting them. |
|
157 |
+Description: Functions for forward population genetic simulation in asexual populations, with special focus on cancer progression. Fitness can be an arbitrary function of genetic interactions between multiple genes or modules of genes, including epistasis, order restrictions in mutation accumulation, and order effects. Fitness (including just birth, just death, or both birth and death) can also be a function of the relative and absolute frequencies of other genotypes (i.e., frequency-dependent fitness). Mutation rates can differ between genes, and we can include mutator/antimutator genes (to model mutator phenotypes). Simulating multi-species scenarios and therapeutic interventions, including adaptive therapy, is also possible. Simulations use continuous-time models and can include driver and passenger genes and modules. Also included are functions for: simulating random DAGs of the type found in Oncogenetic Trees, Conjunctive Bayesian Networks, and other cancer progression models; plotting and sampling from single or multiple realizations of the simulations, including single-cell sampling; plotting the parent-child relationships of the clones; generating random fitness landscapes (Rough Mount Fuji, House of Cards, additive, NK, Ising, and Eggbox models) and plotting them. |
|
158 | 158 |
biocViews: BiologicalQuestion, SomaticMutation |
159 | 159 |
License: GPL (>= 3) |
160 | 160 |
URL: https://github.com/rdiaz02/OncoSimul, https://popmodels.cancercontrol.cancer.gov/gsr/packages/oncosimulr/ |
... | ... |
@@ -1,3 +1,7 @@ |
1 |
+Changes in version 3.99.11 (2022-10-13): |
|
2 |
+ - Increase max.wall.time of two tests, as in very slow Windoze machines |
|
3 |
+ they can hit max wall time. |
|
4 |
+ |
|
1 | 5 |
Changes in version 3.99.10 (2022-10-13): |
2 | 6 |
- onlyCancer = FALSE by default in all calls to oncoSimul*. |
3 | 7 |
This is a possible BRAEKING CHANGE. |
... | ... |
@@ -1,6 +1,12 @@ |
1 | 1 |
inittime <- Sys.time() |
2 | 2 |
cat(paste("\n Starting interventions tests", date(), "\n")) |
3 | 3 |
|
4 |
+## FIXME |
|
5 |
+## These two tests are extremely computationally intensive, |
|
6 |
+## and I think could be better tested otherwise. |
|
7 |
+## And this test has many non-idiomatic R constructs |
|
8 |
+## and it could probably run in a 1/10 of the time |
|
9 |
+ |
|
4 | 10 |
test_that("1. Drastically reducing a high-fitness genotype population (McFL) | Trigger depends on T and n_*", { |
5 | 11 |
set.seed(1) |
6 | 12 |
df3x <- data.frame(Genotype = c("WT", "B", "R"), |
... | ... |
@@ -12,6 +18,7 @@ test_that("1. Drastically reducing a high-fitness genotype population (McFL) | T |
12 | 18 |
frequencyDependentFitness = TRUE, |
13 | 19 |
frequencyType = "abs") |
14 | 20 |
|
21 |
+ ## FIXME: why such periodicity? |
|
15 | 22 |
interventions <- list( |
16 | 23 |
list( |
17 | 24 |
ID = "intOverBAffectsR", |
... | ... |
@@ -31,17 +38,24 @@ test_that("1. Drastically reducing a high-fitness genotype population (McFL) | T |
31 | 38 |
|
32 | 39 |
interventions <- createInterventions(interventions, afd3) |
33 | 40 |
|
41 |
+ |
|
34 | 42 |
ep2 <- oncoSimulIndiv( |
35 |
- afd3, |
|
36 |
- model = "McFLD", |
|
37 |
- mu = 1e-4, |
|
38 |
- sampleEvery = 0.001, |
|
39 |
- initSize = c(5000, 10, 300), |
|
40 |
- initMutant = c("WT", "B", "R"), |
|
41 |
- finalTime = 100, |
|
42 |
- onlyCancer = FALSE, |
|
43 |
- interventions = interventions |
|
44 |
- ) |
|
43 |
+ afd3, |
|
44 |
+ model = "McFLD", |
|
45 |
+ mu = 1e-4, |
|
46 |
+ sampleEvery = 0.001, |
|
47 |
+ initSize = c(5000, 10, 300), |
|
48 |
+ initMutant = c("WT", "B", "R"), |
|
49 |
+ finalTime = 100, |
|
50 |
+ onlyCancer = FALSE, |
|
51 |
+ interventions = interventions, |
|
52 |
+ ## FIXME: this test occasionally fails |
|
53 |
+ ## as it goes > 200 s in Windows. |
|
54 |
+ ## This should not be needed |
|
55 |
+ max.wall.time = 600 |
|
56 |
+ ) |
|
57 |
+ |
|
58 |
+ ## Why the thresholds? 210 here and 40 below. |
|
45 | 59 |
|
46 | 60 |
flag <- FALSE |
47 | 61 |
i <- 20002 |
... | ... |
@@ -58,6 +72,9 @@ test_that("1. Drastically reducing a high-fitness genotype population (McFL) | T |
58 | 72 |
# we control that the B population |
59 | 73 |
flag <- FALSE |
60 | 74 |
i <- 80002 |
75 |
+ |
|
76 |
+ ## FIXME: why simulate to 100 time units if we only look up |
|
77 |
+ ## to row 85000? |
|
61 | 78 |
while(i <= 85000){ |
62 | 79 |
if(ep2$pops.by.time[i, 3:3] > 40){ |
63 | 80 |
flag <- TRUE |
... | ... |
@@ -106,22 +123,26 @@ test_that("2. Drastically reducing a high-fitness genotype population (Exp) | Tr |
106 | 123 |
interventions <- createInterventions(interventions, afd3) |
107 | 124 |
|
108 | 125 |
ep2 <- oncoSimulIndiv( |
109 |
- afd3, |
|
110 |
- model = "Exp", |
|
111 |
- mu = 1e-4, |
|
112 |
- sampleEvery = 0.001, |
|
113 |
- initSize = c(5000, 10, 300), |
|
114 |
- initMutant = c("WT", "B", "R"), |
|
115 |
- finalTime = 100, |
|
116 |
- onlyCancer = FALSE, |
|
117 |
- interventions = interventions) |
|
126 |
+ afd3, |
|
127 |
+ model = "Exp", |
|
128 |
+ mu = 1e-4, |
|
129 |
+ sampleEvery = 0.001, |
|
130 |
+ initSize = c(5000, 10, 300), |
|
131 |
+ initMutant = c("WT", "B", "R"), |
|
132 |
+ finalTime = 100, |
|
133 |
+ onlyCancer = FALSE, |
|
134 |
+ interventions = interventions, |
|
135 |
+ ## FIXME: This huge wall time should not be necessary. |
|
136 |
+ ## See above; this is slow as hell in Windows. |
|
137 |
+ max.wall.time = 600) |
|
118 | 138 |
|
119 | 139 |
## In Macs, |
120 | 140 |
## if (ep2$pops.by.time[i, 3:3] >= 210) { |
121 | 141 |
## flag <- TRUE |
122 | 142 |
## }`: argument is of length zero |
123 | 143 |
## So only run if not on a Mac |
124 |
- if (Sys.info()["sysname"] != "Darwin") { |
|
144 |
+ ## FIXME: this is because the above fails hitting wall time |
|
145 |
+## if (Sys.info()["sysname"] != "Darwin") { |
|
125 | 146 |
flag <- FALSE |
126 | 147 |
i <- 20002 |
127 | 148 |
while(i <= 70001){ |
... | ... |
@@ -131,7 +152,7 @@ test_that("2. Drastically reducing a high-fitness genotype population (Exp) | Tr |
131 | 152 |
i <- i + 1 |
132 | 153 |
} |
133 | 154 |
testthat::expect_equal(flag, FALSE) |
134 |
- |
|
155 |
+ |
|
135 | 156 |
|
136 | 157 |
## then, between the time intervals, T >= 80 and T<=85 |
137 | 158 |
## we control that the B population |
... | ... |
@@ -147,7 +168,7 @@ test_that("2. Drastically reducing a high-fitness genotype population (Exp) | Tr |
147 | 168 |
testthat::expect_equal(flag, FALSE) |
148 | 169 |
## we plot the simulation when no interventions are specified. |
149 | 170 |
## plot(ep2, show = "genotypes", type = "line") |
150 |
- } |
|
171 |
+## } |
|
151 | 172 |
}) |
152 | 173 |
|
153 | 174 |
cat(paste("\n Ending interventions tests", date(), "\n")) |
... | ... |
@@ -43,9 +43,9 @@ test_that("2. Two interventions cannot have the same ID (check_double_id)", { |
43 | 43 |
WhatHappens = "n_A = n_A * 0.4", |
44 | 44 |
Repetitions = Inf, |
45 | 45 |
Periodicity = Inf |
46 |
- ) |
|
46 |
+ ) |
|
47 | 47 |
) |
48 |
- testthat::expect_error(createInterventions(interventions, afd3), "Check the interventions, there are 2 or more that have same IDs") |
|
48 |
+ testthat::expect_error(createInterventions(interventions, afd3), "Check the interventions, there are 2 or more that have same IDs") |
|
49 | 49 |
}) |
50 | 50 |
|
51 | 51 |
test_that("3. The attribute WhatHappens is correctly specified (check_what_happens)",{ |
... | ... |
@@ -55,11 +55,12 @@ test_that("3. The attribute WhatHappens is correctly specified (check_what_happe |
55 | 55 |
WhatHappens = "n_A +1 = n_A * 0.1", |
56 | 56 |
Repetitions = 0, |
57 | 57 |
Periodicity = Inf |
58 |
- ) |
|
58 |
+ ) |
|
59 | 59 |
) |
60 | 60 |
|
61 |
- testthat::expect_error(createInterventions(interventions, afd3), "The specification of WhatHappens is wrong.\n It should be: |
|
62 |
- <genotype_to_apply_some_operation or total_population> = <some_operation>\n Exiting.") |
|
61 |
+ testthat::expect_error(createInterventions(interventions, afd3), |
|
62 |
+ "The specification of WhatHappens is wrong.\n It should be:") |
|
63 |
+ ## <genotype_to_apply_some_operation or total_population> = <some_operation>\n Exiting.") |
|
63 | 64 |
|
64 | 65 |
interventions <- list( |
65 | 66 |
list(ID = "intOverA", |
... | ... |
@@ -67,11 +68,12 @@ test_that("3. The attribute WhatHappens is correctly specified (check_what_happe |
67 | 68 |
WhatHappens = "n_A = n_A * 0.1 = 32", |
68 | 69 |
Repetitions = 0, |
69 | 70 |
Periodicity = Inf |
70 |
- ) |
|
71 |
+ ) |
|
71 | 72 |
) |
72 | 73 |
|
73 |
- testthat::expect_error(createInterventions(interventions, afd3), "The specification of WhatHappens is wrong.\n It should be: |
|
74 |
- <genotype_to_apply_some_operation or total_population> = <some_operation>\n Exiting.") |
|
74 |
+ testthat::expect_error(createInterventions(interventions, afd3), |
|
75 |
+ "The specification of WhatHappens is wrong.\n It should be:") |
|
76 |
+ ## <genotype_to_apply_some_operation or total_population> = <some_operation>\n Exiting.") |
|
75 | 77 |
|
76 | 78 |
interventions <- list( |
77 | 79 |
list(ID = "intOverA", |
... | ... |
@@ -79,15 +81,16 @@ test_that("3. The attribute WhatHappens is correctly specified (check_what_happe |
79 | 81 |
WhatHappens = "= n_A * 0.1 = 32", |
80 | 82 |
Repetitions = 0, |
81 | 83 |
Periodicity = Inf |
82 |
- ) |
|
84 |
+ ) |
|
83 | 85 |
) |
84 | 86 |
|
85 |
- testthat::expect_error(createInterventions(interventions, afd3), "The specification of WhatHappens is wrong.\n It should be: |
|
86 |
- <genotype_to_apply_some_operation or total_population> = <some_operation>\n Exiting.") |
|
87 |
+ testthat::expect_error(createInterventions(interventions, afd3), |
|
88 |
+ "The specification of WhatHappens is wrong.\n It should be:") |
|
89 |
+ ## <genotype_to_apply_some_operation or total_population> = <some_operation>\n Exiting.") |
|
87 | 90 |
}) |
88 | 91 |
|
89 | 92 |
test_that("4. The user cannot create population in an intervention",{ |
90 |
- # in this test, the main goal is to create a scenario where |
|
93 |
+ # in this test, the main goal is to create a scenario where |
|
91 | 94 |
# the whathappens is wrong, and creates population |
92 | 95 |
|
93 | 96 |
list_of_interventions <- list( |
... | ... |
@@ -96,7 +99,7 @@ test_that("4. The user cannot create population in an intervention",{ |
96 | 99 |
WhatHappens = "n_A = n_A * 2", |
97 | 100 |
Repetitions = 0, |
98 | 101 |
Periodicity = Inf |
99 |
- ) |
|
102 |
+ ) |
|
100 | 103 |
) |
101 | 104 |
|
102 | 105 |
# we force the A genotype to not have mutationrate of 1 to avoid unexpected messages. |
... | ... |
@@ -111,7 +114,7 @@ test_that("4. The user cannot create population in an intervention",{ |
111 | 114 |
interventions <- createInterventions(list_of_interventions, afd3) |
112 | 115 |
|
113 | 116 |
testthat::expect_output(oncoSimulIndiv( |
114 |
- afd3, |
|
117 |
+ afd3, |
|
115 | 118 |
model = "McFL", |
116 | 119 |
mu = 1e-4, |
117 | 120 |
initSize = c(20000, 20000), |
... | ... |
@@ -120,8 +123,8 @@ test_that("4. The user cannot create population in an intervention",{ |
120 | 123 |
sampleEvery = 0.01, |
121 | 124 |
onlyCancer = FALSE, |
122 | 125 |
interventions = interventions |
123 |
- ), , paste0("In intervention:", interventions[[1]]$ID, |
|
124 |
- " with WhatHappens: ", interventions[[1]]$WhatHappens, |
|
126 |
+ ), , paste0("In intervention:", interventions[[1]]$ID, |
|
127 |
+ " with WhatHappens: ", interventions[[1]]$WhatHappens, |
|
125 | 128 |
". You cannot intervene to generate more population.")) |
126 | 129 |
|
127 | 130 |
}) |
... | ... |
@@ -138,7 +141,7 @@ test_that("5. Drastically reducing A-genotype population (McFL) | Trigger depend |
138 | 141 |
frequencyType = "abs") |
139 | 142 |
# run the simulation without interventions |
140 | 143 |
ep1 <- oncoSimulIndiv( |
141 |
- afd3, |
|
144 |
+ afd3, |
|
142 | 145 |
model = "McFL", |
143 | 146 |
mu = 1e-4, |
144 | 147 |
initSize = c(20000, 20000), |
... | ... |
@@ -161,7 +164,7 @@ test_that("5. Drastically reducing A-genotype population (McFL) | Trigger depend |
161 | 164 |
|
162 | 165 |
# run the simulation WITH interventions |
163 | 166 |
ep2 <- oncoSimulIndiv( |
164 |
- afd3, |
|
167 |
+ afd3, |
|
165 | 168 |
model = "McFL", |
166 | 169 |
mu = 1e-4, |
167 | 170 |
initSize = c(20000, 20000), |
... | ... |
@@ -197,7 +200,7 @@ test_that("6. Drastically reducing A population (Exp) | Trigger dependending on |
197 | 200 |
frequencyType = "abs") |
198 | 201 |
|
199 | 202 |
ep1 <- oncoSimulIndiv( |
200 |
- afd3, |
|
203 |
+ afd3, |
|
201 | 204 |
model = "Exp", |
202 | 205 |
mu = 1e-4, |
203 | 206 |
sampleEvery = 0.001, |
... | ... |
@@ -220,7 +223,7 @@ test_that("6. Drastically reducing A population (Exp) | Trigger dependending on |
220 | 223 |
interventions <- createInterventions(interventions, afd3) |
221 | 224 |
|
222 | 225 |
ep2 <- oncoSimulIndiv( |
223 |
- afd3, |
|
226 |
+ afd3, |
|
224 | 227 |
model = "Exp", |
225 | 228 |
mu = 1e-4, |
226 | 229 |
sampleEvery = 0.001, |
... | ... |
@@ -258,7 +261,7 @@ test_that("7. Intervening over total population (McFL) | Trigger depends on T", |
258 | 261 |
ID = "intOverTotPop", |
259 | 262 |
Trigger = "T > 40", |
260 | 263 |
WhatHappens = "N = N * 0.6", |
261 |
- Repetitions = 2, |
|
264 |
+ Repetitions = 2, |
|
262 | 265 |
Periodicity = 20 |
263 | 266 |
) |
264 | 267 |
) |
... | ... |
@@ -323,7 +326,7 @@ test_that("8. Intervening over total population (Exp) | Trigger depends on T", { |
323 | 326 |
ID = "intOverTotPop", |
324 | 327 |
Trigger = "T > 10", |
325 | 328 |
WhatHappens = "N = N * 0.8", |
326 |
- Repetitions = 2, |
|
329 |
+ Repetitions = 2, |
|
327 | 330 |
Periodicity = 10 |
328 | 331 |
) |
329 | 332 |
) |
... | ... |
@@ -339,7 +342,7 @@ test_that("8. Intervening over total population (Exp) | Trigger depends on T", { |
339 | 342 |
sampleEvery = 0.001, |
340 | 343 |
interventions = interventions) |
341 | 344 |
|
342 |
- # it may happen that, in some simulations, the population collapses, in that case, |
|
345 |
+ # it may happen that, in some simulations, the population collapses, in that case, |
|
343 | 346 |
# pops by time is null, and cannot be checked |
344 | 347 |
|
345 | 348 |
# we can check genotype by genotype that when an intervention ocurs, their population lowers |
... | ... |
@@ -380,7 +383,7 @@ test_that("11. Intervening over 4 genotypes both over specific genotype and tota |
380 | 383 |
Fitness = c("1", |
381 | 384 |
"1.01 + (0 * n_A)", |
382 | 385 |
"1.1", |
383 |
- "1.09", |
|
386 |
+ "1.09", |
|
384 | 387 |
"1.07")) |
385 | 388 |
|
386 | 389 |
afd3 <- allFitnessEffects(genotFitness = df3x, |
... | ... |
@@ -391,28 +394,28 @@ test_that("11. Intervening over 4 genotypes both over specific genotype and tota |
391 | 394 |
ID = "intOverA", |
392 | 395 |
Trigger = "T >= 1.2", |
393 | 396 |
WhatHappens = "n_A = n_A * 0.5", |
394 |
- Repetitions = 0, |
|
397 |
+ Repetitions = 0, |
|
395 | 398 |
Periodicity = Inf |
396 | 399 |
), |
397 | 400 |
list( |
398 | 401 |
ID = "intOverB", |
399 | 402 |
Trigger = "T >= 2.2", |
400 | 403 |
WhatHappens = "n_B = n_B * 0.5", |
401 |
- Repetitions = 0, |
|
404 |
+ Repetitions = 0, |
|
402 | 405 |
Periodicity = Inf |
403 | 406 |
), |
404 | 407 |
list( |
405 | 408 |
ID = "intOverC", |
406 | 409 |
Trigger = "T >= 3.2", |
407 | 410 |
WhatHappens = "n_C = n_C * 0.5", |
408 |
- Repetitions = 0, |
|
411 |
+ Repetitions = 0, |
|
409 | 412 |
Periodicity = Inf |
410 | 413 |
), |
411 | 414 |
list( |
412 | 415 |
ID = "intOverD", |
413 | 416 |
Trigger = "T >= 4.2", |
414 | 417 |
WhatHappens = "n_D = n_D * 0.5", |
415 |
- Repetitions = 0, |
|
418 |
+ Repetitions = 0, |
|
416 | 419 |
Periodicity = Inf |
417 | 420 |
) |
418 | 421 |
) |
... | ... |
@@ -478,7 +481,7 @@ test_that("12. Intervening over 4 genotypes both over specific and total populat |
478 | 481 |
Fitness = c("1", |
479 | 482 |
"1.01 + (0 * n_A)", |
480 | 483 |
"1.1", |
481 |
- "1.09", |
|
484 |
+ "1.09", |
|
482 | 485 |
"1.07")) |
483 | 486 |
|
484 | 487 |
afd3 <- allFitnessEffects(genotFitness = df3x, |
... | ... |
@@ -489,28 +492,28 @@ test_that("12. Intervening over 4 genotypes both over specific and total populat |
489 | 492 |
ID = "intOverA", |
490 | 493 |
Trigger = "T >= 1.2", |
491 | 494 |
WhatHappens = "n_A = n_A * 0.5", |
492 |
- Repetitions = 0, |
|
495 |
+ Repetitions = 0, |
|
493 | 496 |
Periodicity = Inf |
494 | 497 |
), |
495 | 498 |
list( |
496 | 499 |
ID = "intOverB", |
497 | 500 |
Trigger = "T >= 2.2", |
498 | 501 |
WhatHappens = "n_B = n_B * 0.5", |
499 |
- Repetitions = 0, |
|
502 |
+ Repetitions = 0, |
|
500 | 503 |
Periodicity = Inf |
501 | 504 |
), |
502 | 505 |
list( |
503 | 506 |
ID = "intOverC", |
504 | 507 |
Trigger = "T >= 3.2", |
505 | 508 |
WhatHappens = "n_C = n_C * 0.5", |
506 |
- Repetitions = 0, |
|
509 |
+ Repetitions = 0, |
|
507 | 510 |
Periodicity = Inf |
508 | 511 |
), |
509 | 512 |
list( |
510 | 513 |
ID = "intOverD", |
511 | 514 |
Trigger = "T >= 4.2", |
512 | 515 |
WhatHappens = "n_D = n_D * 0.5", |
513 |
- Repetitions = 0, |
|
516 |
+ Repetitions = 0, |
|
514 | 517 |
Periodicity = Inf |
515 | 518 |
) |
516 | 519 |
) |
... | ... |
@@ -610,7 +613,7 @@ test_that("13. Intervening in the Rock-Paper-Scissors model for bacterial commun |
610 | 613 |
errorHitWallTime = FALSE, |
611 | 614 |
interventions = final_interventions) |
612 | 615 |
|
613 |
- # by reducing C, R wont spread in the population. This will mean that, with the apropiate |
|
616 |
+ # by reducing C, R wont spread in the population. This will mean that, with the apropiate |
|
614 | 617 |
# periodicty in the intervention, C will never surpass WT. We try to check this in these tests. |
615 | 618 |
i <- 1 |
616 | 619 |
while(i <= nrow(resultscrs1$pops.by.time)){ |
... | ... |
@@ -630,7 +633,7 @@ test_that("14. Intervening over total population (Exp) | Trigger depends on user |
630 | 633 |
afd3 <- allFitnessEffects(genotFitness = gffd3, |
631 | 634 |
frequencyDependentFitness = TRUE, |
632 | 635 |
frequencyType = "abs") |
633 |
- |
|
636 |
+ |
|
634 | 637 |
userVars <- list( |
635 | 638 |
list(Name = "user_var_1", |
636 | 639 |
Value = 0 |
... | ... |
@@ -686,9 +689,12 @@ test_that("14. Intervening over total population (Exp) | Trigger depends on user |
686 | 689 |
sampleEvery = 0.001, |
687 | 690 |
interventions = interventions, |
688 | 691 |
userVars = userVars, |
689 |
- rules = rules) |
|
692 |
+ rules = rules, |
|
693 |
+ ## FIXME |
|
694 |
+ ## In Windows sometimes this takes forever |
|
695 |
+ max.wall.time = 600) |
|
690 | 696 |
|
691 |
- # it may happen that, in some simulations, the population collapses, in that case, |
|
697 |
+ # it may happen that, in some simulations, the population collapses, in that case, |
|
692 | 698 |
# pops by time is null, and cannot be checked |
693 | 699 |
|
694 | 700 |
# we can check genotype by genotype that when an intervention ocurs, their population lowers |
... | ... |
@@ -720,6 +726,8 @@ test_that("14. Intervening over total population (Exp) | Trigger depends on user |
720 | 726 |
testthat::expect_gte(prev_line[4], line[4]) |
721 | 727 |
} |
722 | 728 |
} |
729 |
+ |
|
730 |
+ # This will break if the simulation aborted |
|
723 | 731 |
testthat::expect_gt(sfd3$other$interventionTimes[1], 10.000) |
724 | 732 |
testthat::expect_lt(sfd3$other$interventionTimes[1], 10.001) |
725 | 733 |
testthat::expect_gt(sfd3$other$interventionTimes[2], 20.000) |
... | ... |
@@ -738,7 +746,7 @@ test_that("15. Intervening over total population (Exp) | WhatHappens uses user v |
738 | 746 |
afd3 <- allFitnessEffects(genotFitness = gffd3, |
739 | 747 |
frequencyDependentFitness = TRUE, |
740 | 748 |
frequencyType = "abs") |
741 |
- |
|
749 |
+ |
|
742 | 750 |
userVars <- list( |
743 | 751 |
list(Name = "user_var_1", |
744 | 752 |
Value = 0 |
... | ... |
@@ -782,9 +790,11 @@ test_that("15. Intervening over total population (Exp) | WhatHappens uses user v |
782 | 790 |
sampleEvery = 0.001, |
783 | 791 |
interventions = interventions, |
784 | 792 |
userVars = userVars, |
785 |
- rules = rules) |
|
793 |
+ rules = rules, |
|
794 |
+ ## FIXME: again, in Windows this sometimes takes a very long time |
|
795 |
+ max.wall.time = 600) |
|
786 | 796 |
|
787 |
- # it may happen that, in some simulations, the population collapses, in that case, |
|
797 |
+ # it may happen that, in some simulations, the population collapses, in that case, |
|
788 | 798 |
# pops by time is null, and cannot be checked |
789 | 799 |
|
790 | 800 |
# we can check genotype by genotype that when an intervention ocurs, their population lowers |
... | ... |
@@ -803,7 +813,7 @@ test_that("15. Intervening over total population (Exp) | WhatHappens uses user v |
803 | 813 |
total <- line[2] + line[3] + line[4] |
804 | 814 |
prev_total <- prev_line[2] + prev_line[3] + prev_line[4] |
805 | 815 |
# T = 15 |
806 |
- if(i == 1){ |
|
816 |
+ if(i == 1){ |
|
807 | 817 |
testthat::expect_gt(total, prev_total*0.5 - 0.2*prev_total) |
808 | 818 |
testthat::expect_lt(total, prev_total*0.5 + 0.2*prev_total) |
809 | 819 |
# T = 25 |
... | ... |
@@ -1,15 +1,15 @@ |
1 | 1 |
\usepackage[% |
2 |
- shash={a9bf28f}, |
|
3 |
- lhash={a9bf28f50043829b5e85a9b2c8e2c80638d2ed4b}, |
|
4 |
- authname={ramon diaz-uriarte (at Phelsuma)}, |
|
2 |
+ shash={c337f5f}, |
|
3 |
+ lhash={c337f5f9976dd824b49015eca92e177b9e971414}, |
|
4 |
+ authname={Ramon, vbox}, |
|
5 | 5 |
authemail={rdiaz02@gmail.com}, |
6 | 6 |
authsdate={2022-10-13}, |
7 |
- authidate={2022-10-13 14:42:33 +0200}, |
|
8 |
- authudate={1665664953}, |
|
9 |
- commname={ramon diaz-uriarte (at Phelsuma)}, |
|
7 |
+ authidate={2022-10-13 11:53:57 -0700}, |
|
8 |
+ authudate={1665687237}, |
|
9 |
+ commname={Ramon, vbox}, |
|
10 | 10 |
commemail={rdiaz02@gmail.com}, |
11 | 11 |
commsdate={2022-10-13}, |
12 |
- commidate={2022-10-13 14:42:33 +0200}, |
|
13 |
- commudate={1665664953}, |
|
14 |
- refnames={ (HEAD -> master)} |
|
12 |
+ commidate={2022-10-13 11:53:57 -0700}, |
|
13 |
+ commudate={1665687237}, |
|
14 |
+ refnames={ (HEAD -> master, origin/master, origin/HEAD)} |
|
15 | 15 |
]{gitsetinfo} |
16 | 16 |
\ No newline at end of file |