man/runFindMarker.Rd
ae4ae5bd
 % Generated by roxygen2: do not edit by hand
b1877916
 % Please edit documentation in R/runFindMarker.R
 \name{runFindMarker}
 \alias{runFindMarker}
ae4ae5bd
 \alias{findMarkerDiffExp}
7d46c6eb
 \title{Find the marker gene set for each cluster}
ae4ae5bd
 \usage{
b1877916
 runFindMarker(
ae4ae5bd
   inSCE,
   useAssay = "logcounts",
4957169e
   useReducedDim = NULL,
a10e1402
   method = "wilcox",
ae4ae5bd
   cluster = "cluster",
b72135ec
   covariates = NULL,
3d74f74e
   log2fcThreshold = NULL,
df03c634
   fdrThreshold = 0.05,
3d74f74e
   minClustExprPerc = NULL,
   maxCtrlExprPerc = NULL,
b2ca2949
   minMeanExpr = NULL,
   detectThresh = 0
ae4ae5bd
 )
b1877916
 
84664fd7
 findMarkerDiffExp(
   inSCE,
   useAssay = "logcounts",
   useReducedDim = NULL,
   method = c("wilcox", "MAST", "DESeq2", "Limma", "ANOVA"),
   cluster = "cluster",
   covariates = NULL,
   log2fcThreshold = NULL,
   fdrThreshold = 0.05,
   minClustExprPerc = NULL,
   maxCtrlExprPerc = NULL,
   minMeanExpr = NULL,
   detectThresh = 0
 )
ae4ae5bd
 }
 \arguments{
 \item{inSCE}{\linkS4class{SingleCellExperiment} inherited object.}
 
 \item{useAssay}{character. A string specifying which assay to use for the
 MAST calculations. Default \code{"logcounts"}.}
 
4957169e
 \item{useReducedDim}{character. A string specifying which reducedDim to use
b1877916
 for MAST calculations. Set \code{useAssay} to \code{NULL} when using.
4957169e
 Required.}
 
f508d9ba
 \item{method}{A single character for specific differential expression
ea2808fc
 analysis method. Choose from \code{'wilcox'}, \code{'MAST'}, \code{'DESeq2'},
 \code{'Limma'}, and \code{'ANOVA'}. Default \code{"wilcox"}.}
f508d9ba
 
ae4ae5bd
 \item{cluster}{One single character to specify a column in
 \code{colData(inSCE)} for the clustering label. Alternatively, a vector or
 a factor is also acceptable. Default \code{"cluster"}.}
 
b72135ec
 \item{covariates}{A character vector of additional covariates to use when
5afd7247
 building the model. All covariates must exist in
 \code{names(colData(inSCE))}. Not applicable when \code{method} is
 \code{"MAST"} method. Default \code{NULL}.}
 
ae4ae5bd
 \item{log2fcThreshold}{Only out put DEGs with the absolute values of log2FC
 larger than this value. Default \code{NULL}}
 
 \item{fdrThreshold}{Only out put DEGs with FDR value smaller than this
3d74f74e
 value. Default \code{NULL}}
df03c634
 
 \item{minClustExprPerc}{A numeric scalar. The minimum cutoff of the
 percentage of cells in the cluster of interests that expressed the marker
3d74f74e
 gene. From 0 to 1. Default \code{NULL}.}
df03c634
 
 \item{maxCtrlExprPerc}{A numeric scalar. The maximum cutoff of the
 percentage of cells out of the cluster (control group) that expressed the
3d74f74e
 marker gene. From 0 to 1. Default \code{NULL}.}
df03c634
 
 \item{minMeanExpr}{A numeric scalar. The minimum cutoff of the mean
7d46c6eb
 expression value of the marker in the cluster of interests. Default
3d74f74e
 \code{NULL}.}
b2ca2949
 
 \item{detectThresh}{A numeric scalar, above which a matrix value will be
 treated as expressed when calculating cluster/control expression percentage.
 Default \code{0}.}
ae4ae5bd
 }
 \value{
 The input \linkS4class{SingleCellExperiment} object with
 \code{metadata(inSCE)$findMarker} updated with a data.table of the up-
 regulated DEGs for each cluster.
 }
 \description{
7d46c6eb
 With an input SingleCellExperiment object and specifying the
 clustering labels, this function iteratively call the differential expression
c9178750
 analysis on each cluster against all the others. \code{\link{runFindMarker}}
b1877916
 will be deprecated in the future.
ae4ae5bd
 }
b2ca2949
 \details{
 The returned marker table, in the \code{metadata} slot, consists of 8
 columns: \code{"Gene"}, \code{"Log2_FC"}, \code{"Pvalue"}, \code{"FDR"},
 \code{cluster}, \code{"clusterExprPerc"}, \code{"ControlExprPerc"} and
 \code{"clusterAveExpr"}.
 
 \code{"clusterExprPerc"} is the fraction of cells,
 that has marker value (e.g. gene expression counts) larger than
 \code{detectThresh}, in the cell population of the cluster. As for each
 cluster, we set all cells out of this cluster as control. Similarly,
 \code{"ControlExprPerc"} is the fraction of cells with marker value larger
 than \code{detectThresh} in the control cell group.
 }
930ec858
 \examples{
 data("mouseBrainSubsetSCE", package = "singleCellTK")
b1877916
 mouseBrainSubsetSCE <- runFindMarker(mouseBrainSubsetSCE,
                                      useAssay = "logcounts",
                                      cluster = "level1class")
 }
 \seealso{
c9178750
 \code{\link{runDEAnalysis}}, \code{\link{getFindMarkerTopTable}},
 \code{\link{plotFindMarkerHeatmap}}
ae4ae5bd
 }