Browse code

update function documentation

Akshay Aravind authored on 29/01/2024 18:19:13
Showing 23 changed files

... ...
@@ -315,7 +315,8 @@ importGeneSetsFromCollection <- function(inSCE, geneSetCollection,
315 315
 #' @param inSCE Input \linkS4class{SingleCellExperiment} object.
316 316
 #' @param categoryIDs Character vector containing the MSigDB gene set ids.
317 317
 #' The column \code{ID} in the table returned by \code{getMSigDBTable()} shows
318
-#' the list of possible gene set IDs that can be obtained.
318
+#' the list of possible gene set IDs that can be obtained. 
319
+#' Default is \code{"H"}.
319 320
 #' @param species Character. Species available can be found using the function
320 321
 #' \code{\link[msigdbr]{msigdbr_show_species}}. Default \code{"Homo sapiens"}.
321 322
 #' @param mapping Character. One of "gene_symbol", "human_gene_symbol", or
... ...
@@ -2,7 +2,7 @@
2 2
 #' and UMAP
3 3
 #'
4 4
 #' @param inSCE Input SCE object
5
-#' @param useReduction Reduction to plot
5
+#' @param useReduction Reduction to plot. Default is \code{"PCA"}.
6 6
 #' @param showLegend If legends should be plotted or not
7 7
 #' @param xDim Numeric value indicating the dimension to use for X-axis.
8 8
 #'  Default is 1 (refers to PC1).
... ...
@@ -8,9 +8,9 @@
8 8
 #' name to store a logical index of selected features. Default \code{NULL}. See
9 9
 #' details.
10 10
 #' @param hvgNumber Specify the number of top genes to highlight in red. Default
11
-#' \code{NULL}. See details.
11
+#' \code{2000}. See details.
12 12
 #' @param labelsCount Specify the number of data points/genes to label. Should
13
-#' be less than \code{hvgNumber}. Default \code{20}. See details.
13
+#' be less than \code{hvgNumber}. Default \code{10}. See details.
14 14
 #' @param featureDisplay A character string for the \code{rowData} variable name
15 15
 #' to indicate what type of feature ID should be displayed. If set by
16 16
 #' \code{\link{setSCTKDisplayRow}}, will by default use it. If \code{NULL}, will
... ...
@@ -6,7 +6,7 @@
6 6
 #' @param inSCE A \linkS4class{SingleCellExperiment} object.
7 7
 #' @param useReducedDim A single \code{character}, specifying which
8 8
 #' low-dimension representation (\code{\link{reducedDim}})
9
-#' to perform the clustering algorithm on. Default \code{NULL}.
9
+#' to perform the clustering algorithm on. Default \code{"PCA"}.
10 10
 #' @param useAssay A single \code{character}, specifying which
11 11
 #' \code{\link{assay}} to perform the clustering algorithm
12 12
 #' on. Default \code{NULL}.
... ...
@@ -23,15 +23,15 @@
23 23
 #' \code{NULL}.
24 24
 #' @param clusterName A single \code{character}, specifying the name to store
25 25
 #' the cluster label in \code{\link{colData}}. Default
26
-#' \code{"scranSNN_cluster"}.
26
+#' \code{"cluster"}.
27 27
 #' @param k An \code{integer}, the number of nearest neighbors used to construct
28 28
 #' the graph. Smaller value indicates higher resolution and larger number of
29
-#' clusters. Default \code{8}.
29
+#' clusters. Default \code{14}.
30 30
 #' @param nComp An \code{integer}. The number of components to use for graph
31 31
 #' construction. Default \code{10}. See Detail.
32 32
 #' @param weightType A single \code{character}, that specifies the edge weighing
33 33
 #' scheme when constructing the Shared Nearest-Neighbor (SNN) graph. Choose from
34
-#' \code{"rank"}, \code{"number"}, \code{"jaccard"}. Default \code{"rank"}.
34
+#' \code{"rank"}, \code{"number"}, \code{"jaccard"}. Default \code{"jaccard"}.
35 35
 #' @param algorithm A single \code{character}, that specifies the community
36 36
 #' detection algorithm to work on the SNN graph. Choose from \code{"leiden"},
37 37
 #' \code{"louvain"}, \code{"walktrap"}, \code{"infomap"}, \code{"fastGreedy"},
... ...
@@ -205,16 +205,19 @@
205 205
 #' compared with all other cells. Default \code{NULL}.
206 206
 #' @param class A vector/factor with \code{ncol(inSCE)} elements, or a character
207 207
 #' scalar that specifies a column name of \code{colData(inSCE)}. Default
208
-#' \code{NULL}.
208
+#' \code{"cluster"}.
209 209
 #' @param classGroup1 a vector specifying which "levels" given in \code{class}
210
-#' are of interests. Default \code{NULL}.
210
+#' are of interests. Default \code{c(1)}.
211 211
 #' @param classGroup2 a vector specifying which "levels" given in \code{class}
212 212
 #' is the control group against those specified by \code{classGroup1}. If
213 213
 #' \code{NULL} when using annotation specification, \code{classGroup1} cells
214
-#' will be compared with all other cells.
215
-#' @param analysisName A character scalar naming the DEG analysis. Required
216
-#' @param groupName1 A character scalar naming the group of interests. Required.
217
-#' @param groupName2 A character scalar naming the control group. Required.
214
+#' will be compared with all other cells. Default \code{c(2)}.
215
+#' @param analysisName A character scalar naming the DEG analysis. 
216
+#' Default \code{"cluster1_VS_2"}.
217
+#' @param groupName1 A character scalar naming the group of interests. 
218
+#' Default \code{"cluster1"}.
219
+#' @param groupName2 A character scalar naming the control group. 
220
+#' Default \code{"cluster2"}.
218 221
 #' @param covariates A character vector of additional covariates to use when
219 222
 #' building the model. All covariates must exist in
220 223
 #' \code{names(colData(inSCE))}. Default \code{NULL}.
... ...
@@ -14,7 +14,7 @@
14 14
 #' raw counts for \code{"vst"} method, or a normalized assay for other methods.
15 15
 #' @param method Specify the method to use for variable gene selection.
16 16
 #' Options include \code{"vst"}, \code{"mean.var.plot"} or \code{"dispersion"}
17
-#' from Seurat and \code{"modelGeneVar"} from Scran.
17
+#' from Seurat and \code{"modelGeneVar"} from Scran. Default \code{"modelGeneVar"}
18 18
 #' @return The input \linkS4class{SingleCellExperiment} object that contains 
19 19
 #' the computed statistics in the \code{rowData} slot
20 20
 #' @seealso \code{\link{runModelGeneVar}}, \code{\link{runSeuratFindHVG}},
... ...
@@ -17,7 +17,7 @@
17 17
 #' "mouse", "zeisel"}. See detail. Default \code{"hpca"}.
18 18
 #' @param level A string for cell type labeling level. Used only when using
19 19
 #' some of the SingleR built-in references. Choose from \code{"main", "fine",
20
-#' "ont"}. Default \code{"main"}.
20
+#' "ont"}. Default \code{"fine"}.
21 21
 #' @param featureType A string for whether to use gene symbols or Ensembl IDs
22 22
 #' when using a SingleR built-in reference. Should be set based on the type of
23 23
 #' \code{rownames} of \code{inSCE}. Choose from \code{"symbol", "ensembl"}.
... ...
@@ -43,7 +43,7 @@
43 43
 #' @param pca Logical. Whether to perform dimension reduction with PCA before
44 44
 #' UMAP. Ignored when using \code{useReducedDim}. Default \code{TRUE}.
45 45
 #' @param initialDims Number of dimensions from PCA to use as input in UMAP.
46
-#' Default \code{25}.
46
+#' Default \code{10}.
47 47
 #' @param nNeighbors The size of local neighborhood used for manifold
48 48
 #' approximation. Larger values result in more global views of the manifold,
49 49
 #' while smaller values result in more local data being preserved. Default
... ...
@@ -7,9 +7,9 @@
7 7
 #' as \link{importGeneSetsFromList} or \link{importGeneSetsFromMSigDB}
8 8
 #' @param inSCE Input \linkS4class{SingleCellExperiment} object.
9 9
 #' @param geneSetCollectionName Character. The name of the gene set collection
10
-#' to use.
10
+#' to use. Default \code{"H"}.
11 11
 #' @param useAssay Character. The name of the assay to use. This assay should
12
-#' contain log normalized counts.
12
+#' contain log normalized counts. Default \code{"logcounts"}.
13 13
 #' @param resultNamePrefix  Character. Prefix to the name the VAM results which
14 14
 #' will be stored in the reducedDim slot of \code{inSCE}. The names of the
15 15
 #' output matrices will be \code{resultNamePrefix_Distance} and
... ...
@@ -9,7 +9,7 @@
9 9
 #' @param useFeatureSubset Subset of feature to use for dimension reduction. A
10 10
 #' character string indicating a \code{rowData} variable that stores the logical
11 11
 #' vector of HVG selection, or a vector that can subset the rows of
12
-#' \code{inSCE}. Default \code{NULL}.
12
+#' \code{inSCE}. Default \code{"hvg2000"}.
13 13
 #' @param scale Logical scalar, whether to standardize the expression values.
14 14
 #' Default \code{TRUE}.
15 15
 #' @param reducedDimName Name to use for the reduced output assay. Default
... ...
@@ -7,12 +7,12 @@
7 7
 \usage{
8 8
 getFindMarkerTopTable(
9 9
   inSCE,
10
-  log2fcThreshold = 1,
10
+  log2fcThreshold = 0,
11 11
   fdrThreshold = 0.05,
12
-  minClustExprPerc = 0.7,
13
-  maxCtrlExprPerc = 0.4,
14
-  minMeanExpr = 1,
15
-  topN = 10
12
+  minClustExprPerc = 0.5,
13
+  maxCtrlExprPerc = 0.5,
14
+  minMeanExpr = 0,
15
+  topN = 1
16 16
 )
17 17
 
18 18
 findMarkerTopTable(
... ...
@@ -10,16 +10,15 @@ getTopHVG(
10 10
   method = c("vst", "dispersion", "mean.var.plot", "modelGeneVar", "seurat", "seurat_v3",
11 11
     "cell_ranger"),
12 12
   hvgNumber = 2000,
13
-  useFeatureSubset = NULL,
13
+  useFeatureSubset = "hvg2000",
14 14
   featureDisplay = metadata(inSCE)$featureDisplay
15 15
 )
16 16
 
17 17
 setTopHVG(
18 18
   inSCE,
19
-  method = c("vst", "dispersion", "mean.var.plot", "modelGeneVar", "seurat", "seurat_v3",
20
-    "cell_ranger"),
19
+  method = "modelGeneVar",
21 20
   hvgNumber = 2000,
22
-  featureSubsetName = NULL,
21
+  featureSubsetName = "hvg2000",
23 22
   genes = NULL,
24 23
   genesBy = NULL,
25 24
   altExp = FALSE
... ...
@@ -6,7 +6,7 @@
6 6
 \usage{
7 7
 importGeneSetsFromMSigDB(
8 8
   inSCE,
9
-  categoryIDs,
9
+  categoryIDs = "H",
10 10
   species = "Homo sapiens",
11 11
   mapping = c("gene_symbol", "human_gene_symbol", "entrez_gene"),
12 12
   by = "rownames",
... ...
@@ -7,7 +7,7 @@ and UMAP}
7 7
 \usage{
8 8
 plotDimRed(
9 9
   inSCE,
10
-  useReduction,
10
+  useReduction = "PCA",
11 11
   showLegend = FALSE,
12 12
   xDim = 1,
13 13
   yDim = 2,
... ...
@@ -32,9 +32,6 @@ to "ridge", "violin", "feature", "dot" and "heatmap".}
32 32
 \item{groupVariable}{Specify the column name from the colData slot that
33 33
 should be used as grouping variable.}
34 34
 
35
-\item{reducedDimName}{saved dimension reduction name in the
36
-SingleCellExperiment object. Default \code{seuratUMAP}.}
37
-
38 35
 \item{splitBy}{Specify the column name from the colData slot that should be
39 36
 used to split samples.
40 37
  Default is \code{NULL}.}
... ...
@@ -6,10 +6,10 @@
6 6
 \usage{
7 7
 plotTopHVG(
8 8
   inSCE,
9
-  method = c("vst", "mean.var.plot", "dispersion", "modelGeneVar"),
10
-  hvgNumber = NULL,
9
+  method = "modelGeneVar",
10
+  hvgNumber = 2000,
11 11
   useFeatureSubset = NULL,
12
-  labelsCount = 20,
12
+  labelsCount = 10,
13 13
   featureDisplay = metadata(inSCE)$featureDisplay,
14 14
   labelSize = 2,
15 15
   dotSize = 2,
... ...
@@ -9,7 +9,7 @@
9 9
 \alias{runWilcox}
10 10
 \title{Perform differential expression analysis on SCE object}
11 11
 \usage{
12
-runDEAnalysis(method = c("wilcox", "MAST", "DESeq2", "Limma", "ANOVA"), ...)
12
+runDEAnalysis(inSCE, method = "wilcox", ...)
13 13
 
14 14
 runDESeq2(
15 15
   inSCE,
... ...
@@ -115,12 +115,12 @@ runWilcox(
115 115
   useReducedDim = NULL,
116 116
   index1 = NULL,
117 117
   index2 = NULL,
118
-  class = NULL,
119
-  classGroup1 = NULL,
120
-  classGroup2 = NULL,
121
-  analysisName,
122
-  groupName1,
123
-  groupName2,
118
+  class = "cluster",
119
+  classGroup1 = c(1),
120
+  classGroup2 = c(2),
121
+  analysisName = "cluster1_VS_2",
122
+  groupName1 = "cluster1",
123
+  groupName2 = "cluster2",
124 124
   covariates = NULL,
125 125
   onlyPos = FALSE,
126 126
   log2fcThreshold = NULL,
... ...
@@ -134,6 +134,8 @@ runWilcox(
134 134
 )
135 135
 }
136 136
 \arguments{
137
+\item{inSCE}{\linkS4class{SingleCellExperiment} inherited object.}
138
+
137 139
 \item{method}{Character. Specify which method to use when using
138 140
 \code{runDEAnalysis()}. Choose from \code{"wilcox"}, \code{"MAST"},
139 141
 \code{"DESeq2"}, \code{"Limma"}, \code{"ANOVA"}. Default \code{"wilcox"}.}
... ...
@@ -141,8 +143,6 @@ runWilcox(
141 143
 \item{...}{Arguments to pass to specific methods when using the generic
142 144
 \code{runDEAnalysis()}.}
143 145
 
144
-\item{inSCE}{\linkS4class{SingleCellExperiment} inherited object.}
145
-
146 146
 \item{useAssay}{character. A string specifying which assay to use for the
147 147
 DE regression. Ignored when \code{useReducedDim} is specified. Default
148 148
 \code{"counts"} for DESeq2, \code{"logcounts"} for other methods.}
... ...
@@ -4,11 +4,7 @@
4 4
 \alias{runFeatureSelection}
5 5
 \title{Run Variable Feature Detection Methods}
6 6
 \usage{
7
-runFeatureSelection(
8
-  inSCE,
9
-  useAssay,
10
-  method = c("vst", "mean.var.plot", "dispersion", "modelGeneVar", "cell_ranger")
11
-)
7
+runFeatureSelection(inSCE, useAssay, method = "modelGeneVar")
12 8
 }
13 9
 \arguments{
14 10
 \item{inSCE}{Input \linkS4class{SingleCellExperiment} object.}
... ...
@@ -9,7 +9,7 @@ runFindMarker(
9 9
   inSCE,
10 10
   useAssay = "logcounts",
11 11
   useReducedDim = NULL,
12
-  method = c("wilcox", "MAST", "DESeq2", "Limma", "ANOVA"),
12
+  method = "wilcox",
13 13
   cluster = "cluster",
14 14
   covariates = NULL,
15 15
   log2fcThreshold = NULL,
... ...
@@ -6,15 +6,15 @@
6 6
 \usage{
7 7
 runScranSNN(
8 8
   inSCE,
9
-  useReducedDim = NULL,
9
+  useReducedDim = "PCA",
10 10
   useAssay = NULL,
11 11
   useAltExp = NULL,
12 12
   altExpAssay = "counts",
13 13
   altExpRedDim = NULL,
14
-  clusterName = "scranSNN_cluster",
15
-  k = 8,
14
+  clusterName = "cluster",
15
+  k = 14,
16 16
   nComp = 10,
17
-  weightType = c("rank", "number", "jaccard"),
17
+  weightType = "jaccard",
18 18
   algorithm = c("louvain", "leiden", "walktrap", "infomap", "fastGreedy", "labelProp",
19 19
     "leadingEigen"),
20 20
   BPPARAM = BiocParallel::SerialParam(),
... ...
@@ -10,7 +10,7 @@ runSingleR(
10 10
   useSCERef = NULL,
11 11
   labelColName = NULL,
12 12
   useBltinRef = c("hpca", "bpe", "mp", "dice", "immgen", "mouse", "zeisel"),
13
-  level = c("main", "fine", "ont"),
13
+  level = "fine",
14 14
   featureType = c("symbol", "ensembl"),
15 15
   labelByCluster = NULL
16 16
 )
... ...
@@ -6,8 +6,8 @@
6 6
 \usage{
7 7
 runVAM(
8 8
   inSCE,
9
-  geneSetCollectionName,
10
-  useAssay,
9
+  geneSetCollectionName = "H",
10
+  useAssay = "logcounts",
11 11
   resultNamePrefix = NULL,
12 12
   center = FALSE,
13 13
   gamma = TRUE
... ...
@@ -7,7 +7,7 @@
7 7
 scaterPCA(
8 8
   inSCE,
9 9
   useAssay = "logcounts",
10
-  useFeatureSubset = NULL,
10
+  useFeatureSubset = "hvg2000",
11 11
   scale = TRUE,
12 12
   reducedDimName = "PCA",
13 13
   nComponents = 50,