Browse code

Changed all T/F to TRUE/FALSE

Joshua D. Campbell authored on 13/10/2020 02:45:44
Showing 7 changed files

... ...
@@ -79,7 +79,7 @@
79 79
   
80 80
   ## Get merged rowData
81 81
   by.r <- unique(c('rownames', by.r))
82
-  unionFe <- Reduce(function(r1, r2) merge(r1, r2, by=by.r, all=T), feList)
82
+  unionFe <- Reduce(function(r1, r2) merge(r1, r2, by=by.r, all=TRUE), feList)
83 83
   allGenes <- unique(unlist(lapply(feList, rownames)))
84 84
   
85 85
   ## rowData
... ...
@@ -104,7 +104,7 @@
104 104
   })
105 105
   
106 106
   by.c <- unique(c("rownames", by.c))
107
-  unionCb <- Reduce(function(c1, c2) merge(c1, c2, by=by.c, all=T), cbList)
107
+  unionCb <- Reduce(function(c1, c2) merge(c1, c2, by=by.c, all=TRUE), cbList)
108 108
   rownames(unionCb) <- unionCb[['rownames']]
109 109
   newCbList <- list()
110 110
   for (i in seq_along(sceList)) {
... ...
@@ -234,7 +234,7 @@ combineSCE <- function(sceList, by.r, by.c, combined){
234 234
   assayList <- .mergeAssaySCE(sceList) 
235 235
   
236 236
   New_SCE <- list()
237
-  for (i in 1:length(sceList)) {
237
+  for (i in seq(length(sceList))) {
238 238
     ## create new sce
239 239
     New_SCE[[i]] <- .constructSCE(matrices = assayList[[i]], features = newFeList,
240 240
                                   barcodes = newCbList[[i]], 
... ...
@@ -249,4 +249,4 @@ combineSCE <- function(sceList, by.r, by.c, combined){
249 249
     return(sce)
250 250
   }
251 251
   return(New_SCE)
252
-}
253 252
\ No newline at end of file
253
+}
... ...
@@ -320,7 +320,7 @@ plotRunPerCellQCResults <- function(inSCE,
320 320
       plotlist <- c(merged.plots, list(Sample = plotlist))
321 321
     }
322 322
   } else {
323
-    plotlist <- unlist(plotlist, recursive=F)
323
+    plotlist <- unlist(plotlist, recursive=FALSE)
324 324
   }
325 325
 
326 326
   if(!is.null(combinePlot)){
... ...
@@ -709,7 +709,7 @@ plotScrubletResults <- function(inSCE,
709 709
       names(plotlist) <- samples
710 710
       plotlist <- c(merged.plots, list(Sample = plotlist))
711 711
   } else {
712
-      plotlist <- unlist(plotlist, recursive=F)
712
+      plotlist <- unlist(plotlist, recursive=FALSE)
713 713
   }
714 714
 
715 715
   if(!is.null(combinePlot)){
... ...
@@ -1061,7 +1061,7 @@ plotDoubletFinderResults <- function(inSCE,
1061 1061
       names(plotlist) <- samples
1062 1062
       plotlist <- c(merged.plots, list(Sample = plotlist))
1063 1063
   } else {
1064
-      plotlist <- unlist(plotlist, recursive=F)
1064
+      plotlist <- unlist(plotlist, recursive=FALSE)
1065 1065
   }
1066 1066
   if(!is.null(combinePlot)){
1067 1067
     if(combinePlot %in% c("all", "sample")){
... ...
@@ -1309,7 +1309,7 @@ plotDoubletCellsResults <- function(inSCE,
1309 1309
       names(plotlist) <- samples
1310 1310
       plotlist <- c(merged.plots, list(Sample = plotlist))
1311 1311
   } else {
1312
-      plotlist <- unlist(plotlist, recursive=F)
1312
+      plotlist <- unlist(plotlist, recursive=FALSE)
1313 1313
   }
1314 1314
   if(!is.null(combinePlot)){
1315 1315
     if(combinePlot %in% c("all", "sample")){
... ...
@@ -1578,7 +1578,7 @@ plotCxdsResults <- function(inSCE,
1578 1578
       names(plotlist) <- samples
1579 1579
       plotlist <- c(merged.plots, list(Sample = plotlist))
1580 1580
   } else {
1581
-      plotlist <- unlist(plotlist, recursive=F)
1581
+      plotlist <- unlist(plotlist, recursive=FALSE)
1582 1582
   }
1583 1583
   if(!is.null(combinePlot)){
1584 1584
     if(combinePlot %in% c("all", "sample")){
... ...
@@ -1847,7 +1847,7 @@ plotBcdsResults <- function(inSCE,
1847 1847
     names(plotlist) <- samples
1848 1848
     plotlist <- c(merged.plots, list(Sample = plotlist))
1849 1849
   } else {
1850
-    plotlist <- unlist(plotlist, recursive=F)
1850
+    plotlist <- unlist(plotlist, recursive=FALSE)
1851 1851
   }
1852 1852
   if(!is.null(combinePlot)){
1853 1853
     if(combinePlot %in% c("all", "sample")){
... ...
@@ -2116,7 +2116,7 @@ plotScdsHybridResults <- function(inSCE,
2116 2116
       names(plotlist) <- samples
2117 2117
       plotlist <- c(merged.plots, list(Sample = plotlist))
2118 2118
   } else {
2119
-      plotlist <- unlist(plotlist, recursive=F)
2119
+      plotlist <- unlist(plotlist, recursive=FALSE)
2120 2120
   }
2121 2121
   if(!is.null(combinePlot)){
2122 2122
     if(combinePlot %in% c("all", "sample")){
... ...
@@ -2382,7 +2382,7 @@ plotDecontXResults <- function(inSCE,
2382 2382
       names(plotlist) <- samples
2383 2383
       plotlist <- c(merged.plots, list(Sample = plotlist))
2384 2384
   } else {
2385
-      plotlist <- unlist(plotlist, recursive=F)
2385
+      plotlist <- unlist(plotlist, recursive=FALSE)
2386 2386
   }
2387 2387
   if(!is.null(combinePlot)){
2388 2388
     if(combinePlot %in% c("all", "sample")){
... ...
@@ -78,7 +78,7 @@ importMultipleSources <- function(allImportEntries) {
78 78
   return(combineSCE(sceList = sceObjs,
79 79
                     by.r = NULL,
80 80
                     by.c = Reduce(intersect, lapply(sceObjs, function(x) { colnames(colData(x))})),
81
-                    combined = T)
81
+                    combined = TRUE)
82 82
   )
83 83
 }
84 84
 
... ...
@@ -393,87 +393,3 @@ qcInputProcess <- function(preproc,
393 393
     stop(paste0("'", preproc, "' not supported."))
394 394
 }
395 395
 
396
-
397
-#' Imports samples from different sources and compiles them into a list of SCE objects
398
-#' @param allImportEntries object containing the sources and parameters of all the samples being imported (from the UI)
399
-#' @return A list of \link[SingleCellExperiment]{SingleCellExperiment} object containing
400
-#' the droplet or cell data or both,depending on the dataType that users provided.
401
-#' @export
402
-importMultipleSources <- function(allImportEntries) {
403
-  sceObjs <- list()
404
-  for (entry in allImportEntries$samples) {
405
-    if (entry$type == "cellRanger2") {
406
-      if (is.null(entry$params$cellRangerDirs)) {
407
-        newSce <- importCellRangerV2Sample(
408
-          dataDir = entry$params$dataDir,
409
-          sampleName = entry$params$sampleName,
410
-        )
411
-      } else {
412
-        newSce <- importCellRangerV2(
413
-          cellRangerDirs = entry$params$cellRangerDirs,
414
-          sampleDirs = entry$params$sampleDirs,
415
-          sampleNames = entry$params$sampleNames,
416
-        )
417
-      }
418
-
419
-    } else if (entry$type == "cellRanger3") {
420
-      if (is.null(entry$params$cellRangerDirs)) {
421
-        newSce <- importCellRangerV3Sample(
422
-          dataDir = entry$params$dataDir,
423
-          sampleName = entry$params$sampleName,
424
-        )
425
-      } else {
426
-        newSce <- importCellRangerV3(
427
-          cellRangerDirs = entry$params$cellRangerDirs,
428
-          sampleDirs = entry$params$sampleDirs,
429
-          sampleNames = entry$params$sampleNames,
430
-        )
431
-      }
432
-    } else if (entry$type == "starSolo") {
433
-      newSce <- importSTARsolo(
434
-        STARsoloDirs = entry$params$STARsoloDirs,
435
-        samples = entry$params$amples
436
-      )
437
-    } else if (entry$type == "busTools") {
438
-      newSce <- importBUStools(
439
-        BUStoolsDirs = entry$params$BUStoolsDirs,
440
-        samples = entry$params$samples,
441
-      )
442
-    } else if (entry$type == "seqc") {
443
-      newSce <- importSEQC(
444
-        seqcDirs = entry$params$seqcDirs,
445
-        samples = entry$params$samples,
446
-        prefix = entry$params$prefix,
447
-      )
448
-    } else if (entry$type == "optimus") {
449
-      newSce <- importOptimus(
450
-        OptimusDirs = entry$params$OptimusDirs,
451
-        samples = entry$params$samples
452
-      )
453
-    } else if (entry$type == "files") {
454
-      newSce <- importFromFiles(assayFile = entry$params$assayFile,
455
-                                annotFile = entry$params$annotFile,
456
-                                featureFile = entry$params$featureFile,
457
-                                assayName = entry$params$assayName)
458
-    } else if (entry$type == "example") {
459
-      newSce <- withConsoleMsgRedirect(importExampleData(dataset = entry$params$dataset))
460
-    } else if (entry$type == "rds") {
461
-      importedrds <- readRDS(entry$params$rdsFile)
462
-      if (base::inherits(importedrds, "SummarizedExperiment")) {
463
-        newSce <- importedrds
464
-      } else if (base::inherits(importedrds, "Seurat")) {
465
-        newSce <- convertSeuratToSCE(importedrds)
466
-      } else {
467
-        shiny::showNotification("The '.rds' file should contain a 'SingleCellExperiment' or 'Seurat' object.", type = "error")
468
-      }
469
-    }
470
-    sceObjs = c(sceObjs, list(newSce))
471
-  }
472
-
473
-  return(combineSCE(sceList = sceObjs,
474
-                    by.r = NULL,
475
-                    by.c = Reduce(intersect, lapply(sceObjs, function(x) { colnames(colData(x))})),
476
-                    combined = T)
477
-         )
478
-}
479
-
... ...
@@ -67,11 +67,11 @@ subTitle <- params$subTitle
67 67
 studyDesign <- params$studyDesign
68 68
 samples <- unique(colData(sce.qc)$sample)
69 69
 
70
-reduceDims<- grep('UMAP', reducedDimNames(sce.qc), value = T)
70
+reduceDims<- grep('UMAP', reducedDimNames(sce.qc), value = TRUE)
71 71
 if (length(reduceDims) != 0) {
72 72
   reduceDimUsed <- reduceDims[1]
73 73
 } else {
74
-  reduceDims<- grep('TSNE', reducedDimNames(sce.qc), value = T)
74
+  reduceDims<- grep('TSNE', reducedDimNames(sce.qc), value = TRUE)
75 75
   if (length(reduceDims) == 0) {
76 76
     stop("No reduced dimension are available for QC visualization!")
77 77
   } else {
... ...
@@ -211,9 +211,9 @@ showQCResTabs <- function(obj, algoList, statuses, plotIds) {
211 211
     algo <- algoList[[i]]
212 212
     id <- paste0(algo, "Tab")
213 213
     if (is.null(statuses[[algo]])) {
214
-      selectTab <- F
214
+      selectTab <- FALSE
215 215
       if (i == 1) {
216
-        selectTab <- T
216
+        selectTab <- TRUE
217 217
       } 
218 218
       appendTab("qcResPlotTabs", tabPanel(algo, 
219 219
                                           fluidPage(id = id, 
... ...
@@ -41,7 +41,7 @@ shinyPanelQC <- fluidPage(
41 41
                      numericInput("DXdbscanEps", "dbscanEps - Clustering resolution parameter (if no cell cluster labels) (default 1)", 1),
42 42
                      
43 43
                      checkboxInput("DXestDelta", "estimateDelta - Estimate delta?"), # T/F input
44
-                     checkboxInput("DXverbose", "verbose - Print log messages?", value = T), # T/F input
44
+                     checkboxInput("DXverbose", "verbose - Print log messages?", value = TRUE), # T/F input
45 45
             )
46 46
           ),
47 47
           tags$hr(),
... ...
@@ -67,7 +67,7 @@ shinyPanelQC <- fluidPage(
67 67
                      numericInput("CXntop", "ntop - Number of top variance genes (default 500)", 500),
68 68
                      numericInput("CXbinThresh", "binThresh - Threshold to consider a gene 'present' (default 0)", 0),
69 69
                      
70
-                     checkboxInput("CXverb", "verb - Output progress messages?", value = T), # T/F input
70
+                     checkboxInput("CXverb", "verb - Output progress messages?", value = TRUE), # T/F input
71 71
                      checkboxInput("CXretRes", "retRes - Return gene pair scores and top-scoring gene pairs?"), # T/F input
72 72
                      checkboxInput("CXestNdbl", "estNdbl - Estimate the number of doublets?"), # T/F input
73 73
             )
... ...
@@ -84,7 +84,7 @@ shinyPanelQC <- fluidPage(
84 84
                      
85 85
                      textInput("BCnmax", "nmax - Max number of training rounds (default 'tune')", value = "tune"),
86 86
                      
87
-                     checkboxInput("BCverb", "verb - Output progress messages?", value = T), # T/F input
87
+                     checkboxInput("BCverb", "verb - Output progress messages?", value = TRUE), # T/F input
88 88
                      checkboxInput("BCretRes", "retRes - Return trained classifier?"), # T/F input
89 89
                      checkboxInput("BCvarImp", "varImp - Return variable importance?"), # T/F input
90 90
                      checkboxInput("BCestNdbl", "estNdbl - Estimate the number of doublets?"), # T/F input
... ...
@@ -110,8 +110,8 @@ shinyPanelQC <- fluidPage(
110 110
                      checkboxInput("BC2retRes", "retRes - Return trained classifier?"), # T/F input
111 111
                      checkboxInput("BC2varImp", "varImp - Return variable importance?"), # T/F input
112 112
                      
113
-                     checkboxInput("CXBCverb", "verb - Output bcds progress messages?", value = T), # T/F input
114
-                     checkboxInput("CXBCestNdbl", "estNdbl - Estimate the number of doublets?", value = T), # T/F input
113
+                     checkboxInput("CXBCverb", "verb - Output bcds progress messages?", value = TRUE), # T/F input
114
+                     checkboxInput("CXBCestNdbl", "estNdbl - Estimate the number of doublets?", value = TRUE), # T/F input
115 115
             )
116 116
           ),
117 117
           # scrublet
... ...
@@ -136,12 +136,12 @@ shinyPanelQC <- fluidPage(
136 136
                      
137 137
                      textInput("SdistanceMetric", "distanceMetric - Distance metric", value = "euclidean"),
138 138
 
139
-                     checkboxInput("SuseApproxNeighbors", "useApproxNeighbors - Use approximate nearest neighbor method?", value = T), # T/F input
139
+                     checkboxInput("SuseApproxNeighbors", "useApproxNeighbors - Use approximate nearest neighbor method?", value = TRUE), # T/F input
140 140
                      checkboxInput("SgetDoubletNeighborParents", "getDoubletNeighborParents - Return doublet neighbors' parent transcriptomes?"), # T/F input
141 141
                      checkboxInput("SlogTransform", "logTransform - Log transform counts matrix?"), # T/F input
142
-                     checkboxInput("SmeanCenter", "meanCenter - Center each gene's data at zero?", value = T), # T/F input
143
-                     checkboxInput("SnormalizeVariance", "normalizeVariance - Normalize each gene's data to have a variance of 1?", value = T), # T/F input
144
-                     checkboxInput("Sverbose", "verbose - Output progress updates?", value = T), # T/F input
142
+                     checkboxInput("SmeanCenter", "meanCenter - Center each gene's data at zero?", value = TRUE), # T/F input
143
+                     checkboxInput("SnormalizeVariance", "normalizeVariance - Normalize each gene's data to have a variance of 1?", value = TRUE), # T/F input
144
+                     checkboxInput("Sverbose", "verbose - Output progress updates?", value = TRUE), # T/F input
145 145
             )
146 146
           ),
147 147
           # doubletFinder
... ...
@@ -156,7 +156,7 @@ shinyPanelQC <- fluidPage(
156 156
                      numericInput("DFformationRate", "formationRate - Doublet formation rate (default 0.075)", 0.075),
157 157
                      numericInput("DFseuratPcs", "seuratPcs - PCs to determine the number of clusters (default 15)", 15),
158 158
                      
159
-                     checkboxInput("DFverbose", "verbose - Output log messages?", value = T), # T/F input
159
+                     checkboxInput("DFverbose", "verbose - Output log messages?", value = TRUE), # T/F input
160 160
             )
161 161
           ),
162 162
           tags$hr(),