Browse code

v. 2.99.3

ramon diaz-uriarte (at Phelsuma) authored on 13/12/2020 14:35:47
Showing47 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: 2.99.2
5
-Date: 2020-12-11
4
+Version: 2.99.3
5
+Date: 2020-12-13
6 6
 Authors@R: c(
7 7
 	      person("Ramon", "Diaz-Uriarte", role = c("aut", "cre"),	
8 8
  	   		     email = "rdiaz02@gmail.com"),
... ...
@@ -2470,7 +2470,7 @@ nr_oncoSimul.internal <- function(rFE,
2470 2470
 
2471 2471
     if(typeFitness %in% c("bozic1", "bozic2")) {
2472 2472
         if(nrow(rFE$fitnessLandscape_df) > 0)
2473
-            warning("Bozic model passing a fitness landscape will not work",
2473
+            warning("Bozic model passing a fitness landscape most likely will not work",
2474 2474
                     " for now.")
2475 2475
         ## FIXME: bozic and fitness landscape
2476 2476
         ## the issue is that in the C++ code we directly do
... ...
@@ -2,7 +2,7 @@ citHeader("If you use OncoSimulR, please cite the OncoSimulR Bioinformatics pape
2 2
           " OncoSimulR has been used in three large",
3 3
           " comparative studies of methods to infer restrictions in",
4 4
           " the order of accumulation of mutations (cancer progression models)",
5
-          " published in Bioinformatics and BMC Bioinformatics; you might want to cite those too,",
5
+          " published in PLoS Computational Biology, Bioinformatics and BMC Bioinformatics; you might want to cite those too,",
6 6
           " if appropriate, such as when referring to using evolutionary simulations",
7 7
           " to assess oncogenetic tree/cancer progression methods performance.")
8 8
 
... ...
@@ -25,6 +25,21 @@ citEntry(entry="Article",
25 25
 
26 26
 
27 27
 
28
+citEntry(entry = "Article",
29
+	author = "R Diaz-Uriarte and C Vasallo",
30
+	title = "Every which way? On predicting tumor evolution using cancer progression models",
31
+	journal = "PLoS Computational Biology",
32
+	year = "2019",
33
+        volume = "15",
34
+        number = "8",
35
+	doi = "10.1371/journal.pcbi.100724610.1101/371039",
36
+	URL = "https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1007246",
37
+        textVersion = paste("R Diaz-Uriarte and C. Vasallo.",
38
+                            "Every which way? On predicting tumor evolution using cancer progression models",
39
+                            "2019",
40
+                            "PLoS Computational Biology",
41
+                            "https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1007246")
42
+)
28 43
 
29 44
 
30 45
 
... ...
@@ -60,16 +75,3 @@ citEntry(entry="Article",
60 75
 )
61 76
 
62 77
 
63
-citEntry(entry = "Article",
64
-	author = "R Diaz-Uriarte and C Vasallo",
65
-	title = "Every which way? On predicting tumor evolution using cancer progression models",
66
-	journal = "bioRxiv",
67
-	year = "2018",
68
-	doi = "10.1101/371039",
69
-	URL = "https://www.biorxiv.org/content/early/2018/11/20/371039",
70
-        textVersion = paste("R Diaz-Uriarte and C. Vasallo.",
71
-                            "Every which way? On predicting tumor evolution using cancer progression models",
72
-                            "2018",
73
-                            "bioRxiv",
74
-                            "https://www.biorxiv.org/content/early/2018/11/20/371039")
75
-)
... ...
@@ -1,3 +1,9 @@
1
+Changes in version 2.99.3 (2020-12-13):
2
+	- Remove unnecessary (and cluttering) output and irrelevant
3
+	warnings when running tests.
4
+	- Decrease execution time of longer running examples in man (Rd) files.
5
+	- Decrease time of vignette.
6
+	
1 7
 Changes in version 2.99.2 (2020-12-11):
2 8
 	- Failed on test on Mac.
3 9
 
... ...
@@ -168,7 +168,13 @@ pancr <- allFitnessEffects(data.frame(parent = c("Root", rep("KRAS", 4), "SMAD4"
168 168
 
169 169
 
170 170
 pancr1 <- oncoSimulIndiv(pancr, model = "Exp")
171
-pancr8 <- oncoSimulPop(8, pancr, model = "Exp",
171
+
172
+RNGkind("L'Ecuyer-CMRG")
173
+set.seed(3)
174
+pancr8 <- oncoSimulPop(3, pancr, model = "Exp",
175
+                       finalTime = 600,
176
+                       onlyCancer = TRUE,
177
+                       seed = NULL,
172 178
                        mc.cores = 2)
173 179
 
174 180
 POM(pancr1)
... ...
@@ -22,11 +22,12 @@ mcfLs simulation from the vignette
22 22
 
23 23
 
24 24
 \examples{
25
+\dontrun{
25 26
 data(mcfLs)
26 27
 
27 28
 plot(mcfLs, addtot = TRUE, lwdClone = 0.9, log = "")
28 29
 summary(mcfLs)
29
-
30
+}
30 31
 }
31 32
 \keyword{datasets}
32 33
 
... ...
@@ -937,11 +937,11 @@ p2 <- oncoSimulSample(4, p701)
937 937
 
938 938
 
939 939
 
940
-#### A model similar to the one in McFarland. We use 2070 genes.
941
-
940
+#### A model similar to the one in McFarland. We use 270 genes.
941
+t1 <- Sys.time()
942 942
 set.seed(456)
943 943
 nd <- 70
944
-np <- 2000
944
+np <- 200
945 945
 s <- 0.1
946 946
 sp <- 1e-3
947 947
 spp <- -sp/(1 + sp)
... ...
@@ -1017,34 +1017,30 @@ pancr <- allFitnessEffects(data.frame(parent = c("Root", rep("KRAS", 4), "SMAD4"
1017 1017
 plot(pancr)
1018 1018
 
1019 1019
 ### Use an exponential growth model
1020
+(pancr1 <- oncoSimulIndiv(pancr, model = "Exp"))
1020 1021
 
1021
-pancr1 <- oncoSimulIndiv(pancr, model = "Exp")
1022
-pancr1
1023 1022
 summary(pancr1)
1024 1023
 plot(pancr1)
1025
-pancr1$GenotypesLabels
1026
-
1027 1024
 
1028 1025
 ## Pop and Sample
1029
-pancrPop <- oncoSimulPop(4,
1026
+pancrPop <- oncoSimulPop(2,
1030 1027
                          pancr,
1031 1028
                          keepEvery = 10,
1032 1029
                          mc.cores = 2)
1033 1030
 summary(pancrPop)
1034
-pancrSPop <- samplePop(pancrPop)
1035
-pancrSPop
1031
+(pancrSPop <- samplePop(pancrPop))
1036 1032
 
1037
-pancrSamp <- oncoSimulSample(2, pancr)
1038
-pancrSamp
1039 1033
 
1034
+(pancrSamp <- oncoSimulSample(2, pancr))
1040 1035
 
1036
+\dontrun{
1041 1037
 ## Using gene-specific mutation rates
1042 1038
 muv <- c("U" = 1e-3, "z" = 1e-7, "e" = 1e-6, "m" = 1e-5, "D" = 1e-4)
1043 1039
 ni <- rep(0.01, 5)
1044 1040
 names(ni) <- names(muv)
1045 1041
 femuv <- allFitnessEffects(noIntGenes = ni)
1046 1042
 oncoSimulIndiv(femuv, mu = muv)
1047
-
1043
+}
1048 1044
 
1049 1045
 #########Frequency dependent fitness examples
1050 1046
 
... ...
@@ -1053,20 +1049,22 @@ oncoSimulIndiv(femuv, mu = muv)
1053 1049
 genofit <- data.frame(A = c(0, 1, 0, 1),
1054 1050
                       B = c(0, 0, 1, 1),
1055 1051
                       Fitness = c("3 + 5*f_",
1056
-                                  "3 + 5*(f_ + f_1)",
1057
-                                  "3 + 5*(f_ + f_2)",
1058
-                                  "5 + 6*(f_ + f_1_2)"))
1052
+                                  "3 + 5*(f_ + f_A)",
1053
+                                  "3 + 5*(f_ + f_B)",
1054
+                                  "5 + 6*(f_ + f_A_B)"))
1059 1055
 
1060 1056
 afe <- allFitnessEffects(genotFitness = genofit,
1061
-                         frequencyDependentFitness = TRUE, 
1062
-                         frequencyType = "rel")
1057
+                         frequencyDependentFitness = TRUE)
1063 1058
 
1059
+## Use gene-specific mutation rates and start the simulation from
1060
+## 5000 WT and 1000 A mutants.
1064 1061
 osi <- oncoSimulIndiv(afe,
1065 1062
                       model = "McFL",
1066 1063
                       onlyCancer = FALSE,
1067
-                      finalTime = 5000,
1068
-                      mu = 1e-6,
1069
-                      initSize = 5000,
1064
+                      finalTime = 50,
1065
+                      mu = c("A" = 1e-6, B = 1e-8),
1066
+                      initMutant = c("WT", "A"),
1067
+                      initSize = c(5000, 1000),
1070 1068
                       keepPhylog = FALSE,
1071 1069
                       seed = NULL,
1072 1070
                       errorHitMaxTries = FALSE,
... ...
@@ -1075,6 +1073,9 @@ osi
1075 1073
 
1076 1074
 plot(osi, show = "genotypes", type = "line")
1077 1075
 
1076
+
1077
+t2 <- Sys.time()
1078
+
1078 1079
 \dontrun{
1079 1080
 ## This can be slow
1080 1081
 osp <- oncoSimulPop(5,
... ...
@@ -1093,6 +1094,8 @@ sp
1093 1094
 
1094 1095
 ## A little bit more complex example situation. WT favours clones A and B. A and
1095 1096
 ## B compete with each other. Presence of A and B favours clone A, B.
1097
+\dontrun{
1098
+## This can be slow
1096 1099
 
1097 1100
 genofit <- data.frame(A = c(0, 1, 0, 1),
1098 1101
                       B = c(0, 0, 1, 1),
... ...
@@ -1108,7 +1111,7 @@ afe <- allFitnessEffects(genotFitness = genofit,
1108 1111
 osi <- oncoSimulIndiv(afe,
1109 1112
                       model = "McFL",
1110 1113
                       onlyCancer = FALSE,
1111
-                      finalTime = 5000,
1114
+                      finalTime = 200,
1112 1115
                       mu = 1e-6,
1113 1116
                       initSize = 5000,
1114 1117
                       keepPhylog = FALSE,
... ...
@@ -1118,7 +1121,7 @@ osi <- oncoSimulIndiv(afe,
1118 1121
 osi
1119 1122
 
1120 1123
 plot(osi, show = "genotypes", type = "line")
1121
-
1124
+}
1122 1125
 \dontrun{
1123 1126
 ## This can be slow
1124 1127
 osp <- oncoSimulPop(5,
... ...
@@ -324,6 +324,7 @@
324 324
   \code{\link{oncoSimulIndiv}}
325 325
 }
326 326
 \examples{
327
+\dontrun{
327 328
 data(examplePosets)
328 329
 p701 <- examplePosets[["p701"]]
329 330
 
... ...
@@ -350,10 +351,11 @@ plot(p1, ask = FALSE)
350 351
 
351 352
 ## Stacked; we cannot log here, and harder to see patterns
352 353
 plot(p1, ask = FALSE, type = "stacked")
353
-
354
+}
354 355
 
355 356
 ## Show individual genotypes and drivers for an
356 357
 ## epistasis case with at most eight genotypes
358
+set.seed(1) 
357 359
 
358 360
 sa <- 0.1
359 361
 sb <- -0.2
... ...
@@ -376,12 +378,17 @@ e1 <- oncoSimulIndiv(sv2, model = "McFL",
376 378
                      sampleEvery = 0.02,
377 379
                      keepEvery = 1,
378 380
                      initSize = 2000,
379
-                     finalTime = 3000,
381
+                     finalTime = 2000,
382
+                     seed = NULL,
380 383
                      onlyCancer = FALSE)
381 384
 
385
+
382 386
 ## Drivers and clones
383 387
 plot(e1, show = "drivers")
384 388
 
389
+## Stack
390
+plot(e1, type = "stacked")
391
+
385 392
 ## Make genotypes explicit
386 393
 plot(e1, show = "genotypes")
387 394
 
... ...
@@ -314,11 +314,6 @@ MAGELLAN web site: \url{http://wwwabi.snv.jussieu.fr/public/Magellan/}
314 314
 ## plotting and simulating an oncogenetic trajectory
315 315
 
316 316
 
317
-r1 <- rfitness(4)
318
-plot(r1)
319
-oncoSimulIndiv(allFitnessEffects(genotFitness = r1))
320
-
321
-
322 317
 ## NK model
323 318
 rnk <- rfitness(5, K = 3, model = "NK")
324 319
 plot(rnk)
... ...
@@ -328,6 +323,8 @@ oncoSimulIndiv(allFitnessEffects(genotFitness = rnk))
328 323
 radd <- rfitness(4, model = "Additive", mu = 0.2, sd = 0.5)
329 324
 plot(radd)
330 325
 
326
+
327
+\dontrun{
331 328
 ## Eggbox model
332 329
 regg = rfitness(g=4,model="Eggbox", e = 2, E=2.4)
333 330
 plot(regg)
... ...
@@ -342,7 +339,8 @@ plot(ris)
342 339
 rfull = rfitness(g=4, model="Full", i = 0.002, I=2, 
343 340
                  K = 2, r = TRUE,
344 341
                  p = 0.2, P = 0.3, o = 0.3, O = 1)
345
-plot(rfull)
342
+    plot(rfull)
343
+    }
346 344
 }
347 345
 \keyword{ datagen }
348 346
 
... ...
@@ -1855,11 +1855,11 @@ double mutationFromScratch(const std::vector<double>& mu,
1855 1855
 	Rcpp::Rcout << "mFS-messagesMPL: Mutable positions left: ";
1856 1856
 	if(mumult == 1.0) {
1857 1857
 	  // letters match codes for varmutrate
1858
-	  Rcpp::Rcout << "mFS-message-2-B:  constant mut rate"
1858
+	  Rcpp::Rcout << "mFS-message-2-B:  constant mut rate "
1859 1859
 		      << "no mutator and mutationPropGrowth "
1860 1860
 		      << ". birth rate = " << spP.birth << "\n";
1861 1861
 	} else {
1862
-	  Rcpp::Rcout << "mFS-message-2-C:  constant mut rate"
1862
+	  Rcpp::Rcout << "mFS-message-2-C:  constant mut rate "
1863 1863
 		      << " mutator and mutationPropGrowth "
1864 1864
 		      << ". birth rate = " << spP.birth
1865 1865
 		      << ". mumult = " << mumult << "\n";
... ...
@@ -1876,7 +1876,7 @@ double mutationFromScratch(const std::vector<double>& mu,
1876 1876
 	Rcpp::Rcout << "mFS-messagesMPL: Mutable positions left: ";
1877 1877
 	if(mumult == 1.0) {
1878 1878
 	  // letters match codes for varmutrate
1879
-	  Rcpp::Rcout << "mFS-message-2-A:  constant mut rate"
1879
+	  Rcpp::Rcout << "mFS-message-2-A:  constant mut rate "
1880 1880
 		      << "no mutator and no mutationPropGrowth ";
1881 1881
 	} else {
1882 1882
 	  Rcpp::Rcout << "mFS-message-2-D:  constant mut rate"
... ...
@@ -1917,19 +1917,19 @@ double mutationFromScratch(const std::vector<double>& mu,
1917 1917
     if(tmp <= dummyMutationRate) {
1918 1918
       Rcpp::Rcout << "mFS-messagesMPL: Mutable positions left: ";
1919 1919
       if( (mumult == 1.0) && (!mutationPropGrowth) ) {
1920
-	Rcpp::Rcout << "mFS-message-5-A: variable mut rate"
1920
+	Rcpp::Rcout << "mFS-message-5-A: variable mut rate "
1921 1921
 		    << "no mutator and no mutationPropGrowth\n ";
1922 1922
       } else if ((mumult == 1.0) && (mutationPropGrowth) ) {
1923
-	Rcpp::Rcout << "mFS-message-5-B:  variable mut rate"
1923
+	Rcpp::Rcout << "mFS-message-5-B:  variable mut rate "
1924 1924
 		    << "no mutator and mutationPropGrowth "
1925 1925
 		    << ". birth rate = " << spP.birth << "\n";
1926 1926
       } else if ( (mumult != 1.0) && (mutationPropGrowth) ) {
1927
-	Rcpp::Rcout << "mFS-message-5-C:  variable mut rate"
1927
+	Rcpp::Rcout << "mFS-message-5-C:  variable mut rate "
1928 1928
 		    << "mutator and mutationPropGrowth "
1929 1929
 		    << ". birth rate = " << spP.birth
1930 1930
 		    << ". mumult = " << mumult << "\n";
1931 1931
       } else if ( (mumult != 1.0) && (!mutationPropGrowth) ) {
1932
-	Rcpp::Rcout << "mFS-message-5-D:  variable mut rate"
1932
+	Rcpp::Rcout << "mFS-message-5-D:  variable mut rate "
1933 1933
 		    << "mutator and no mutationPropGrowth "
1934 1934
 		    << ". mumult = " << mumult << "\n";
1935 1935
       } else {
... ...
@@ -1,5 +1,5 @@
1 1
 inittime <- Sys.time()
2
-cat(paste("\n Starting FDF-small-fitness-specs", date(), "\n"))
2
+cat(paste("\n Starting FDF-letter-fitness-order", date(), "\n"))
3 3
 
4 4
 
5 5
 ## Testing fitness specs with missing genotypes and with letters too
... ...
@@ -25,11 +25,10 @@ test_that("We can run and equal with letters", {
25 25
     fg11 <- allFitnessEffects(genotFitness = g11, 
26 26
                               frequencyDependentFitness = TRUE)
27 27
 
28
-    ## FIXME
29 28
     ## So, what does spPopSizes refer to ?? that is ambiguous here. 
30 29
     ## It seems it is the Genotypes in the original Genotype spec.
31 30
     ## but they are the ones left in fg1$Genotype
32
-    ## Since we cannot now what was in g1, do not allow for this.
31
+    ## Since we cannot now what was in g1, emits warnings, that we silence here
33 32
     efg1 <- suppressWarnings(evalAllGenotypes(fg1, spPopSizes = c(9, 2, 6)))
34 33
     efg11 <- suppressWarnings(evalAllGenotypes(fg11, spPopSizes = c(9, 2, 6)))
35 34
 
... ...
@@ -113,8 +112,8 @@ test_that("We can run and equal in different order" , {
113 112
                               frequencyDependentFitness = TRUE)
114 113
 
115 114
     ## spPopSizes are for genotypes AT, A, B, AB
116
-    ofg2 <- evalAllGenotypes(fg2, spPopSizes = c(9, 2, 6, 3))
117
-    ofg2b <- evalAllGenotypes(fg2b, spPopSizes = c(9, 2, 6, 3))
115
+    ofg2 <- suppressWarnings(evalAllGenotypes(fg2, spPopSizes = c(9, 2, 6, 3)))
116
+    ofg2b <- suppressWarnings(evalAllGenotypes(fg2b, spPopSizes = c(9, 2, 6, 3)))
118 117
     ## Are they correct?
119 118
     expect_identical(ofg2, ofg2b)
120 119
     out_expec_ofg2 <- c(1, 1 + 2 * 3 , 1 + 2 * 2, 1 + 2 * 6)
... ...
@@ -132,12 +131,11 @@ test_that("Breaks as it should", {
132 131
                                   "n_1",
133 132
                                   "n_2"
134 133
                                   ))
135
-    adf1 <- allFitnessEffects(genotFitness = df1,
136
-                              frequencyDependentFitness = TRUE)
137
-    (adf1)
138
-    expect_error(evalAllGenotypes(adf1, spPopSizes = 1:6))
134
+    suppressMessages(adf1 <- allFitnessEffects(genotFitness = df1,
135
+                              frequencyDependentFitness = TRUE))
136
+    ## (adf1)
137
+    expect_error(suppressWarnings(evalAllGenotypes(adf1, spPopSizes = 1:6)))
139 138
     ## Breaks in old and new: n_2_3
140
-
141 139
     df1 <- data.frame(Genotype = c("WT", "B", "C", "A", "B, A", "C, A"),
142 140
                   Fitness = c("1",
143 141
                               "f_1_3", ## BA
... ...
@@ -146,12 +144,12 @@ test_that("Breaks as it should", {
146 144
                               "f_1",
147 145
                               "f_2"
148 146
                               ))
149
-    adf1 <- allFitnessEffects(genotFitness = df1,
150
-                              frequencyDependentFitness = TRUE)
147
+    suppressMessages(adf1 <- allFitnessEffects(genotFitness = df1,
148
+                              frequencyDependentFitness = TRUE))
151 149
     
152
-    (adf1)
153
-    expect_error(evalAllGenotypes(adf1, spPopSizes = 1:6)) ## Breaks in old
154
-                                                       ## and new: f_2_3
150
+    ## (adf1)
151
+    expect_error(suppressWarnings(evalAllGenotypes(adf1, spPopSizes = 1:6))) ## Breaks in old
152
+    ## and new: f_2_3
155 153
 })
156 154
 
157 155
 
... ...
@@ -169,7 +167,7 @@ test_that("eval fitness gives wrong answer, as misspecified", {
169 167
                               frequencyDependentFitness = TRUE)
170 168
 
171 169
     (adf2)
172
-    gg <- evalAllGenotypes(adf2, spPopSizes = 1:6)
170
+    suppressWarnings(gg <- evalAllGenotypes(adf2, spPopSizes = 1:6))
173 171
     expect_equal(gg[gg$Genotype == "B", "Fitness"], 6) 
174 172
     ## Wrong: gives for B fitness of using CA, not BA (both old and new versions)
175 173
 })
... ...
@@ -10,12 +10,14 @@ test_that("Exercise LOD and POM code", {
10 10
                                       s = 0.05,
11 11
                                       sh = -0.3,
12 12
                                       typeDep = "MN"))
13
+    null <- capture.output({
13 14
     pancr1 <- oncoSimulIndiv(pancr, model = "Exp", keepPhylog = TRUE)
14 15
     pancr8 <- oncoSimulPop(6, pancr, model = "Exp", keepPhylog = TRUE,
15 16
                            detectionSize = 1e5,
16 17
                            mc.cores = 2)
18
+    })
17 19
     lop8 <- LOD(pancr8)
18
-    OncoSimulR:::LOD_as_path(lop8)
20
+    null <- OncoSimulR:::LOD_as_path(lop8)
19 21
     expect_true(inherits(POM(pancr1), "character"))
20 22
     require(igraph)
21 23
     ## expect_true(inherits(LOD(pancr1, strict = FALSE)$all_paths[[1]], "igraph.vs"))
... ...
@@ -31,6 +33,7 @@ test_that("Exercise LOD and POM code", {
31 33
                  "Object must be a list", fixed = TRUE)
32 34
     expect_error(diversityLOD(LOD(pancr1)),
33 35
                  "Object must be a list", fixed = TRUE)
36
+    null <- capture.output(
34 37
     pancr88 <- oncoSimulPop(8, pancr, model = "McFL",
35 38
                            keepPhylog = TRUE,
36 39
                            finalTime = 0.01,
... ...
@@ -38,10 +41,12 @@ test_that("Exercise LOD and POM code", {
38 41
                            mc.cores = 2,
39 42
                            max.wall.time = 0.01,
40 43
                            detectionSize = 1e6)
44
+    )
41 45
     expect_warning(LOD(pancr88),
42 46
                    "Missing needed components.", fixed = TRUE)
43 47
     expect_warning(POM(pancr88),
44 48
                    "Missing needed components.", fixed = TRUE)
49
+    null <- capture.output(
45 50
     pancr8 <- suppressWarnings(suppressMessages(oncoSimulPop(20,
46 51
                                                              pancr, model = "McFL",
47 52
                                             keepPhylog = TRUE,
... ...
@@ -53,11 +58,13 @@ test_that("Exercise LOD and POM code", {
53 58
                                             mc.cores = 2,
54 59
                                             mutationPropGrowth = FALSE,
55 60
                                             initSize = 10)))
61
+    )
56 62
     lop8 <- suppressWarnings(LOD(pancr8))
57 63
     lop8b <- suppressWarnings(LOD(pancr8))
58
-    OncoSimulR:::LOD_as_path(lop8[[1]])
59
-    OncoSimulR:::LOD_as_path(lop8)
64
+    null <- OncoSimulR:::LOD_as_path(lop8[[1]])
65
+    null <- OncoSimulR:::LOD_as_path(lop8)
60 66
     gg <- allFitnessEffects(noIntGenes = rep(-.9, 100))
67
+    null <- capture.output(
61 68
     pancr22 <- oncoSimulPop(6, gg,
62 69
                             model = "Exp",
63 70
                             keepPhylog = TRUE,
... ...
@@ -67,25 +74,28 @@ test_that("Exercise LOD and POM code", {
67 74
                             mu = 1e-2,
68 75
                             mc.cores = 2,
69 76
                             finalTime = 2.5)
77
+    )
70 78
     lp22 <- LOD(pancr22)
71 79
     ## There is like soooo remote chance this will fail
72 80
     ## and the previous exercises the code anyway.
73 81
     ## expect_true(any(unlist(lp22) %in% "WT_is_end"))
74 82
 })
75
-date()
83
+## date()
76 84
 
77 85
 test_that("Warnings when no descendants",  {
78 86
     ## cannot move from wt with this fitness landscape
79 87
     m1 <- cbind(A = c(0, 1), B = c(0, 1), Fitness = c(1, 1e-8))
88
+    null <- capture.output({
80 89
     s1 <- oncoSimulIndiv(allFitnessEffects(genotFitness = m1),
81 90
                          mu = 1e-14, detectionSize = 1, initSize = 100,
82 91
                          keepPhylog = TRUE)
83
-    expect_warning(LOD(s1),
84
-                   "LOD structure has 0 rows:",
85
-                   fixed = TRUE)
86 92
     s2 <- oncoSimulIndiv(allFitnessEffects(genotFitness = m1),
87 93
                          mu = 1e-14, detectionSize = 1, initSize = 100,
88 94
                          keepPhylog = FALSE)
95
+    })
96
+    expect_warning(LOD(s1),
97
+                   "LOD structure has 0 rows:",
98
+                   fixed = TRUE)
89 99
     expect_warning(LOD(s2),
90 100
                    "LOD structure has 0 rows:",
91 101
                    fixed = TRUE)
... ...
@@ -153,8 +163,8 @@ test_that("Warnings when no descendants",  {
153 163
 
154 164
 set.seed(NULL)
155 165
 si <- runif(1, 1, 1e9)
156
-print(si)
157
-date()
166
+# print(si)
167
+## date()
158 168
 test_that("LOD, strict, same as would be obtained from full structure, seed", {
159 169
     ## we are testing in an extremely paranoid way, against a
160 170
     ## former version
... ...
@@ -173,7 +183,7 @@ test_that("LOD, strict, same as would be obtained from full structure, seed", {
173 183
                              initSize = 10, detectionSize = 1e5,
174 184
                              keepPhylog = TRUE, mu = 5e-3)
175 185
         lods <- LOD(s7)
176
-        print(lods)
186
+        null <- capture.output(print(lods))
177 187
         loda <- OncoSimulR:::LOD.oncosimul2_pre_2.9.2(s7b, strict = FALSE)
178 188
         ## lods should be among the loda
179 189
         if(!is.null(s7$pops.by.time)) {
... ...
@@ -190,12 +200,12 @@ test_that("LOD, strict, same as would be obtained from full structure, seed", {
190 200
         }
191 201
     }
192 202
 })
193
-date()
203
+## date()
194 204
 
195 205
 set.seed(NULL)
196 206
 si <- runif(1, 1, 1e9)
197
-print(si)
198
-date()
207
+## print(si)
208
+## date()
199 209
 test_that("LOD, strict, same as would be obtained from full structure, with initMutant", {
200 210
     n <- 10
201 211
     ## with initMutant
... ...
@@ -213,7 +223,7 @@ test_that("LOD, strict, same as would be obtained from full structure, with init
213 223
                               keepPhylog = TRUE, mu = 5e-3,
214 224
                               initMutant = c("C"))
215 225
         lods <- LOD(s7)
216
-        print(lods)
226
+        null <- capture.output(print(lods))
217 227
         attributes(lods) <- NULL
218 228
         loda <- OncoSimulR:::LOD.oncosimul2_pre_2.9.2(s7b, strict = FALSE)
219 229
         ## we need this because o.w. the old output it ain't an igraph
... ...
@@ -248,11 +258,11 @@ test_that("LOD, strict, same as would be obtained from full structure, with init
248 258
     }
249 259
     
250 260
 })
251
-date()
261
+## date()
252 262
 set.seed(NULL)
253 263
 
254 264
 
255
-date()
265
+## date()
256 266
 test_that("POM from C++ is the same as from the pops.by.time object", {
257 267
     ## Must make sure keepEvery = sampleEvery or granularity of
258 268
     ## C++ can be larger
... ...
@@ -261,9 +271,10 @@ test_that("POM from C++ is the same as from the pops.by.time object", {
261 271
         ng <- 6
262 272
         rxx <- rfitness(ng)
263 273
         rxx[sample(2:(ng + 1)), ng + 1] <- 1.5 ## make sure we get going
274
+        null <- capture.output(
264 275
         s7 <- oncoSimulIndiv(allFitnessEffects(genotFitness = rxx),
265 276
                              initSize = 1000, detectionSize = 1e6,
266
-                             mu = 1e-3)
277
+                             mu = 1e-3))
267 278
         pom <- OncoSimulR:::POM_pre_2.9.2(s7)
268 279
         if(!is.null(s7$pops.by.time) &&
269 280
            !any(apply(s7$pops.by.time[, -1], 1, function(x) length(which(x == max(x))) > 1)))
... ...
@@ -272,11 +283,12 @@ test_that("POM from C++ is the same as from the pops.by.time object", {
272 283
     ## with initMutant
273 284
     for(i in 1:n) {
274 285
         rxx <- rfitness(6)
275
-        rxx[3, 7] <- 1.5        
286
+        rxx[3, 7] <- 1.5
287
+        null <- capture.output(
276 288
         s7 <- oncoSimulIndiv(allFitnessEffects(genotFitness = rxx),
277 289
                              initSize = 1000, detectionSize = 1e6,
278 290
                              mu = 1e-3,
279
-                             initMutant = c("B"))
291
+                             initMutant = c("B")))
280 292
         pom <- OncoSimulR:::POM_pre_2.9.2(s7)
281 293
         ## if(!is.null(s7$pops.by.time)) {
282 294
         if(!is.null(s7$pops.by.time) &&
... ...
@@ -288,12 +300,13 @@ test_that("POM from C++ is the same as from the pops.by.time object", {
288 300
     for(i in 1:n) {
289 301
         rxx <- rfitness(6)
290 302
         rxx[3, 7] <- 1e-8
303
+        null <- capture.output(
291 304
         s7 <- oncoSimulIndiv(allFitnessEffects(genotFitness = rxx),
292 305
                              initSize = 10, detectionSize = 1e6,
293 306
                              mu = 1e-3,
294 307
                              max.num.tries = 3,
295 308
                              errorHitMaxTries = FALSE,
296
-                             initMutant = c("B"))
309
+                             initMutant = c("B")))
297 310
         pom <- OncoSimulR:::POM_pre_2.9.2(s7)
298 311
         if(!is.null(s7$pops.by.time) &&
299 312
            !any(apply(s7$pops.by.time[, -1, drop = FALSE], 1,
... ...
@@ -305,7 +318,7 @@ test_that("POM from C++ is the same as from the pops.by.time object", {
305 318
         }
306 319
     }
307 320
 })
308
-date()
321
+## date()
309 322
 
310 323
 
311 324
 
... ...
@@ -16,14 +16,16 @@ test_that("Assertion is correct when nothing returned",{
16 16
                                   "D" = "d1, d2"),
17 17
                             drvNames = c("d1", "d2", "f1", "f2", "f3"))
18 18
     set.seed(13)
19
-    expect_message(ou <- oncoSimulSample(1, 
19
+    suppressWarnings(expect_message(ou <- oncoSimulSample(1, 
20 20
                                   oi,
21 21
                                   sampleEvery = 0.03,
22 22
                                   onlyCancer = FALSE,
23 23
                                   model = "Bozic",
24 24
                                   mutationPropGrowth = TRUE,
25 25
                                   seed = NULL),
26
-                  "Subjects by Genes", fixed = TRUE)
26
+                                  ## "Subjects by Genes",
27
+                                  "Successfully sampled 1 individuals",
28
+                                  fixed = TRUE))
27 29
 
28 30
 
29 31
 
... ...
@@ -38,14 +40,14 @@ test_that("Assertion is correct when nothing returned",{
38 40
                                   "D" = "d1, d2"),
39 41
                             drvNames = c("d1", "d2", "f1", "f2", "f3"))
40 42
     set.seed(13)
41
-    expect_message(ou2 <- oncoSimulSample(1, 
43
+    suppressWarnings(expect_message(ou2 <- oncoSimulSample(1, 
42 44
                     oi,
43 45
                     sampleEvery = 0.03,
44 46
                     onlyCancer = FALSE,
45 47
                     model = "Bozic",
46 48
                     mutationPropGrowth = TRUE,
47 49
                     seed = NULL),
48
-                  "Subjects by Genes", fixed = TRUE)
50
+                  "Subjects by Genes", fixed = TRUE))
49 51
 
50 52
 } )
51 53
 date()
... ...
@@ -68,8 +70,9 @@ test_that("driverCounts: a run that used to cause crashes", {
68 70
                             detectionSize = 5e6,
69 71
                             finalTime = 5, 
70 72
                             onlyCancer = FALSE)
71
-    cat("\n ... output from mue11\n")
72
-    print(mue11)
73
+    ## cat("\n ... output from mue11\n")
74
+    ## print(mue11)
75
+    expect_output(print(mue11), "Individual OncoSimul trajectory", fixed = TRUE)
73 76
 })
74 77
 
75 78
 set.seed(NULL)
... ...
@@ -12,17 +12,18 @@ RNGversion("3.6.3")
12 12
 test_that("Same output from magellan as before changing their C code", {
13 13
     set.seed(1)
14 14
     r9 <- rfitness(8)
15
-    options(digits = 5)
16
-    cat("\n r9 \n")
17
-    print(summary(r9[, "Fitness"]))
18
-    print(var(r9[, "Fitness"]))
19
-    cat("\n 10 runif \n")
20
-    print(runif(10))
15
+    ## options(digits = 5)
16
+    ## cat("\n r9 \n")
17
+    ## print(summary(r9[, "Fitness"]))
18
+    ## print(var(r9[, "Fitness"]))
19
+    ## cat("\n 10 runif \n")
20
+    ## print(runif(10))
21 21
     ## Anything that simulates from Magellan will not respect
22 22
     ## R's seed
23
-    s9s <- Magellan_stats(r9, verbose = TRUE)
24
-    s9l <- Magellan_stats(r9, short = FALSE, verbose = TRUE)
25
-
23
+    null <- capture.output({
24
+        s9s <- Magellan_stats(r9, verbose = TRUE)
25
+        s9l <- Magellan_stats(r9, short = FALSE, verbose = TRUE)
26
+    })
26 27
     s9s_compare <- structure(c(ngeno = 256, npeaks = 23, nsinks = 25, gamma = 0.094, gamma. = 0.089, 
27 28
                                r.s = 1.814, nchains = 12, nsteps = 26, nori = 21, depth = 2, 
28 29
                                magn = 0.361, sign = 0.339, rsign = 0.272, f.1. = 0.382, X.2. = 0.094, 
... ...
@@ -40,20 +41,20 @@ test_that("Same output from magellan as before changing their C code", {
40 41
                                opt_i.19 = 230, mProbOpt_19 = 0.152, opt_i.20 = 232, mProbOpt_20 = 0.025, 
41 42
                                opt_i.21 = 242, mProbOpt_21 = 0.014, opt_i.22 = 251, mProbOpt_22 = 0.021
42 43
                                ))
43
-    cat("\n s9s[21] and s9s_compare[21]\n")
44
-    print(s9s[21])
45
-    print(s9s_compare[21])
46
-    cat("\n where they differ\n")
47
-    print(which(s9s!=s9s_compare))
44
+    ## cat("\n s9s[21] and s9s_compare[21]\n")
45
+    ## print(s9s[21])
46
+    ## print(s9s_compare[21])
47
+    ## cat("\n where they differ\n")
48
+    ## print(which(s9s!=s9s_compare))
48 49
 
49
-    cat("\n name of binary\n")
50
-    print(OncoSimulR:::fl_statistics_binary())
50
+    ## cat("\n name of binary\n")
51
+    ## print(OncoSimulR:::fl_statistics_binary())
51 52
     
52
-    cat("\n s9s\n")
53
-    print(s9s)
53
+    ## cat("\n s9s\n")
54
+    ## print(s9s)
54 55
 
55
-    cat("\n s9s_compare\n")
56
-    print(s9s_compare)
56
+    ## cat("\n s9s_compare\n")
57
+    ## print(s9s_compare)
57 58
     
58 59
     s9l_compare <- structure(c("/* FL name */", "   coco", "", "/* Peaks/Sinks */", "   #genotypes: 256", 
59 60
                                "   #peaks: 23", "   #sinks: 25", "", "/* Epistasis types */", 
... ...
@@ -653,9 +654,9 @@ test_that("Same output from magellan as before changing their C code", {
653 654
                                )
654 655
                              )
655 656
     
656
-    cat("which differ")     
657
-    print(which(s9l_compare != s9l))
658
-    cat("done which differ")
657
+    ## cat("which differ")     
658
+    ## print(which(s9l_compare != s9l))
659
+    ## cat("done which differ")
659 660
     ## position 21 differs in Windoze and Mac
660 661
     expect_identical(s9s[-21], s9s_compare[-21])
661 662
     ## Go figure, a bunch of lines differ in Windows and Mac
... ...
@@ -25,7 +25,11 @@ test_that("Mutator genes missing from fitness", {
25 25
 })
26 26
 
27 27
 test_that("fit. mut. eff. values, long ex",  {
28
-  
28
+    ## Because of testthat's reluctance to behave sensibly
29
+    silent_expect_true <- function(x) {
30
+        expect_true(suppressWarnings(x))
31
+    }
32
+    
29 33
   r1 <- data.frame(Genotype = c("WT", "A", "B", "A, B"),
30 34
                    Fitness = c("max(3, 2*f_)",
31 35
                                "max(1.5, 3*(f_ + f_1))",
... ...
@@ -41,39 +45,39 @@ test_that("fit. mut. eff. values, long ex",  {
41 45
   
42 46
   mt <- allMutatorEffects(epistasis = c("A" = 1, "B" = 10))
43 47
   
44
-  expect_true(all.equal(target = evalGenotype("A", fe,
48
+  silent_expect_true(all.equal(target = evalGenotype("A", fe,
45 49
                                               spPopSizes = c(5000, 2500, 2500, 7500)), current = 1.5))
46 50
   
47
-  expect_true(all.equal(target = evalGenotype("B", fe,
51
+  silent_expect_true(all.equal(target = evalGenotype("B", fe,
48 52
                                               spPopSizes = c(5000, 2500, 2500, 7500)), current = 1.5))
49 53
   
50
-  expect_true(all.equal(target = round(
54
+  silent_expect_true(all.equal(target = round(
51 55
                                       evalGenotype("A, B", fe,
52 56
                                       spPopSizes = c(5000, 2500, 2500, 7500)), 2),
53 57
                         current = 7.71))
54 58
   
55 59
   set.seed(2)
56 60
   
57
-  expect_true(all.equal(target = evalGenotype("A", fe,
61
+  silent_expect_true(all.equal(target = evalGenotype("A", fe,
58 62
                                               spPopSizes = c(5000, 2500, 2500, 7500)), current = 1.5))
59 63
   
60
-  expect_true(all.equal(target = evalGenotype("B", fe,
64
+  silent_expect_true(all.equal(target = evalGenotype("B", fe,
61 65
                                               spPopSizes = c(5000, 2500, 2500, 7500)), current = 1.5))
62 66
   
63
-  expect_true(all.equal(target = round(
67
+  silent_expect_true(all.equal(target = round(
64 68
                                        evalGenotype("A, B", fe,
65 69
                                                     spPopSizes = c(5000, 2500, 2500, 7500)), 2),
66 70
                         current = 7.71))
67 71
   
68
-  expect_true(all.equal(target = evalGenotypeFitAndMut("A", fe, mt,
72
+  silent_expect_true(all.equal(target = evalGenotypeFitAndMut("A", fe, mt,
69 73
                                                        spPopSizes = c(5000, 2500, 2500, 7500)), 
70 74
                         current = c(1.5, 1.0)))
71 75
   
72
-  expect_true(all.equal(target = evalGenotypeFitAndMut("B", fe, mt,
76
+  silent_expect_true(all.equal(target = evalGenotypeFitAndMut("B", fe, mt,
73 77
                                                        spPopSizes = c(5000, 2500, 2500, 7500)), 
74 78
                         current = c(1.5, 10)))
75 79
   
76
-  expect_true(all.equal(target = round(
80
+  silent_expect_true(all.equal(target = round(
77 81
                                        evalGenotypeFitAndMut("A, B", fe, mt,
78 82
                                                              spPopSizes = c(5000, 2500, 2500, 7500)), 2),
79 83
                         current = c(7.71, 10)))
... ...
@@ -83,4 +87,4 @@ set.seed(NULL)
83 87
 
84 88
 cat(paste("\n Ending test.Z-mutatorFDF at", date(), "\n"))
85 89
 cat(paste("  Took ", round(difftime(Sys.time(), inittime, units = "secs"), 2), "\n\n"))
86
-rm(inittime)
87 90
\ No newline at end of file
91
+rm(inittime)
... ...
@@ -59,6 +59,7 @@ test_that("using old poset format, hitting wall time", {
59 59
     set.seed(1)
60 60
     data(examplePosets)
61 61
     p701 <- examplePosets[["p701"]]
62
+    null <- capture.output({
62 63
     pet <- oncoSimulIndiv(p701, sh = 0,
63 64
                           initSize = 1e2,
64 65
                           detectionSize = 5e8,
... ...
@@ -68,6 +69,7 @@ test_that("using old poset format, hitting wall time", {
68 69
                           max.wall.time = 0.0001,
69 70
                           onlyCancer = FALSE,
70 71
                           seed = NULL)
72
+    })
71 73
     expect_true(pet$HittedWallTime)
72 74
 })
73 75
 
... ...
@@ -77,7 +79,7 @@ test_that("using old poset format, verbose exercise iteration", {
77 79
     set.seed(1)
78 80
     data(examplePosets)
79 81
     p701 <- examplePosets[["p701"]]
80
-    ## st <- capture.output(
82
+    st <- capture.output(
81 83
         p1 <- oncoSimulIndiv(p701, sh = 0,
82 84
                              initSize = 1e4,
83 85
                              detectionSize = 1e7,
... ...
@@ -87,7 +89,7 @@ test_that("using old poset format, verbose exercise iteration", {
87 89
                              onlyCancer = FALSE,
88 90
                              verbosity = 2,
89 91
                              seed = NULL)
90
-    ## )
92
+    )
91 93
     expect_output(print(p1), "Individual OncoSimul", fixed = TRUE)
92 94
 })
93 95
 
... ...
@@ -21,10 +21,10 @@ test_that("testing output classes", {
21 21
   osi <- oncoSimulIndiv(afe, 
22 22
                         model = "McFL", 
23 23
                         onlyCancer = FALSE, 
24
-                        finalTime = 5000, 
24
+                        finalTime = 20, 
25 25
                         verbosity = 0, 
26 26
                         mu = 1e-6,
27
-                        initSize = 500, 
27
+                        initSize = 5000, 
28 28
                         keepPhylog = FALSE,
29 29
                         seed = NULL, 
30 30
                         errorHitMaxTries = TRUE, 
... ...
@@ -70,7 +70,7 @@ test_that("testing performance", {
70 70
   
71 71
   set.seed(1)
72 72
   
73
-  osi <- oncoSimulIndiv(afe, 
73
+  null <- capture.output(osi <- oncoSimulIndiv(afe, 
74 74
                         model = "Exp", 
75 75
                         onlyCancer = FALSE, 
76 76
                         finalTime = 5000, 
... ...
@@ -80,11 +80,11 @@ test_that("testing performance", {
80 80
                         keepPhylog = FALSE,
81 81
                         seed = NULL, 
82 82
                         errorHitMaxTries = TRUE, 
83
-                        errorHitWallTime = TRUE)
83
+                        errorHitWallTime = TRUE))
84 84
   
85 85
   set.seed(1)
86 86
   
87
-  osi_ra <- oncoSimulIndiv(afe_ra, 
87
+  null <- capture.output(osi_ra <- oncoSimulIndiv(afe_ra, 
88 88
                         model = "Exp", 
89 89
                         onlyCancer = FALSE, 
90 90
                         finalTime = 5000, 
... ...
@@ -94,7 +94,7 @@ test_that("testing performance", {
94 94
                         keepPhylog = FALSE,
95 95
                         seed = NULL, 
96 96
                         errorHitMaxTries = TRUE, 
97
-                        errorHitWallTime = TRUE)
97
+                        errorHitWallTime = TRUE))
98 98
   
99 99
   expect_output(print(osi),
100 100
                 "Individual OncoSimul trajectory", fixed = TRUE)
... ...
@@ -137,7 +137,7 @@ test_that("testing Bozic failure", {
137 137
   
138 138
   set.seed(1)
139 139
   
140
-  st <- capture.output(osi <- oncoSimulIndiv(afe, 
140
+  st <- capture.output(suppressWarnings(osi <- oncoSimulIndiv(afe, 
141 141
                                              model = "Bozic", 
142 142
                                              onlyCancer = FALSE, 
143 143
                                              finalTime = 5000, 
... ...
@@ -147,7 +147,7 @@ test_that("testing Bozic failure", {
147 147
                                              keepPhylog = FALSE,
148 148
                                              seed = NULL, 
149 149
                                              errorHitMaxTries = TRUE, 
150
-                                             errorHitWallTime = TRUE))
150
+                                             errorHitWallTime = TRUE)))
151 151
   expect_true(st[22] == " Unrecoverable exception: Algo 2: retval not finite. Aborting. ")
152 152
 
153 153
 })
... ...
@@ -62,12 +62,12 @@ for(i in 1:length(examplePosets)) {
62 62
         test_that(paste("Sampling only last same for ",
63 63
                         paste(names(ffs), collapse = " ")), {
64 64
                             ## comment next cat later
65
-                            cat(paste("\n ",
66
-                                      " Seed = ", s1, " ",
67
-                                      paste(names(ffs), collapse = " "),
68
-                                      ". Poset = ",
69
-                                      attributes(Poset)$namePoset,
70
-                                      "\n"))
65
+                            ## cat(paste("\n ",
66
+                            ##           " Seed = ", s1, " ",
67
+                            ##           paste(names(ffs), collapse = " "),
68
+                            ##           ". Poset = ",
69
+                            ##           attributes(Poset)$namePoset,
70
+                            ##           "\n"))
71 71
                             
72 72
                             bb <- runBothFuncts(s1, Poset, ffs)
73 73
                             b1 <- bb$all
74 74
new file mode 100644
... ...
@@ -0,0 +1,14 @@
1
+inittime <- Sys.time()
2
+cat(paste("\n Dummy empty test ", date(), "\n"))
3
+
4
+## The default reporter will not show the number
5
+## of tests run unless there is a failure or a warning
6
+## But I want to see how many pass (and skip) tests I get.
7
+## So: create one dummy skip test and one warning to force full reporting.
8
+test_that("Dummy empty (skip) test", {
9
+    six <- 2 * 3
10
+})
11
+
12
+test_that("Dummy warning to force full reporting" , {
13
+    warning("Dummy warning")
14
+})
... ...
@@ -10,16 +10,16 @@ test_that("We obtain same accessible genotypes with different functions plus gen
10 10
 
11 11
             ajm <- OncoSimulR:::genot_to_adj_mat(rtmp)
12 12
             ajmr <- OncoSimulR:::genot_to_adj_mat_R(rtmp)
13
-            stopifnot(all.equal(ajm, ajmr))
13
+            expect_equal(ajm, ajmr)
14 14
             
15 15
             a1 <- OncoSimulR:::faster_accessible_genotypes_R(rtmp, 0)
16 16
             a2 <- colnames(OncoSimulR:::filter_inaccessible(ajm, 0))
17 17
             a3 <- OncoSimulR:::wrap_accessibleGenotypes(rtmp, 0)
18 18
             a4 <- OncoSimulR:::wrap_accessibleGenotypes_former(rtmp, 0)
19 19
 
20
-            stopifnot(identical(as.integer(a1), a3))
21
-            stopifnot(identical(as.integer(a2), a3))
22
-            stopifnot(all(a3 ==  a4))
20
+            expect_identical(as.integer(a1), a3)
21
+            expect_identical(as.integer(a2), a3)
22
+            expect_true(all(a3 ==  a4))
23 23
 
24 24
         }
25 25
     } 
... ...
@@ -930,6 +930,7 @@ test_that("we are exercising evalGenotype with a comma, echo, and proNeg", {
930 930
                                   c("Root" = "Root",
931 931
                                     "F" = "f1, f2, f3",
932 932
                                     "D" = "d1, d2") )
933
+    null <- capture.output({
933 934
     expect_equal(evalGenotype("d1 , d2, f3", ofe2, verbose = TRUE, echo = TRUE),
934 935
                  1.4)
935 936
     expect_equal(evalGenotype("f3 , d1 , d2", ofe2, verbose = TRUE, echo = TRUE),
... ...
@@ -937,6 +938,7 @@ test_that("we are exercising evalGenotype with a comma, echo, and proNeg", {
937 938
     expect_equal(evalGenotype("f3 , d1 , d2", ofe2, verbose = TRUE,
938 939
                               echo = TRUE, model = "Bozic"),
939 940
                  1.3)
941
+    })
940 942
 })
941 943
 
942 944
 
... ...
@@ -957,6 +959,7 @@ test_that("We limit number of genotypes in eval", {
957 959
 ## Nope, this is not inconsistent
958 960
 
959 961
 test_that("Bozic limit cases handled consistently", {
962
+
960 963
     sv <- allFitnessEffects(data.frame(
961 964
         parent = c("Root", "Root", "a1", "a2"),
962 965
         child = c("a1", "a2", "b", "b"),
... ...
@@ -964,6 +967,8 @@ test_that("Bozic limit cases handled consistently", {
964 967
         sh = 0.1,
965 968
         typeDep = "OR"),
966 969
         noIntGenes = c("E" = 0.85, "F" = 1))
970
+
971
+    null <- capture.output({
967 972
     expect_output(print(evalAllGenotypes(sv, order = FALSE, addwt = TRUE,
968 973
                                    model = "Bozic")), ## this works
969 974
                   "Death_rate", fixed = TRUE, all = FALSE)
... ...
@@ -1082,7 +1087,8 @@ test_that("Bozic limit cases handled consistently", {
1082 1087
     expect_output(print(oncoSimulIndiv(svff3, model = "Bozic",
1083 1088
                                        sampleEvery = 0.02)),
1084 1089
                  "Individual OncoSimul trajectory with call"
1085
-                 ) 
1090
+                 )
1091
+    })
1086 1092
 })
1087 1093
 
1088 1094
 
... ...
@@ -1217,14 +1223,28 @@ test_that("not all genes named", {
1217 1223
 
1218 1224
 test_that("We can deal with single-gene genotypes and trivial cases" ,{
1219 1225
 
1226
+    ## Yeah, testthat does not want to cater to this. Oh well.
1227
+    expect_message_silent <- function(x, ...) {
1228
+        suppressWarnings(expect_message(x, ...))
1229
+    }
1230
+
1231
+    expect_output_silent <- function(x, ...) {
1232
+        suppressWarnings(expect_output(x, ...))
1233
+    }
1234
+
1235
+    expect_true_silent <- function(x) {
1236
+        suppressWarnings(expect_true(x))
1237
+    }
1238
+    
1239
+    
1220 1240
     ## we get the message
1221
-    expect_message(allFitnessEffects(
1241
+    expect_message_silent(allFitnessEffects(
1222 1242
         genotFitness = data.frame(g = c("A", "B"),
1223 1243
                                   y = c(1, 2))), "All single-gene genotypes",
1224 1244
         fixed = TRUE)
1225 1245
 
1226 1246
     
1227
-    expect_true(identical(
1247
+    expect_true_silent(identical(
1228 1248
         data.frame(Genotype = c("WT", "A", "B", "A, B"),
1229 1249
                    Fitness = c(1.0, 1.0, 2.0, 0.0), ## 0.0 used to be 1.0
1230 1250
                    stringsAsFactors = FALSE),
... ...
@@ -1234,7 +1254,7 @@ test_that("We can deal with single-gene genotypes and trivial cases" ,{
1234 1254
             addwt = TRUE))
1235 1255
     ))
1236 1256
 
1237
-    expect_true(identical(
1257
+    expect_true_silent(identical(
1238 1258
         data.frame(Genotype = c("WT", "A", "B", "A, B"),
1239 1259
                    Fitness = c(1.0, 1.5, 2.9, 0.0),
1240 1260
                    stringsAsFactors = FALSE),
... ...
@@ -1244,7 +1264,7 @@ test_that("We can deal with single-gene genotypes and trivial cases" ,{
1244 1264
             addwt = TRUE))
1245 1265
     ))
1246 1266
 
1247
-    expect_true(identical(
1267
+    expect_true_silent(identical(
1248 1268
         data.frame(Genotype = c("WT", "A", "B", "E", "A, B", "A, E", "B, E", "A, B, E"),
1249 1269
                    Fitness = c(1.0, 1.3, 2.4, 3.2, rep(0, 4)),
1250 1270
                    stringsAsFactors = FALSE),
... ...
@@ -1255,7 +1275,7 @@ test_that("We can deal with single-gene genotypes and trivial cases" ,{
1255 1275
     ))
1256 1276
 
1257 1277
 
1258
-    expect_true(identical(
1278
+    expect_true_silent(identical(
1259 1279
         data.frame(Genotype = c("WT", "A"),
1260 1280
                    Fitness = c(1.0, 1.0),
1261 1281
                    stringsAsFactors = FALSE),
... ...
@@ -1265,7 +1285,7 @@ test_that("We can deal with single-gene genotypes and trivial cases" ,{
1265 1285
             addwt = TRUE))
1266 1286
     ))
1267 1287
     
1268
-    expect_true(identical(
1288
+    expect_true_silent(identical(
1269 1289
         data.frame(Genotype = c("WT", "A"),
1270 1290
                    Fitness = c(1.0, 0.6),
1271 1291
                    stringsAsFactors = FALSE),
... ...
@@ -1275,7 +1295,7 @@ test_that("We can deal with single-gene genotypes and trivial cases" ,{
1275 1295
             addwt = TRUE))
1276 1296
     ))
1277 1297
 
1278
-    expect_true(identical(
1298
+    expect_true_silent(identical(
1279 1299
         data.frame(Genotype = c("WT", "A", "D", "F", "A, D", "A, F", "D, F",
1280 1300
                                 "A, D, F"),
1281 1301
                    Fitness = c(1.0, rep(0, 6), 1.7), ## c(rep(1, 7), 1.7),
... ...
@@ -1290,7 +1310,7 @@ test_that("We can deal with single-gene genotypes and trivial cases" ,{
1290 1310
     m <- rbind(c(1, 0, 1.2),
1291 1311
                c(0, 1, 2.4))
1292 1312
 
1293
-    expect_true(identical(
1313
+    expect_true_silent(identical(
1294 1314
         data.frame(Genotype = c("WT", "A", "B", "A, B"),
1295 1315
                    Fitness = c(1.0, 1.2, 2.4, 0.0),
1296 1316
                    stringsAsFactors = FALSE),
... ...
@@ -1299,7 +1319,7 @@ test_that("We can deal with single-gene genotypes and trivial cases" ,{
1299 1319
             addwt = TRUE))
1300 1320
     ))    
1301 1321
 
1302
-    expect_message(evalAllGenotypes(
1322
+    expect_message_silent(evalAllGenotypes(
1303 1323
         allFitnessEffects(genotFitness = m)),
1304 1324
         "No column names", fixed = TRUE)
1305 1325
 
... ...
@@ -1313,7 +1333,7 @@ test_that("We can deal with single-gene genotypes and trivial cases" ,{
1313 1333
     m2 <- rbind(c(1, 0, 1.2),
1314 1334
                c(0, 1, 2.4))
1315 1335
     colnames(m2) <- c("U", "M", "Fitness")
1316
-    expect_true(identical(
1336
+    expect_true_silent(identical(
1317 1337
         data.frame(Genotype = c("WT", "M", "U", "M, U"),
1318 1338
                    Fitness = c(1.0, 2.4, 1.2, 0),
1319 1339
                    stringsAsFactors = FALSE),
... ...
@@ -1322,7 +1342,7 @@ test_that("We can deal with single-gene genotypes and trivial cases" ,{
1322 1342
             addwt = TRUE))
1323 1343
     ))
1324 1344
 
1325
-    expect_message(
1345
+    expect_message_silent(
1326 1346
         evalAllGenotypes(
1327 1347
             allFitnessEffects(genotFitness = m2)),
1328 1348
         "Sorting gene column names", fixed = TRUE
... ...
@@ -1332,7 +1352,7 @@ test_that("We can deal with single-gene genotypes and trivial cases" ,{
1332 1352
     m2df <- data.frame(rbind(c(1, 0, 1.2),
1333 1353
                c(0, 1, 2.4)))
1334 1354
     colnames(m2df) <- c("U", "M", "Fitness")
1335
-    expect_true(identical(
1355
+    expect_true_silent(identical(
1336 1356
         data.frame(Genotype = c("WT", "M", "U", "M, U"),
1337 1357
                    Fitness = c(1.0, 2.4, 1.2, 0),
1338 1358
                    stringsAsFactors = FALSE),
... ...
@@ -10,7 +10,7 @@ test_that("Runs without crashes", {
10 10
     names(ni) <- paste0("g", 2:11)
11 11
     ## each single one
12 12
     for(i in 2:11) {
13
-        cat("\n doing iteration", iteration, "\n")
13
+        ## cat("\n doing iteration", iteration, "\n")
14 14
         ni[] <- runif(10, min = -0.01, max = 0.1)
15 15
         ni <- sample(ni)
16 16
         drvN <- paste0("g", i)
... ...
@@ -39,7 +39,7 @@ test_that("Runs without crashes", {
39 39
     for(n in c(2, 3)) {
40 40
         m <- gtools::combinations(10, n, 2:11)
41 41
         for(j in sample(nrow(m), 45)) { ## all for 2, a sample of 45 for 3
42
-            cat("\n doing iteration", iteration, "\n")
42
+            ## cat("\n doing iteration", iteration, "\n")
43 43
             ni[] <- runif(10, min = -0.01, max = 0.1)
44 44
             ni <- sample(ni)
45 45
             drvN <- paste0("g", sample(m[j, ]))
... ...
@@ -24,7 +24,7 @@ test_that("testing single gene evaluation", {
24 24
   afe3 <- allFitnessEffects(genotFitness = r1, 
25 25
                             frequencyDependentFitness = TRUE, 
26 26
 			    frequencyType = "rel")
27
-  
27
+  suppressWarnings({
28 28
   evge1 <- evalGenotype(genotype = "Root", fitnessEffects = afe1,
29 29
                         spPopSizes = c(5000, 2500, 2500, 7500))
30 30
   
... ...
@@ -42,14 +42,14 @@ test_that("testing single gene evaluation", {
42 42
   
43 43
   evge6 <- evalGenotype(genotype = "A, B", fitnessEffects = afe1,
44 44
                         spPopSizes = c(5000, 2500, 2500, 7500))
45
-  
45
+  })
46 46
   
47 47
   expect_equal(evge1, evge2)
48 48
   
49 49
   expect_equal(evge3, evge4)
50 50
   
51 51
   expect_equal(evge5, evge6)
52
-  
52
+  suppressWarnings({
53 53
   expect_error(evalGenotype(genotype = c(0, 1), fitnessEffects = afe1,
54 54
                             spPopSizes = c(5000, 2500, 2500, 7500)), 
55 55
                "Genotype cannot contain any 0 if its length > 1")
... ...
@@ -57,7 +57,7 @@ test_that("testing single gene evaluation", {
57 57
   expect_error(evalGenotype(genotype = c(1, 3), fitnessEffects = afe1,
58 58
                             spPopSizes = c(5000, 2500, 2500, 7500)),
59 59
                "Genotype as vector of numbers contains genes not in fitnessEffects/mutatorEffects.")
60
-  
60
+  })
61 61
   expect_error(evalGenotype(genotype = 0, fitnessEffects = afe2), 
62 62
                "Genotype cannot be 0.")
63 63
   
... ...
@@ -103,9 +103,10 @@ test_that("testing all genes evaluation", {
103 103
   genotypes <- c(0, OncoSimulR:::generateAllGenotypes(fitnessEffects = afe, 
104 104
                                                       order = FALSE, 
105 105
                                                       max = 256)$genotNums)
106
-  
106
+
107
+  suppressWarnings({
107 108
   evalGs_one_by_one <- sapply(genotypes, function(x) evalGenotype(x, afe,
108
-spPopSizes = c(500,
109
+                                                                  spPopSizes = c(500,
109 110
                                                                                  250, 
110 111
                                                                                  250, 
111 112
                                                                                  250, 
... ...
@@ -123,7 +124,8 @@ spPopSizes = c(500,
123 124
                                                          300,
124 125
                                                          300,
125 126
                                                          450))$Fitness
126
-  
127
+
128
+  })                                     
127 129
   expect_identical(evalGs_one_by_one, evalGs_all_together)
128 130
   
129 131
 })
... ...
@@ -140,6 +142,11 @@ test_that("eval single WT genotype with FDF" , {
140 142
                              frequencyDependentFitness = TRUE)
141 143
 
142 144
 
145
+    suppressWarnings({
146
+           ## Silencing the warnings, which are irrelevant, does not silence errors.
147
+    ## uncomment this to see for yourself
148
+    ## expect_true(2 == 3)
149
+    ## expect_error(2 * 5)
143 150
     expect_equal(evalGenotype(0, afe, spPopSizes = rep(2, 4)),
144 151
                  100 - 2 - 4 - 6)
145 152
 
... ...
@@ -192,6 +199,8 @@ test_that("eval single WT genotype with FDF" , {
192 199
                  "Genotype contains NA or a gene not in fitnessEffects/mutatorEffects",
193 200
                  fixed = TRUE)
194 201
 
202
+ 
203
+    })
195 204
     
196 205
 })
197 206
 
... ...
@@ -11,6 +11,10 @@ cat(paste("\n Starting exercise-plotting-code at", date()))
11 11
 
12 12
 ## Takes about 11 seconds on my laptop
13 13
 
14
+## I add silly lines in some blocks because this argues that there is no testing.
15
+## Well, I might not be using "expect_whatever", but if there was an error, this would
16
+## fail. Uncomment in the first block to see yourself
17
+
14 18
 test_that("exercising the oncosimul plotting code", {
15 19
               data(examplePosets)
16 20
               p701 <- examplePosets[["p701"]]
... ...
@@ -33,8 +37,11 @@ test_that("exercising the oncosimul plotting code", {
33 37
                                   finalTime = 500,
34 38
                                   onlyCancer = FALSE, mc.cores = 2)
35 39
               plot(out)
40
+              ## plot(cucaracha)
41
+              expect_true(2 == 2)
36 42
           })
37 43
 
44
+
38 45
 test_that("exercising the oncosimul plotting code, thinning", {
39 46
               data(examplePosets)
40 47
               p701 <- examplePosets[["p701"]]
... ...
@@ -57,6 +64,7 @@ test_that("exercising the oncosimul plotting code, thinning", {
57 64
                                   keepEvery = 3,
58 65
                                   onlyCancer = FALSE, mc.cores = 2)
59 66
               plot(out, thinData = TRUE)
67
+              expect_true(2 == 2)
60 68
           })
61 69
 
62 70
 
... ...
@@ -67,69 +75,72 @@ test_that("exercising the poset plotting code", {
67 75
               plotPoset(poset701, addroot = TRUE)
68 76
               plotPoset(poset701, addroot = TRUE,
69 77
                         names = c("Root", "KRAS", "SMAD4", "CDNK2A", "TP53",
70
-                            "MLL3","PXDN", "TGFBR2"))
78
+                                  "MLL3","PXDN", "TGFBR2"))
79
+              expect_true(2 == 2)
71 80
           })
72 81
 
73 82
 
74 83
 test_that("exercising plotClonePhylog", {
75 84
     data(examplesFitnessEffects)
76 85
     tmp <-  oncoSimulIndiv(examplesFitnessEffects[["o3"]],
77
-                                     model = "McFL", 
78
-                                     mu = 5e-6,
79
-                                     detectionSize = 1e8, 
80
-                                     detectionDrivers = 3,
81
-                                     sampleEvery = 0.03, 
82
-                                     max.num.tries = 10,
83
-                                     keepEvery = 15,
84
-                                     initSize = 2000,
85
-                                     finalTime = 3000,
86
-                                     onlyCancer = FALSE,
87
-                                     keepPhylog = TRUE)
88
-              ## Show only those with N > 10 at end
89
-              plotClonePhylog(tmp, N = 10)
90
-              ## Show only those with N > 1 between times 5 and 1000
91
-              plotClonePhylog(tmp, N = 1, t = c(5, 1000))
92
-              ## Show everything, even if teminal nodes are extinct
93
-              plotClonePhylog(tmp, N = 0)
94
-              ## Show time when first appeared
95
-              plotClonePhylog(tmp, N = 10, timeEvents = TRUE)
96
-              ## This can take a few seconds
97
-              plotClonePhylog(tmp, N = 10, keepEvents = TRUE)
98
-              ## Reaching the fixOverlap code
99
-              plotClonePhylog(tmp, N = 0, timeEvents = TRUE)
100
-          })
86
+                           model = "McFL", 
87
+                           mu = 5e-6,
88
+                           detectionSize = 1e8, 
89
+                           detectionDrivers = 3,
90
+                           sampleEvery = 0.03, 
91
+                           max.num.tries = 10,
92
+                           keepEvery = 15,
93
+                           initSize = 2000,
94
+                           finalTime = 3000,
95
+                           onlyCancer = FALSE,
96
+                           keepPhylog = TRUE)
97
+    ## Show only those with N > 10 at end
98
+    plotClonePhylog(tmp, N = 10)
99
+    ## Show only those with N > 1 between times 5 and 1000
100
+    plotClonePhylog(tmp, N = 1, t = c(5, 1000))
101
+    ## Show everything, even if teminal nodes are extinct
102
+    plotClonePhylog(tmp, N = 0)
103
+    ## Show time when first appeared
104
+    plotClonePhylog(tmp, N = 10, timeEvents = TRUE)
105
+    ## This can take a few seconds
106
+    plotClonePhylog(tmp, N = 10, keepEvents = TRUE)
107
+    ## Reaching the fixOverlap code
108
+    plotClonePhylog(tmp, N = 0, timeEvents = TRUE)
109
+    expect_true(2 == 2)
110
+})
101 111
 
102 112
 
103 113
 ## the next is slightly slow
104 114
 test_that("exercising the fitnessEffects plotting code", {
105
-              data(examplesFitnessEffects)
106
-              plot(examplesFitnessEffects[["cbn1"]])
107
-              cs <-  data.frame(parent = c(rep("Root", 4), "a", "b", "d", "e", "c"),
108
-                 child = c("a", "b", "d", "e", "c", "c", rep("g", 3)),
109
-                 s = 0.1,
110
-                                sh = -0.9,
111
-                                typeDep = "MN")
112
-              cbn1 <- allFitnessEffects(cs)
113
-              plot(cbn1)
114
-              plot(cbn1, "igraph")
115
-              p4 <- data.frame(parent = c(rep("Root", 4), "A", "B", "D", "E", "C", "F"),
116
-                  child = c("A", "B", "D", "E", "C", "C", "F", "F", "G", "G"),
117
-                  s = c(0.01, 0.02, 0.03, 0.04, 0.1, 0.1, 0.2, 0.2, 0.3, 0.3),
118
-                  sh = c(rep(0, 4), c(-.9, -.9), c(-.95, -.95), c(-.99, -.99)),
119
-                  typeDep = c(rep("--", 4), 
120
-                      "XMPN", "XMPN", "MN", "MN", "SM", "SM"))
121
-              fp4m <- allFitnessEffects(p4,
122
-                                        geneToModule = c("Root" = "Root", "A" = "a1",
123
-                                            "B" = "b1, b2", "C" = "c1",
124
-                                            "D" = "d1, d2", "E" = "e1",
125
-                                            "F" = "f1, f2", "G" = "g1"))
126
-              plot(fp4m, expandModules = TRUE)
127
-              plot(fp4m, "igraph", layout = igraph::layout.reingold.tilford, 
128
-                   expandModules = TRUE)
129
-              plot(fp4m, "igraph", layout = igraph::layout.reingold.tilford, 
130
-                   expandModules = TRUE, autofit = TRUE)
131
-              plot(fp4m, expandModules = TRUE, autofit = TRUE)
132
-          })
115
+    data(examplesFitnessEffects)
116
+    plot(examplesFitnessEffects[["cbn1"]])
117
+    cs <-  data.frame(parent = c(rep("Root", 4), "a", "b", "d", "e", "c"),
118
+                      child = c("a", "b", "d", "e", "c", "c", rep("g", 3)),
119
+                      s = 0.1,
120
+                      sh = -0.9,
121
+                      typeDep = "MN")
122
+    cbn1 <- allFitnessEffects(cs)
123
+    plot(cbn1)
124
+    plot(cbn1, "igraph")
125
+    p4 <- data.frame(parent = c(rep("Root", 4), "A", "B", "D", "E", "C", "F"),
126
+                     child = c("A", "B", "D", "E", "C", "C", "F", "F", "G", "G"),
127
+                     s = c(0.01, 0.02, 0.03, 0.04, 0.1, 0.1, 0.2, 0.2, 0.3, 0.3),
128
+                     sh = c(rep(0, 4), c(-.9, -.9), c(-.95, -.95), c(-.99, -.99)),
129
+                     typeDep = c(rep("--", 4), 
130
+                                 "XMPN", "XMPN", "MN", "MN", "SM", "SM"))
131
+    fp4m <- allFitnessEffects(p4,
132
+                              geneToModule = c("Root" = "Root", "A" = "a1",
133
+                                               "B" = "b1, b2", "C" = "c1",
134
+                                               "D" = "d1, d2", "E" = "e1",
135
+                                               "F" = "f1, f2", "G" = "g1"))
136
+    plot(fp4m, expandModules = TRUE)
137
+    plot(fp4m, "igraph", layout = igraph::layout.reingold.tilford,
138
+         expandModules = TRUE)
139
+    plot(fp4m, "igraph", layout = igraph::layout.reingold.tilford,
140
+         expandModules = TRUE, autofit = TRUE)
141
+    plot(fp4m, expandModules = TRUE, autofit = TRUE)
142
+    expect_true(2 == 2)
143
+})
133 144
 
134 145
 
135 146
 test_that("only recognized options", {
... ...
@@ -176,27 +187,30 @@ test_that("stacked, stream, genotypes and some colors", {
176 187
             }
177 188
         }
178 189
     }
179
-    plot(tmp, type = "stacked", show = "genotypes")
180
-    plot(tmp, type = "stream", show = "genotypes")
181
-    plot(tmp, type = "line", show = "genotypes")
182
-    plot(tmp, type = "stacked", show = "drivers")
183
-    plot(tmp, type = "stream", show = "drivers")
184
-    plot(tmp, type = "line", show = "drivers")
185
-    plot(tmp, type = "stacked", order.method = "max")
186
-    plot(tmp, type = "stacked", order.method = "first")
187
-    plot(tmp, type = "stream", order.method = "max")
188
-    plot(tmp, type = "stream", order.method = "first")
189
-    plot(tmp, type = "stream", stream.center = TRUE)
190
-    plot(tmp, type = "stream", stream.center = FALSE)
191
-    plot(tmp, type = "stream", stream.center = TRUE, log = "x")
192
-    plot(tmp, type = "stacked", stream.center = TRUE, log = "x")
193
-    plot(tmp, type = "stacked", show = "genotypes",
194
-         breakSortColors = "random")
195
-    plot(tmp, type = "stream", show = "genotypes",
196
-         breakSortColors = "distave")
197
-    plot(tmp, type = "stacked", show = "genotypes", col = rainbow(9))
198
-    plot(tmp, type = "stream", show = "genotypes", col = rainbow(3))
199
-    plot(tmp, type = "line", show = "genotypes", col = rainbow(20))
190
+    suppressWarnings({
191
+        plot(tmp, type = "stacked", show = "genotypes")
192
+        plot(tmp, type = "stream", show = "genotypes")
193
+        plot(tmp, type = "line", show = "genotypes")
194
+        plot(tmp, type = "stacked", show = "drivers")
195
+        plot(tmp, type = "stream", show = "drivers")
196
+        plot(tmp, type = "line", show = "drivers")
197
+        plot(tmp, type = "stacked", order.method = "max")
198
+        plot(tmp, type = "stacked", order.method = "first")
199
+        plot(tmp, type = "stream", order.method = "max")
200
+        plot(tmp, type = "stream", order.method = "first")
201
+        plot(tmp, type = "stream", stream.center = TRUE)
202
+        plot(tmp, type = "stream", stream.center = FALSE)
203
+        plot(tmp, type = "stream", stream.center = TRUE, log = "x")
204
+        plot(tmp, type = "stacked", stream.center = TRUE, log = "x")
205
+        plot(tmp, type = "stacked", show = "genotypes",
206
+             breakSortColors = "random")
207
+        plot(tmp, type = "stream", show = "genotypes",
208
+             breakSortColors = "distave")
209
+        plot(tmp, type = "stacked", show = "genotypes", col = rainbow(9))
210
+        plot(tmp, type = "stream", show = "genotypes", col = rainbow(3))
211
+        plot(tmp, type = "line", show = "genotypes", col = rainbow(20))
212
+    })
213
+    expect_true(2 == 2)
200 214
 })
201 215
 
202 216
 
... ...
@@ -302,6 +316,7 @@ test_that("xlab, ylab, ylim, xlim can be passed", {
302 316
          ylab = "ylab", ylim = c(-100, 1000),
303 317
                   xlim = c(20, 70), thinData = TRUE, thinData.keep = 0.5,
304 318
          plotDrivers = TRUE)
319
+    expect_true(2 == 2)
305 320
 })
306 321
 
307 322
 
... ...
@@ -331,10 +346,11 @@ test_that("oncosimul v.1 objects and genotype plotting", {
331 346
         }
332 347
     }
333 348
     }
334
-    class(p1)
335
-    plot(p1, type = "stacked", show = "genotypes", thinData = TRUE, thinData.keep = 0.5)
336
-    plot(p1, type = "stream", show = "genotypes", thinData = TRUE, thinData.keep = 0.5)
349
+    ## class(p1)
350
+   plot(p1, type = "stacked", show = "genotypes", thinData = TRUE, thinData.keep = 0.5)
351
+   plot(p1, type = "stream", show = "genotypes", thinData = TRUE, thinData.keep = 0.5)
337 352
     plot(p1, type = "line", show = "genotypes", thinData = TRUE, thinData.keep = 0.5)
353
+    expect_true(2 == 2)
338 354
 })
339 355
 
340 356
 
... ...
@@ -363,10 +379,13 @@ test_that("passing colors", {
363 379
             }
364 380
         }
365 381
     }
366
-    class(p1)
382
+    ## class(p1)
383
+    suppressWarnings({
367 384
     plot(p1, type = "stacked", show = "genotypes", col = rainbow(8))
368 385
     plot(p1, type = "stream", show = "genotypes", col = rainbow(18))
369 386
     plot(p1, type = "line", show = "genotypes", col = rainbow(3))
387
+    })
388
+    expect_true(2 == 2)
370 389
 })
371 390
 
372 391
 
... ...
@@ -508,7 +527,7 @@ test_that("exercising phylogClone", {
508 527
                                      finalTime = 1,
509 528
                                      onlyCancer = FALSE,
510 529
                                      keepPhylog = TRUE)
511
-              OncoSimulR:::phylogClone(tmp)
530
+              suppressWarnings(OncoSimulR:::phylogClone(tmp))
512 531
     }
513 532
     for(i in 1:15){ 
514 533
         tmp <-  oncoSimulIndiv(examplesFitnessEffects[["cbn2"]],
... ...
@@ -523,8 +542,9 @@ test_that("exercising phylogClone", {
523 542
                                finalTime = 1,
524 543
                                onlyCancer = FALSE,
525 544
                                keepPhylog = TRUE)
526
-        OncoSimulR:::phylogClone(tmp)
545
+        suppressWarnings(OncoSimulR:::phylogClone(tmp))
527 546
     }
547
+    expect_true(2 == 2)
528 548
 })
529 549
 
530 550
 cat(paste("\n Ending exercise-plotting-code at", date(), "\n"))
... ...
@@ -30,12 +30,12 @@ test_that("Minimal tests of generate_matrix_genotypes", {
30 30
     ## take long in slow machines.
31 31
     for(i in 1:13) {
32 32
         tmp <- OncoSimulR:::generate_matrix_genotypes(i)
33
-        stopifnot(nrow(tmp) == (2^i))
34
-        stopifnot(ncol(tmp) == i)
33
+        expect_true(nrow(tmp) == (2^i))
34
+        expect_true(ncol(tmp) == i)
35 35
         cstmp <- colSums(tmp)
36 36
         lucstmp <- unique(cstmp)
37
-        stopifnot(length(lucstmp) == 1)
38
-        stopifnot(lucstmp[1] == ((2^i)/2)) ## yes, 2^(i - 1) but do full
37
+        expect_true(length(lucstmp) == 1)
38
+        expect_true(lucstmp[1] == ((2^i)/2)) ## yes, 2^(i - 1) but do full
39 39
         ## simple logic
40 40
         rm(tmp)
41 41
         rm(cstmp)
... ...
@@ -43,7 +43,7 @@ OandE <- function(fe, s, ft,  model, initMutant, no,
43 43
     ## But not too large, to avoid numerical issues
44 44
     ## with large s
45 45
     E <- expected(no = no, s = s, ft = ft, model = model)
46
-    O <- oncoSimulPop(reps,
46
+    suppressWarnings(O <- oncoSimulPop(reps,
47 47
                       fe,
48 48
                       mu = mu,
49 49
                       initSize = no,
... ...
@@ -58,7 +58,7 @@ OandE <- function(fe, s, ft,  model, initMutant, no,
58 58
                       initMutant = initMutant,
59 59
                       mutationPropGrowth = FALSE,
60 60
                       onlyCancer = FALSE,
61
-                      mc.cores = 2)
61
+                      mc.cores = 2))
62 62
     if(verbose) {
63 63
         print(E)
64 64
         print(summary(O)[, c(1:3, 8:9)])
... ...
@@ -53,9 +53,10 @@ test_that("Equality of fitness including allFitnessEffects", {
53 53
     colnames(m4) <- c("A", "B", "C", "Fitness")
54 54
     m4[, "Fitness"] <- m4[, "Fitness"]/1.3
55 55
 
56
-    expect_equivalent(OncoSimulR:::to_genotFitness_std(df3), m3)
57
-    expect_equivalent(OncoSimulR:::to_genotFitness_std(df3, simplify = FALSE), m4)
58
-
56
+    suppressWarnings(expect_equivalent(OncoSimulR:::to_genotFitness_std(df3), m3))
57
+    suppressWarnings(expect_equivalent(OncoSimulR:::to_genotFitness_std(df3, simplify = FALSE), m4))
58
+    ## Yes, suppressing warnings does not invalidate the test. Uncomment and see:
59
+    ## suppressWarnings(expect_equivalent(3, 5))
59 60
 
60 61
     for(i in 1:10) {
61 62
         rxx <- rfitness(7)
... ...
@@ -91,15 +92,15 @@ test_that("drv names OK", {
91 92
 
92 93
 
93 94
 ## Make sure warning if using Bozic
94
-test_that("Bozic and fitness landscape spec", {
95
+test_that("Bozic and fitness landscape spec will throw exception", {
95 96
     rxx <- rfitness(7)
96
-    expect_warning(oncoSimulIndiv(
97
+    expect_warning(out <- oncoSimulIndiv(
97 98
         allFitnessEffects(genotFitness = rxx),
98 99
         model = "Bozic", initSize = 5000,
99 100
         onlyCancer = FALSE,
100 101
         finalTime = 10,
101 102
         verbosity = 0),
102
-        "Bozic model passing a fitness landscape will not work for now",
103
+        "Bozic model passing a fitness landscape most likely will not work for now",
103 104
         fixed = TRUE)
104 105
     rm(rxx)
105 106
 })
... ...
@@ -178,7 +179,7 @@ test_that("rt and fl specifications are the same", {
178 179
         set.seed(is)
179 180
         s2 <- oncoSimulIndiv(allFitnessEffects(genotFitness = rtfl$fl))
180 181
         expect_equal(s1$pops.by.time, s2$pops.by.time)
181
-        print(summary(s1))
182
+        ## print(summary(s1))
182 183
         ##  expect_identical(s1[1:length(s1)], s2[1:length(s2)])
183 184
         ## in WIndoze, i386, can fail identical test by factors order e-11
184 185
         if( (.Platform$OS.type == "windows") &&
... ...
@@ -300,6 +300,7 @@ test_that("we evaluate the WT", {
300 300
                                           "b : c" = 0.5),
301 301
                             noIntGenes = c("e" = 0.1))
302 302
     ## expect_warning(
303
+    null <- capture.output(
303 304
         ou <- OncoSimulR:::evalRGenotype(vector(mode = "integer",
304 305
                                                            length = 0),
305 306
                                                     fe2fl(fe),
... ...
@@ -309,7 +310,8 @@ test_that("we evaluate the WT", {
309 310
                                                     "evalGenotype", 
310 311
                                                     0)## ,
311 312
                    ## "WARNING: you have evaluated fitness/mutator status of a genotype of length zero",
312
-                   ## fixed = TRUE)
313
+        ## fixed = TRUE)
314
+        )
313 315
     expect_identical(ou, 1)
314 316
 })
315 317
 
... ...
@@ -321,6 +323,7 @@ test_that("we evaluate the WT, 2", {
321 323
     fm <- OncoSimulR:::allMutatorEffects(noIntGenes = c("a" = 10,
322 324
                                                         "c" = 5))
323 325
     ## expect_warning(
326
+    null <- capture.output(
324 327
         ou2 <- OncoSimulR:::evalRGenotypeAndMut(
325 328
                        vector(mode = "integer", length = 0),#rG
326 329
                        fe2fl(fe),#rFE
... ...
@@ -331,7 +334,8 @@ test_that("we evaluate the WT, 2", {
331 334
                        FALSE,#prodneg
332 335
                        0)## , #currentTime
333 336
                    ## "WARNING: you have evaluated fitness of a genotype of length zero.",
334
-                   ## fixed = TRUE)
337
+        ## fixed = TRUE)
338
+        )
335 339
     expect_identical(ou2, c(1, 1))
336 340
 })
337 341
     
... ...
@@ -22,8 +22,8 @@ test_that("Conversion for matrix", {
22 22
 
23 23
 test_that("Conversion for incomplete matrix", {
24 24
     m6 <- cbind(c(1, 1), c(1, 0), c(2, 3))
25
-    fem6 <- allFitnessEffects(genotFitness = m6)
26
-    evalAllGenotypes(fem6, addwt = TRUE, order = FALSE)
25
+    suppressWarnings(fem6 <- allFitnessEffects(genotFitness = m6))
26
+    ## evalAllGenotypes(fem6, addwt = TRUE, order = FALSE)
27 27
     expect_true(all(
28 28
         evalAllGenotypes(fem6, addwt = TRUE,
29 29
                          order = FALSE)[, 2]
... ...
@@ -64,8 +64,8 @@ test_that("The WT is added if absent, in two cases", {
64 64
     ## internal call
65 65
     ## the wt was added to the output from allGenotypes_to_matrix
66 66
     ## though this is mostly redundant now
67
-    expect_equivalent(OncoSimulR:::allGenotypes_to_matrix(ag)[, 3],
68
-                      c(1, 3, 0, 2))
67
+    suppressWarnings(expect_equivalent(OncoSimulR:::allGenotypes_to_matrix(ag)[, 3],
68
+                      c(1, 3, 0, 2)))
69 69
     ## the user visible, which is via plotFitnessLandscape -> to_Fitness_Matrix
70 70
     plot(ag)
71 71
 })
... ...
@@ -114,8 +114,8 @@ test_that("Missing genotypes defaults: WT 1, others 0", {
114 114
         Fitness = c(1, 0, 2, rep(0, 4), 3),
115 115
         stringsAsFactors = FALSE)
116 116
     
117
-    o_m8 <- evalAllGenotypes(allFitnessEffects(genotFitness = m8),
118
-                     addwt = TRUE)
117
+    suppressWarnings(o_m8 <- evalAllGenotypes(allFitnessEffects(genotFitness = m8),
118
+                     addwt = TRUE))
119 119
     ## as exp_m8 does not have the evalAllGenotypes attribute
120 120
     expect_equivalent(o_m8, exp_m8)
121 121
 
... ...
@@ -138,7 +138,7 @@ test_that("Missing genotypes defaults: WT 1, others 0", {
138 138
                     rep(0, 7)),
139 139
         stringsAsFactors = FALSE)
140 140
 
141
-    o_m9 <- evalAllGenotypes(allFitnessEffects(genotFitness = m9), addwt = TRUE)
141
+    suppressWarnings(o_m9 <- evalAllGenotypes(allFitnessEffects(genotFitness = m9), addwt = TRUE))
142 142
 
143 143
     expect_equivalent(o_m9, exp_m9)
144 144
     
... ...
@@ -9,7 +9,7 @@ test_that("genot_fitness_to_epistasis works minimally", {
9 9
     fepi <- OncoSimulR:::genot_fitness_to_epistasis(m6)
10 10
     
11 11
     fem6 <- allFitnessEffects(epistasis = fepi)
12
-    fem6b <- allFitnessEffects(genotFitness = m6)
12
+    suppressWarnings(fem6b <- allFitnessEffects(genotFitness = m6))
13 13
 
14 14
     afe1 <- evalAllGenotypes(fem6, addwt = TRUE)
15 15
     afe2 <- evalAllGenotypes(fem6b, addwt = TRUE)
... ...
@@ -135,7 +135,7 @@ test_that("initMutant lexicog order with noint",
135 135
                   print(tmp)
136 136
               }
137 137
     }
138
-    cat(paste("\n done tries", tries, "\n"))
138
+    ## cat(paste("\n done tries", tries, "\n"))
139 139
     expect_true(T1)
140 140
 })
141 141
 
... ...
@@ -181,7 +181,7 @@ test_that("initMutant non lexicog order", {
181 181
             print(tmp)
182 182
         }
183 183
     }
184
-    cat(paste("\n done tries", tries, "\n"))
184
+    ## cat(paste("\n done tries", tries, "\n"))
185 185
     expect_true(T1)
186 186
 })
187 187
   
... ...
@@ -229,7 +229,7 @@ test_that("initMutant non lexicog order",
229 229
                   print(tmp)
230 230
               }
231 231
     }
232
-    cat(paste("\n done tries", tries, "\n"))
232
+    ## cat(paste("\n done tries", tries, "\n"))
233 233
     expect_true(T1)
234 234
 })
235 235
 
... ...
@@ -673,8 +673,8 @@ test_that("initMutant works if == number of genes", {
673 673
     for(i in 1:5){
674 674
         set.seed(i)
675 675
         o2i <- allFitnessEffects(genotFitness = rfitness(2))
676
-        o2io <- oncoSimulIndiv(o2i, initMutant = "B, A",
677
-                               onlyCancer = FALSE)
676
+        suppressWarnings(o2io <- oncoSimulIndiv(o2i, initMutant = "B, A",
677
+                               onlyCancer = FALSE))
678 678
         if(!is.null(o2io$other$ExceptionMessage)) {
679 679
             expect_false(
680 680
                 grepl("Trying to obtain a mutation when nonmutated.size is 0",
... ...
@@ -754,6 +754,7 @@ test_that("WT initMutant simulation equiv. to no init mutant", {
754 754
                         "max((200*(f_1 + f_2) + 50*f_1_2), 1)")
755 755
     afe <- allFitnessEffects(genotFitness = r, 
756 756
                              frequencyDependentFitness = TRUE)
757
+    null <- capture.output({
757 758
     set.seed(1)
758 759
     of1 <- oncoSimulIndiv(afe, 
759 760
                           model = "McFL",
... ...
@@ -780,12 +781,13 @@ test_that("WT initMutant simulation equiv. to no init mutant", {
780 781
                           seed = NULL, 
781 782
                           errorHitMaxTries = TRUE, 
782 783
                           errorHitWallTime = TRUE)
783
-
784
+    })
784 785
     expect_true(of1$InitMutant == "WT")
785 786
     expect_true(of2$InitMutant == "")
786 787
     expect_identical(of1[!(names(of1) == "InitMutant")],
787 788
                      of2[!(names(of2) == "InitMutant")])
788 789
 
790
+    null <- capture.output({
789 791
     set.seed(2)
790 792
     o2 <- allFitnessEffects(genotFitness = rfitness(2))
791 793
     set.seed(2)
... ...
@@ -812,7 +814,7 @@ test_that("WT initMutant simulation equiv. to no init mutant", {
812 814
                    seed = NULL, 
813 815
                    errorHitMaxTries = TRUE, 
814 816
                    errorHitWallTime = TRUE)
815
-
817
+    })
816 818
     expect_true(os1$InitMutant == "WT")
817 819
     expect_true(os2$InitMutant == "")
818 820
     expect_identical(os1[!(names(of1) == "InitMutant")],
... ...
@@ -852,32 +854,33 @@ test_that("initMutant: multiple pops, basic", {
852 854
                                         onlyCancer = FALSE,
853 855
                                         seed = NULL))
854 856
 
855
-
856
-    oncoSimulIndiv(o1, initMutant = c("c, b", "WT"),
857
+    null <- capture.output({
858
+    outx <- oncoSimulIndiv(o1, initMutant = c("c, b", "WT"),
857 859
                    initSize = c(300, 20),
858 860
                    onlyCancer = FALSE,
859 861
                    seed = NULL)
860 862
 
861
-    oncoSimulIndiv(o1, initMutant = c("c, b", "WT", "a"),
863
+    outx <- oncoSimulIndiv(o1, initMutant = c("c, b", "WT", "a"),
862 864
                    initSize = c(300, 20, 10),
863 865
                    onlyCancer = FALSE,
864 866
                    seed = NULL)
865
-
867
+    })
868
+    
866 869
     ## Pass all genotypes
867
-    oncoSimulIndiv(o1, initMutant = c("WT", "a", "b", "c",
870
+    null <- capture.output(oncoSimulIndiv(o1, initMutant = c("WT", "a", "b", "c",
868 871
                                       "a, b", "a, c", "b, c",
869 872
                                       "a, b, c"),
870 873
                    initSize = c(300, 20, 10, 6, 9, 5, 4, 6),
871 874
                    onlyCancer = FALSE,
872
-                   seed = NULL)
875
+                   seed = NULL))
873 876
 
874 877
     set.seed(1)
875 878
     r2 <- rfitness(2)
876 879
     r2[4, 3] <- 0
877 880
     o2 <- allFitnessEffects(genotFitness = r2)
878
-    oncoSimulIndiv(o2, initMutant = c("B, A", "A"),
879
-                   initSize = c(300, 20),
880
-                   onlyCancer = FALSE)
881
+    ## oncoSimulIndiv(o2, initMutant = c("B, A", "A"),
882
+    ##                initSize = c(300, 20),
883
+    ##                onlyCancer = FALSE)
881 884
     expect_warning( oncoSimulIndiv(o2, initMutant = c("B, A", "A"),
882 885
                    initSize = c(300, 20),
883 886
                    onlyCancer = FALSE),
... ...
@@ -1027,7 +1030,7 @@ test_that("multiple init mutants: different species, FDF", {
1027 1030
     afd0 <- allFitnessEffects(genotFitness = gffd0,
1028 1031
                              frequencyDependentFitness = TRUE)
1029 1032
 
1030
-    eag0 <- evalAllGenotypes(afd0, spPopSizes = 1:5)
1033
+    suppressWarnings(eag0 <- evalAllGenotypes(afd0, spPopSizes = 1:5))
1031 1034
 
1032 1035
 
1033 1036
     
... ...
@@ -1045,7 +1048,7 @@ test_that("multiple init mutants: different species, FDF", {
1045 1048
     afd <- allFitnessEffects(genotFitness = gffd, 
1046 1049
                              frequencyDependentFitness = TRUE)
1047 1050
 
1048
-    eag1 <- evalAllGenotypes(afd, spPopSizes = 0:5)
1051
+    suppressWarnings(eag1 <- evalAllGenotypes(afd, spPopSizes = 0:5))
1049 1052
 
1050 1053
     ## No wildtype
1051 1054
     gffd2 <- data.frame(
... ...
@@ -1060,7 +1063,7 @@ test_that("multiple init mutants: different species, FDF", {
1060 1063
     afd2 <- allFitnessEffects(genotFitness = gffd2, 
1061 1064
                              frequencyDependentFitness = TRUE)
1062 1065
 
1063
-    eag2 <- evalAllGenotypes(afd2, spPopSizes = 1:5)
1066
+    suppressWarnings(eag2 <- evalAllGenotypes(afd2, spPopSizes = 1:5))
1064 1067
     expect_identical(eag1, eag2)
1065 1068
     expect_identical(eag0, eag2)
1066 1069
 
... ...
@@ -1109,7 +1112,7 @@ test_that("multiple init mutants: different species, FDF, check fitness", {
1109 1112
     fmspecF$full_FDF_spec
1110 1113
     ## in exactly that order
1111 1114
 
1112
-    afmspecF <- evalAllGenotypes(fmspecF, spPopSizes = 1:11)
1115
+    suppressWarnings(afmspecF <- evalAllGenotypes(fmspecF, spPopSizes = 1:11))
1113 1116
 
1114 1117
     ## Show only viable ones
1115 1118
     afmspecF[afmspecF$Fitness >= 1, ]
... ...
@@ -1122,7 +1125,7 @@ test_that("multiple init mutants: different species, FDF, check fitness", {
1122 1125
 })
1123 1126
 
1124 1127
 
1125
-test_that("multiple init mutants: different species, FDF, crash if not in fitness table", {
1128
+test_that("multiple init mutants: different species, FDF, exprtk crash if not in fitness table", {
1126 1129
     ## Crash, as f_2 is not present
1127 1130
     gffd <- data.frame(
1128 1131
         Genotype = c("WT",
... ...
@@ -1137,8 +1140,7 @@ test_that("multiple init mutants: different species, FDF, crash if not in fitnes
1137 1140
     stringsAsFactors = FALSE)
1138 1141
     afd <- allFitnessEffects(genotFitness = gffd, 
1139 1142
                              frequencyDependentFitness = TRUE)
1140
-
1141
-    expect_error(evalAllGenotypes(afd, spPopSizes = rep(10, 6)))
1143
+        suppressWarnings(expect_error(evalAllGenotypes(afd, spPopSizes = rep(10, 6))))
1142 1144
     ### FIXME: catch this exact string"Undefined symbol: 'f_2'", fixed = TRUE)
1143 1145
 })
1144 1146
 
... ...
@@ -15,17 +15,16 @@ test_that("Abort in NK", {
15 15
 
16 16
 test_that("Call Magellan stats on NK", {
17 17
     rnk1 <- rfitness(6, K = 1, model = "NK")
18
-    Magellan_stats(rnk1)
18
+    expect_true(is.numeric(Magellan_stats(rnk1)))
19 19
     
20 20
     rnk2 <- rfitness(6, K = 4, model = "NK")
21
-    Magellan_stats(rnk2)
21
+    expect_true(is.numeric(Magellan_stats(rnk2)))
22 22
     })
23 23
 
24 24
 
25 25
 test_that("Call Magellan stats on RMF", {
26 26
     rmf1 <- rfitness(6)
27
-    Magellan_stats(rmf1)
28
-    
27
+    expect_true(is.numeric(Magellan_stats(rmf1)))
29 28
     })
30 29
 
31 30
 
... ...
@@ -1,12 +1,15 @@
1 1
 inittime <- Sys.time()
2 2
 cat(paste("\n Starting at mutPropGrowth ", date(), "\n"))
3 3
 
4
+## I comment out a lot of the former cat's
5
+
6
+
4 7
 ## RNGkind("L'Ecuyer-CMRG") ## for the mclapplies
5 8
 ## If crashes I want to see where: thus output seed.
6 9
 ## The tests below can occasionally fail (but that probability decreases
7 10
 ## as we increase number of pops), as they should.
8 11
 
9
-cat("\n", date(), "\n") ## whole file takes about 16 seconds
12
+## cat("\n", date(), "\n") ## whole file takes about 16 seconds
10 13
 
11 14
 mutsPerClone <- function(x, per.pop.mean = TRUE) {
12 15
     perCl <- function(z)
... ...
@@ -34,7 +37,7 @@ test_that("mutPropGrowth diffs with s> 0, McFL", {
34 37
         ## in these models, but we stop on size to
35 38
         ## control for different  pop size. Now, time should be very similar, or we introduce a serious distorsion.
36 39
         
37
-        cat("\n mcf1: a runif is", runif(1), "\n")
40
+        ## cat("\n mcf1: a runif is", runif(1), "\n")
38 41
         ft <- 26  # 3 
39 42
         pops <- 50
40 43
         lni <- 100
... ...
@@ -43,7 +46,7 @@ test_that("mutPropGrowth diffs with s> 0, McFL", {
43 46
         names(ni) <- c("a", paste0("n", seq.int(lni)))
44 47
         ni <- sample(ni) ## scramble
45 48
         fe <- allFitnessEffects(noIntGenes = ni)
46
-        cat("\n mcf1a: a runif is", runif(1), "\n")
49
+        ## cat("\n mcf1a: a runif is", runif(1), "\n")
47 50
         nca <- oncoSimulPop(pops, fe, finalTime = ft, detectionProb = NA,
48 51
                             mutationPropGrowth = TRUE,
49 52
                             initSize = no,
... ...
@@ -51,7 +54,7 @@ test_that("mutPropGrowth diffs with s> 0, McFL", {
51 54
                             keepEvery = 1,
52 55
                             initMutant = "a", model = "McFL",
53 56
                             onlyCancer = FALSE, seed = NULL, mc.cores = 2)
54
-        cat("\n mcf1c: a runif is", runif(1), "\n")
57
+        ## cat("\n mcf1c: a runif is", runif(1), "\n")
55 58
         nca2 <- oncoSimulPop(pops, fe, finalTime = ft, detectionProb = NA,
56 59
                              mutationPropGrowth = FALSE,
57 60
                              initSize = no,
... ...
@@ -81,10 +84,10 @@ test_that("mutPropGrowth diffs with s> 0, McFL", {
81 84
         
82 85
         if(T1 && T2 && T3 && T4 && T5 && T6 && T7 && T8) break;
83 86
     }
84
-    cat(paste("\n done tries", tries, "\n"))
87
+    ## cat(paste("\n done tries", tries, "\n"))
85 88
     expect_true(T1 && T2 && T3 && T4 && T5 && T6 && T7 && T8)
86 89
 })
87
-cat("\n", date(), "\n")
90
+## cat("\n", date(), "\n")
88 91
 
89 92
 
90 93
 
... ...
@@ -99,7 +102,7 @@ test_that("mutPropGrowth diffs with s> 0, McFL, stop on time", {
99 102
         ## have been in the plateau for long
100 103
         
101 104
         
102
-        cat("\n mcf1_ontime: a runif is", runif(1), "\n")
105
+        ## cat("\n mcf1_ontime: a runif is", runif(1), "\n")
103 106
         ft <- 6 
104 107
         pops <- 50
105 108
         lni <- 100
... ...
@@ -109,7 +112,7 @@ test_that("mutPropGrowth diffs with s> 0, McFL, stop on time", {
109 112
         names(ni) <- c("a", paste0("n", seq.int(lni)))
110 113
         ni <- sample(ni) ## scramble
111 114
         fe <- allFitnessEffects(noIntGenes = ni)
112
-        cat("\n mcf1a: a runif is", runif(1), "\n")
115
+        ## cat("\n mcf1a: a runif is", runif(1), "\n")
113 116
         nca <- oncoSimulPop(pops, fe, finalTime = ft, detectionProb = NA,
114 117
                             mutationPropGrowth = TRUE,
115 118
                             initSize = no,
... ...
@@ -117,7 +120,7 @@ test_that("mutPropGrowth diffs with s> 0, McFL, stop on time", {
117 120
                             keepEvery = 1,
118 121
                             initMutant = "a", model = "McFL",
119 122
                             onlyCancer = FALSE, seed = NULL, mc.cores = 2)
120
-        cat("\n mcf1c: a runif is", runif(1), "\n")
123
+        ## cat("\n mcf1c: a runif is", runif(1), "\n")
121 124
         nca2 <- oncoSimulPop(pops, fe, finalTime = ft, detectionProb = NA,
122 125
                              mutationPropGrowth = FALSE,
123 126
                              initSize = no,
... ...
@@ -147,10 +150,10 @@ test_that("mutPropGrowth diffs with s> 0, McFL, stop on time", {
147 150
         
148 151
         if(T1 && T2 && T3 && T4 && T5 && T6 && T7 && T8) break;
149 152
     }
150
-    cat(paste("\n done tries", tries, "\n"))
153
+    ## cat(paste("\n done tries", tries, "\n"))
151 154
     expect_true(T1 && T2 && T3 && T4 && T5 && T6 && T7 && T8)
152 155
 })
153
-cat("\n", date(), "\n")
156
+## cat("\n", date(), "\n")
154 157
 
155 158
 
156 159
 
... ...
@@ -159,7 +162,7 @@ test_that("mutPropGrowth diffs with s> 0, oncoSimulSample", {
159 162
     max.tries <- 4
160 163
     for(tries in 1:max.tries) {
161 164
         T1 <- T2 <- T3 <- T4 <- T5 <- T6 <- T7 <- T8 <- TRUE
162
-        cat("\n oss1: a runif is", runif(1), "\n")
165
+        ## cat("\n oss1: a runif is", runif(1), "\n")
163 166
         
164 167
         ft <- 133 ## we stop on size way earlier 
165 168
         pops <- 50
... ...
@@ -171,7 +174,7 @@ test_that("mutPropGrowth diffs with s> 0, oncoSimulSample", {
171 174
         names(ni) <- c("a", paste0("n", seq.int(lni)))
172 175
         ni <- sample(ni) ## scramble
173 176
         fe <- allFitnessEffects(noIntGenes = ni)
174
-        cat("\n oss1a: a runif is", runif(1), "\n")
177
+        ## cat("\n oss1a: a runif is", runif(1), "\n")
175 178
         nca <- oncoSimulSample(pops, fe, finalTime = ft, detectionProb = NA,
176 179
                                mu = mu,
177 180
                                mutationPropGrowth = TRUE,
... ...
@@ -181,7 +184,7 @@ test_that("mutPropGrowth diffs with s> 0, oncoSimulSample", {
181 184
                                detectionSize = 1e6,
182 185
                                detectionDrivers = 99,
183 186