Browse code

2.16.1; fixed warnings and "the condition has length > 1"

ramon diaz-uriarte (at Phelsuma) authored on 10/04/2020 12:23:01
Showing6 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.16.0
5
-Date: 2019-08-14
4
+Version: 2.16.1
5
+Date: 2020-04-10
6 6
 Authors@R: c(person("Ramon", "Diaz-Uriarte", role = c("aut", "cre"),
7 7
 		     email = "rdiaz02@gmail.com"),
8 8
 	      person("Mark", "Taylor", role = "ctb", email = "ningkiling@gmail.com"))
... ...
@@ -1058,9 +1058,11 @@ plot.oncosimul <- function(x,
1058 1058
     
1059 1059
 
1060 1060
     colauto <- FALSE
1061
-    if(col == "auto" && (type == "line") && (show == "drivers"))
1061
+    if((length(col) ==1) && (col == "auto") &&
1062
+       (type == "line") && (show == "drivers"))
1062 1063
         col <- c(8, "orange", 6:1)
1063
-    if(col == "auto" && (show == "genotypes")) {
1064
+    if((length(col) ==1) && (col == "auto") &&
1065
+       (show == "genotypes")) {
1064 1066
         ## For categorical data, I find Dark2, Paired, or Set1 to work best.
1065 1067
         col <- colorRampPalette(brewer.pal(8, "Dark2"))(ncol(x$pops.by.time) - 1)
1066 1068
         colauto <- TRUE
... ...
@@ -542,8 +542,9 @@ allFitnessORMutatorEffects <- function(rT = NULL,
542 542
         gnum <- seq_along(noIntGenes) + mg
543 543
         if(!is.null(names(noIntGenes))) {
544 544
             ng <- names(noIntGenes)
545
-            if( grepl(",", ng, fixed = TRUE) || grepl(">", ng, fixed = TRUE)
546
-                || grepl(":", ng, fixed = TRUE))
545
+            if( any(grepl(",", ng, fixed = TRUE)) ||
546
+                any(grepl(">", ng, fixed = TRUE)) ||
547
+                any(grepl(":", ng, fixed = TRUE))   )
547 548
                 stop("The name of some noIntGenes contain a ',' or a '>' or a ':'")
548 549
             if(any(ng %in% geneModule[, "Gene"] ))
549 550
                 stop("A gene in noIntGenes also present in the other terms")
... ...
@@ -1,3 +1,8 @@
1
+Changes in version 2.16.1 (2020-04-10):
2
+	- Fixed warning from POM and LOD help (undocumented ...)
3
+	- Dealing with "the condition has length > 1" and
4
+	  "length(x) = 5 > 1' in coercion to 'logical(1)' errors.
5
+
1 6
 Changes in version 2.15.2 (2019-08-14):
2 7
 	- Trying to prevent fscanf warning in FitnessLandscape/input.c
3 8
 
... ...
@@ -46,7 +46,7 @@ diversityLOD(llod)
46 46
 \item{llod}{A list of LODs, as returned from \code{LOD} on an object of
47 47
   class \code{oncosimulpop}.}
48 48
 
49
-\item{...}{Other arguments passed to methods (ignored now).}
49
+% \item{...}{Other arguments passed to methods (ignored now).}
50 50
 }
51 51
 
52 52
 \details{
... ...
@@ -218,7 +218,7 @@ test_that("LOD, strict, same as would be obtained from full structure, with init
218 218
         loda <- OncoSimulR:::LOD.oncosimul2_pre_2.9.2(s7b, strict = FALSE)
219 219
         ## we need this because o.w. the old output it ain't an igraph
220 220
         ## object with names
221
-        if(!grepl("_is_end", lods) && !grepl("No_descendants", lods)) {
221
+        if(!any(grepl("_is_end", lods)) && !any(grepl("No_descendants", lods))) {
222 222
             ## lods should be among the loda
223 223
             if(!is.null(s7$pops.by.time)) {
224 224
                 expect_true(any(
... ...
@@ -230,7 +230,7 @@ test_that("LOD, strict, same as would be obtained from full structure, with init
230 230
                                           lods))
231 231
                 }
232 232
             }
233
-        } else if (grepl("No_descendants", lods)) {
233
+        } else if (any(grepl("No_descendants", lods))) {
234 234
             expect_true(identical(loda$lod_single,
235 235
                                   lods)) 
236 236
         } else {