Browse code

Merge pull request #639 from salzcamino/master

Fix runVam defaults and Seurat report do.call issue

Joshua D. Campbell authored on 19/10/2022 18:55:56 • GitHub committed on 19/10/2022 18:55:56
Showing 3 changed files

... ...
@@ -16,14 +16,14 @@
16 16
 #' \code{resultNamePrefix_CDF}. If this parameter is set to \code{NULL}, then
17 17
 #' \code{"VAM_geneSetCollectionName_"} will be used. Default \code{NULL}.
18 18
 #' @param center Boolean. If \code{TRUE}, values will be mean centered when
19
-#' computing the Mahalanobis statistic. Default \code{TRUE}.
19
+#' computing the Mahalanobis statistic. Default \code{FALSE}.
20 20
 #' @param gamma Boolean. If \code{TRUE}, a gamma distribution will be fit to
21 21
 #' the non-zero squared Mahalanobis distances computed from a row-permuted
22 22
 #' version of the gene expression matrix. The estimated gamma distribution will
23 23
 #' be used to compute a one-sided p-value for each cell. If \code{FALSE}, the
24 24
 #' p-value will be computed using the standard chi-square approximation for the
25 25
 #' squared Mahalanobis distance (or non-central if \code{center = FALSE}).
26
-#' Default \code{FALSE}.
26
+#' Default \code{TRUE}.
27 27
 #' @importFrom methods slot
28 28
 #' @return A \linkS4class{SingleCellExperiment} object with VAM metrics stored
29 29
 #' in \code{reducedDim} as \code{VAM_NameOfTheGeneset_Distance} and
... ...
@@ -48,7 +48,7 @@
48 48
 #'               geneSetCollectionName = "GeneSetCollection",
49 49
 #'               useAssay = "logcounts")
50 50
 runVAM <- function(inSCE, geneSetCollectionName, useAssay,
51
-                   resultNamePrefix = NULL, center = TRUE, gamma = FALSE) {
51
+                   resultNamePrefix = NULL, center = FALSE, gamma = TRUE) {
52 52
   ###################################################
53 53
   ###  create gene set collection
54 54
   ###################################################
... ...
@@ -63,7 +63,8 @@ pcaParams <- list(
63 63
   inSCE = data,
64 64
   nPCs = pc.count,
65 65
   verbose = FALSE)
66
-data <- do.call("runSeuratPCA", pcaParams)
66
+#data <- do.call("runSeuratPCA", pcaParams)
67
+data <- runSeuratPCA(inSCE = data, nPCs = pc.count, verbose = FALSE)
67 68
 ```
68 69
 
69 70
 ```{r, echo=plotJackStraw, warning=FALSE, eval = plotJackStraw}
... ...
@@ -74,7 +75,8 @@ jackStrawParams <- list(
74 75
   numReplicate = 100,
75 76
   propFreq = 0.025
76 77
 )
77
-data <- do.call("runSeuratJackStraw", jackStrawParams)
78
+#data <- do.call("runSeuratJackStraw", jackStrawParams)
79
+data <- runSeuratJackStraw(data, useAssay = "seuratScaledData", dims = pc.count)
78 80
 ```
79 81
 
80 82
 ```{r, echo=FALSE, results='asis', include=plotElbowPlot, eval= plotElbowPlot}
... ...
@@ -152,7 +154,8 @@ pcHeatmapParams <- list(
152 154
   ncol = 4,
153 155
   fast = FALSE
154 156
 )
155
-heatmap <- do.call("runSeuratHeatmap", pcHeatmapParams)  
157
+#heatmap <- do.call("runSeuratHeatmap", pcHeatmapParams)  
158
+heatmap <- runSeuratHeatmap(inSCE = data, useAssay = "seuratScaledData", useReduction = "pca", dims = pc.count, balanced = TRUE, ncol = 4, fast = FALSE)
156 159
 heatmap
157 160
 ```
158 161
 
... ...
@@ -9,8 +9,8 @@ runVAM(
9 9
   geneSetCollectionName,
10 10
   useAssay,
11 11
   resultNamePrefix = NULL,
12
-  center = TRUE,
13
-  gamma = FALSE
12
+  center = FALSE,
13
+  gamma = TRUE
14 14
 )
15 15
 }
16 16
 \arguments{
... ...
@@ -29,7 +29,7 @@ output matrices will be \code{resultNamePrefix_Distance} and
29 29
 \code{"VAM_geneSetCollectionName_"} will be used. Default \code{NULL}.}
30 30
 
31 31
 \item{center}{Boolean. If \code{TRUE}, values will be mean centered when
32
-computing the Mahalanobis statistic. Default \code{TRUE}.}
32
+computing the Mahalanobis statistic. Default \code{FALSE}.}
33 33
 
34 34
 \item{gamma}{Boolean. If \code{TRUE}, a gamma distribution will be fit to
35 35
 the non-zero squared Mahalanobis distances computed from a row-permuted
... ...
@@ -37,7 +37,7 @@ version of the gene expression matrix. The estimated gamma distribution will
37 37
 be used to compute a one-sided p-value for each cell. If \code{FALSE}, the
38 38
 p-value will be computed using the standard chi-square approximation for the
39 39
 squared Mahalanobis distance (or non-central if \code{center = FALSE}).
40
-Default \code{FALSE}.}
40
+Default \code{TRUE}.}
41 41
 }
42 42
 \value{
43 43
 A \linkS4class{SingleCellExperiment} object with VAM metrics stored