Browse code

Removed paste from `message` and `stop`

Nick authored on 05/10/2022 22:51:19
Showing 1 changed files

... ...
@@ -143,9 +143,9 @@ generatePrototypes <- function(data, verbose = FALSE, size = NULL) {
143 143
       size <- size
144 144
     }
145 145
 
146
-    message(paste("Optimal Grid Size is: ", size))
146
+    message("Optimal Grid Size is: ", size)
147 147
   } else {
148
-    message(paste("You have provided a grid size of:", size * size))
148
+    message("You have provided a grid size of:", size * size)
149 149
   }
150 150
 
151 151
   # genearte the som grid based on the computed grid size
... ...
@@ -255,7 +255,7 @@ runFuseSOM <- function(data, markers = NULL, numClusters = NULL, assay = NULL,
255 255
 
256 256
   # if we have a dataframe or a matrix
257 257
   if (is(data, "data.frame") || is(data, "matrix")) {
258
-    message(paste("You have provided a dataset of class", class(data)[[1]]))
258
+    message("You have provided a dataset of class ", class(data)[[1]])
259 259
     # if no markers are given, make sure all the columns are numeric
260 260
     if (is.null(markers)) {
261 261
       numNumeric <- sum(apply(data, 2, function(x) is.numeric(x)))
... ...
@@ -269,11 +269,11 @@ runFuseSOM <- function(data, markers = NULL, numClusters = NULL, assay = NULL,
269 269
     }
270 270
   } else if (is(data, "SingleCellExperiment") || is(data, "SpatialExperiment")) { # if we have a single cell experiment object
271 271
     flag <- TRUE
272
-    message(paste("You have provided a dataset of class", class(data)[[1]]))
272
+    message("You have provided a dataset of class ", class(data)[[1]])
273 273
 
274 274
     # make sure an assay is provided
275 275
     if (is.null(assay)) {
276
-      stop(paste("If a", class(data)[[1]], "make sure the appropriate assay is provided as well"))
276
+      stop("If a ", class(data)[[1]], " make sure the appropriate assay is provided as well")
277 277
     }
278 278
     dataNew <- t(assay(data, assay))
279 279
 
... ...
@@ -389,7 +389,7 @@ estimateNumCluster <- function(data,
389 389
   # if we have a single cell experiment or spatial experiment object
390 390
   if (is(data, "SingleCellExperiment") || is(data, "SpatialExperiment")) {
391 391
     flag <- TRUE
392
-    message(paste("You have provided a dataset of class:", class(data)[[1]]))
392
+    message("You have provided a dataset of class: ", class(data)[[1]])
393 393
     somModel <- data@metadata$SOM
394 394
   } else { # if we just have the som model
395 395
     somModel <- data
... ...
@@ -482,7 +482,7 @@ optiPlot <- function(data, method = "jump") {
482 482
 
483 483
   # if we have a single cell experiment object
484 484
   if (is(data, "SingleCellExperiment") || is(data, "SpatialExperiment")) {
485
-    message(paste("You have provided a dataset of class:", class(data)[[1]]))
485
+    message("You have provided a dataset of class: ", class(data)[[1]])
486 486
     kEst <- data@metadata$clusterEstimation
487 487
   } else { # if we just have the som model
488 488
     kEst <- data