Browse code

Fix bugs in exportSCEtoSeurat. Add parallel param to scDblFinder. Fix typo in warning message in exportSCEtoAnndata

rz2333 authored on 13/04/2022 15:19:13
Showing 3 changed files

... ...
@@ -44,7 +44,7 @@ exportSCEtoAnnData <- function(sce,
44 44
             "If one of these have been previously run to install the modules,",
45 45
             "make sure to run selectSCTKConda() or selectSCTKVirtualEnvironment(),",
46 46
             " respectively, if R has been restarted since the module installation.",
47
-            " Alternatively, Scrublet can be installed on the local machine",
47
+            " Alternatively, 'scanpy' can be installed on the local machine",
48 48
             "with pip (e.g. pip install --user scanpy) and then the 'use_python()'",
49 49
             " function from the 'reticulate' package can be used to select the",
50 50
             " correct Python environment.")
... ...
@@ -68,7 +68,8 @@ runScDblFinder <- function(inSCE,
68 68
                             samples = sample,
69 69
                             artificialDoublets = simDoublets,
70 70
                             k = nNeighbors,
71
-                            verbose = FALSE
71
+                            verbose = FALSE,
72
+                            BPPARAM = BPPARAM
72 73
                             ))
73 74
   if(length(rm.ix) > 0){
74 75
     inSCE <- mergeSCEColData(inSCE1 = inSCEOrig, inSCE2 = inSCE)
... ...
@@ -1069,7 +1069,7 @@ convertSCEToSeurat <- function(inSCE, countsAssay = NULL, normAssay = NULL,
1069 1069
   if (length(SingleCellExperiment::reducedDims(inSCE)) > 0 && copyReducedDim) {
1070 1070
     for (redc in SingleCellExperiment::reducedDimNames(inSCE)) {
1071 1071
       reDim <- SingleCellExperiment::reducedDim(inSCE, redc)
1072
-      colnames(reDim) <- paste0(redc, "_", seq_len(length(colnames(reDim))))
1072
+      colnames(reDim) <- paste0(redc, "_", seq_len(ncol(reDim))) #length(colnames(reDim)))
1073 1073
       rownames(reDim) <- gsub('_', '-', rownames(reDim))
1074 1074
       key <-  gsub('_', '', redc)
1075 1075
       seuratObject@reductions[[redc]] <- Seurat::CreateDimReducObject(embeddings = reDim,