Browse code

Merge conflict

... ...
@@ -53,7 +53,7 @@ exportSCEtoAnnData <- function(sce,
53 53
   
54 54
   AssayName <- SummarizedExperiment::assayNames(sce)
55 55
   for (assay in AssayName){
56
-    if (!is(SummarizedExperiment::assay(sce, assay), 'dgCMatrix')) {
56
+    if (!methods::is(SummarizedExperiment::assay(sce, assay), 'dgCMatrix')) {
57 57
       SummarizedExperiment::assay(sce, assay) <- .convertToMatrix(SummarizedExperiment::assay(sce, assay))
58 58
     }
59 59
   }
... ...
@@ -597,9 +597,9 @@ importCellRanger <- function(
597 597
 #' # 2.1.0/pbmc4k
598 598
 #' # All genes are kept. 840 cell barcodes are extracted.
599 599
 #' sce <- importCellRangerV2(
600
-#'     cellRangerDirs = system.file("extdata/pbmc_4k_v2_200x800", package = "singleCellTK"),
601
-#'     sampleDirs = "pbmc_800",
602
-#'     sampleNames = "pbmc4k_800",
600
+#'     cellRangerDirs = system.file("extdata/", package = "singleCellTK"),
601
+#'     sampleDirs = "pbmc_4k_v2_200x400",
602
+#'     sampleNames = "pbmc4k_400",
603 603
 #'     reference = 'GRCh38',
604 604
 #'     dataTypeV2 = "filtered")
605 605
 #' @export
... ...
@@ -662,9 +662,9 @@ importCellRangerV2 <- function(
662 662
 #'  matrix, the feature annotations, and the cell annotation for the sample.
663 663
 #' @examples
664 664
 #' sce <- importCellRangerV2Sample(
665
-#'     dataDir = system.file("extdata/pbmc_4k_v2_200x800/pbmc_800/outs/",
665
+#'     dataDir = system.file("extdata/pbmc_4k_v2_200x400/outs/",
666 666
 #'         "filtered_gene_bc_matrices/GRCh38", package = "singleCellTK"),
667
-#'     sampleName = "pbmc800")
667
+#'     sampleName = "pbmc400")
668 668
 #' @export
669 669
 importCellRangerV2Sample <- function(
670 670
     dataDir = NULL,
... ...
@@ -277,7 +277,7 @@ distinctColors <- function(n, hues = c("red", "cyan", "orange", "blue",
277 277
   for (i in 1:chuN) {
278 278
     start <- (i-1)*chuS + 1
279 279
     end <- min(i*chuS, dimN[2])
280
-    if (is(x, 'DelayedMatrix')) {
280
+    if (methods::is(x, 'DelayedMatrix')) {
281 281
       Mat[[i]] <- methods::as(x[, start:end], "Matrix") # Efficient way to convert DelayedArray to dgCMatrix
282 282
     } else {
283 283
       Mat[[i]] <- methods::as(x[, start:end], "dgCMatrix") # Convert dgTMatrix to dgCMatrix
... ...
@@ -185,7 +185,7 @@ runScrublet <- function(inSCE,
185 185
                                               n_neighbors=as.integer(nNeighbors), 
186 186
                                               min_dist=minDist)
187 187
       }
188
-      reducedDim(inSCE,'UMAP') <- umap_coordinates
188
+      reducedDim(inSCE,'scrublet_UMAP') <- umap_coordinates
189 189
     
190 190
     if (is.null(tsneAngle) && is.null(tsnePerplexity)){
191 191
       tsne_coordinates <- scrublet$get_tsne(scr$manifold_obs_)
... ...
@@ -194,7 +194,7 @@ runScrublet <- function(inSCE,
194 194
                                             angle=tsneAngle, 
195 195
                                             perplexity=as.integer(tsnePerplexity))
196 196
     }
197
-    reducedDim(inSCE,'TSNE') <- tsne_coordinates
197
+    reducedDim(inSCE,'scrublet_TSNE') <- tsne_coordinates
198 198
   }
199 199
     
200 200
     colData(inSCE) = cbind(colData(inSCE), output)
... ...
@@ -47,7 +47,7 @@ sceOutput <- function(dropletSCE, filteredSCE, samplename, directory){
47 47
     
48 48
         ## Export to Python AnnData
49 49
         fn <- file.path(directory, samplename, "Python", "Droplets")
50
-        exportSCEtoAnnData(mergedDropletSCE, outputDir=fn, compression='gzip', sample=samplename)
50
+        exportSCEtoAnnData(mergedDropletSCE, outputDir=fn, compression='gzip', prefix=samplename)
51 51
     }
52 52
 
53 53
     if (!is.null(mergedFilteredSCE)) {
... ...
@@ -61,7 +61,7 @@ sceOutput <- function(dropletSCE, filteredSCE, samplename, directory){
61 61
         
62 62
         ## Export to Python AnnData
63 63
         fn <- file.path(directory, samplename, "Python", "FilteredCells")
64
-        exportSCEtoAnnData(mergedFilteredSCE, outputDir=fn, compression='gzip', sample=samplename)
64
+        exportSCEtoAnnData(mergedFilteredSCE, outputDir=fn, compression='gzip', prefix=samplename)
65 65
   }
66 66
 }
67 67
 
68 68
similarity index 100%
69 69
rename from inst/extdata/pbmc_4k_v2_200x800/pbmc_800/outs/filtered_gene_bc_matrices/GRCh38/barcodes.tsv
70 70
rename to inst/extdata/pbmc_4k_v2_200x400/outs/filtered_gene_bc_matrices/GRCh38/barcodes.tsv
71 71
similarity index 100%
72 72
rename from inst/extdata/pbmc_4k_v2_200x800/pbmc_800/outs/filtered_gene_bc_matrices/GRCh38/genes.tsv
73 73
rename to inst/extdata/pbmc_4k_v2_200x400/outs/filtered_gene_bc_matrices/GRCh38/genes.tsv
74 74
similarity index 100%
75 75
rename from inst/extdata/pbmc_4k_v2_200x800/pbmc_800/outs/filtered_gene_bc_matrices/GRCh38/matrix.mtx
76 76
rename to inst/extdata/pbmc_4k_v2_200x400/outs/filtered_gene_bc_matrices/GRCh38/matrix.mtx
77 77
similarity index 100%
78 78
rename from inst/extdata/pbmc_4k_v2_200x800/pbmc_800/outs/raw_gene_bc_matrices/GRCh38/barcodes.tsv
79 79
rename to inst/extdata/pbmc_4k_v2_200x400/outs/raw_gene_bc_matrices/GRCh38/barcodes.tsv
80 80
similarity index 100%
81 81
rename from inst/extdata/pbmc_4k_v2_200x800/pbmc_800/outs/raw_gene_bc_matrices/GRCh38/genes.tsv
82 82
rename to inst/extdata/pbmc_4k_v2_200x400/outs/raw_gene_bc_matrices/GRCh38/genes.tsv
83 83
similarity index 100%
84 84
rename from inst/extdata/pbmc_4k_v2_200x800/pbmc_800/outs/raw_gene_bc_matrices/GRCh38/matrix.mtx
85 85
rename to inst/extdata/pbmc_4k_v2_200x400/outs/raw_gene_bc_matrices/GRCh38/matrix.mtx
... ...
@@ -202,9 +202,9 @@ sce <- importCellRanger(
202 202
 # 2.1.0/pbmc4k
203 203
 # All genes are kept. 840 cell barcodes are extracted.
204 204
 sce <- importCellRangerV2(
205
-    cellRangerDirs = system.file("extdata/pbmc_4k_v2_200x800", package = "singleCellTK"),
206
-    sampleDirs = "pbmc_800",
207
-    sampleNames = "pbmc4k_800",
205
+    cellRangerDirs = system.file("extdata/", package = "singleCellTK"),
206
+    sampleDirs = "pbmc_4k_v2_200x400",
207
+    sampleNames = "pbmc4k_400",
208 208
     reference = 'GRCh38',
209 209
     dataTypeV2 = "filtered")
210 210
 sce <- importCellRangerV3(
... ...
@@ -36,7 +36,7 @@ Read the filtered barcodes, features, and matrices for all
36 36
 }
37 37
 \examples{
38 38
 sce <- importCellRangerV2Sample(
39
-    dataDir = system.file("extdata/pbmc_4k_v2_200x800/pbmc_800/outs/",
39
+    dataDir = system.file("extdata/pbmc_4k_v2_200x400/outs/",
40 40
         "filtered_gene_bc_matrices/GRCh38", package = "singleCellTK"),
41
-    sampleName = "pbmc800")
41
+    sampleName = "pbmc400")
42 42
 }