man/plotFindMarkerHeatmap.Rd
ae4ae5bd
 % Generated by roxygen2: do not edit by hand
b1877916
 % Please edit documentation in R/plotFindMarkerHeatmap.R
 \name{plotFindMarkerHeatmap}
 \alias{plotFindMarkerHeatmap}
ae4ae5bd
 \alias{plotMarkerDiffExp}
c9178750
 \title{Plot a heatmap to visualize the result of \code{\link{runFindMarker}}}
ae4ae5bd
 \usage{
b1877916
 plotFindMarkerHeatmap(
ae4ae5bd
   inSCE,
   orderBy = "size",
   log2fcThreshold = 1,
   fdrThreshold = 0.05,
df03c634
   minClustExprPerc = 0.7,
   maxCtrlExprPerc = 0.4,
   minMeanExpr = 1,
1b07588b
   topN = 10,
ae4ae5bd
   decreasing = TRUE,
ef608c1e
   rowLabel = TRUE,
ae4ae5bd
   rowDataName = NULL,
   colDataName = NULL,
   featureAnnotations = NULL,
   cellAnnotations = NULL,
   featureAnnotationColor = NULL,
   cellAnnotationColor = NULL,
4957169e
   colSplitBy = NULL,
88b9f5b5
   rowSplitBy = "marker",
f0f8cb90
   rowDend = FALSE,
   colDend = FALSE,
cd268d2f
   title = "Top Marker Heatmap",
ae4ae5bd
   ...
 )
b1877916
 
84664fd7
 plotMarkerDiffExp(
   inSCE,
   orderBy = "size",
   log2fcThreshold = 1,
   fdrThreshold = 0.05,
   minClustExprPerc = 0.7,
   maxCtrlExprPerc = 0.4,
   minMeanExpr = 1,
   topN = 10,
   decreasing = TRUE,
   rowDataName = NULL,
   colDataName = NULL,
   featureAnnotations = NULL,
   cellAnnotations = NULL,
   featureAnnotationColor = NULL,
   cellAnnotationColor = NULL,
   colSplitBy = NULL,
   rowSplitBy = "marker",
   rowDend = FALSE,
   colDend = FALSE,
   title = "Top Marker Heatmap",
   ...
 )
ae4ae5bd
 }
 \arguments{
 \item{inSCE}{\linkS4class{SingleCellExperiment} inherited object.}
 
 \item{orderBy}{The ordering method of the clusters on the splitted heatmap.
 Can be chosen from \code{"size"} or \code{"name"}, specified with vector of
 ordered unique cluster labels, or set as \code{NULL} for unsplitted heatmap.
 Default \code{"size"}.}
 
 \item{log2fcThreshold}{Only use DEGs with the absolute values of log2FC
 larger than this value. Default \code{1}}
 
 \item{fdrThreshold}{Only use DEGs with FDR value smaller than this value.
 Default \code{0.05}}
 
df03c634
 \item{minClustExprPerc}{A numeric scalar. The minimum cutoff of the
 percentage of cells in the cluster of interests that expressed the marker
 gene. Default \code{0.7}.}
 
 \item{maxCtrlExprPerc}{A numeric scalar. The maximum cutoff of the
 percentage of cells out of the cluster (control group) that expressed the
 marker gene. Default \code{0.4}.}
 
 \item{minMeanExpr}{A numeric scalar. The minimum cutoff of the mean
 expression value of the marker in the cluster of interests. Default \code{1}.}
 
1b07588b
 \item{topN}{An integer. Only to plot this number of top markers for each
 cluster in maximum, in terms of log2FC value. Use \code{NULL} to cancel the
 top N subscription. Default \code{10}.}
 
ae4ae5bd
 \item{decreasing}{Order the cluster decreasingly. Default \code{TRUE}.}
 
ef608c1e
 \item{rowLabel}{\code{TRUE} for displaying \code{rownames} of \code{inSCE}, a
 \code{rowData} variable to use other feature identifiers, or a vector for
 customized row labels. Use \code{FALSE} for not displaying. Default
 \code{TRUE}.}
 
ae4ae5bd
 \item{rowDataName}{character. The column name(s) in \code{rowData} that need
 to be added to the annotation. Default \code{NULL}.}
 
 \item{colDataName}{character. The column name(s) in \code{colData} that need
 to be added to the annotation. Default \code{NULL}.}
 
 \item{featureAnnotations}{\code{data.frame}, with \code{rownames} containing
 all the features going to be plotted. Character columns should be factors.
 Default \code{NULL}.}
 
 \item{cellAnnotations}{\code{data.frame}, with \code{rownames} containing
 all the cells going to be plotted. Character columns should be factors.
 Default \code{NULL}.}
 
 \item{featureAnnotationColor}{A named list. Customized color settings for
 feature labeling. Should match the entries in the \code{featureAnnotations}
 or \code{rowDataName}. For each entry, there should be a list/vector of
 colors named with categories. Default \code{NULL}.}
 
 \item{cellAnnotationColor}{A named list. Customized color settings for
 cell labeling. Should match the entries in the \code{cellAnnotations} or
 \code{colDataName}. For each entry, there should be a list/vector of colors
 named with categories. Default \code{NULL}.}
 
88b9f5b5
 \item{colSplitBy}{character vector. Do semi-heatmap based on the grouping of
 this(these) annotation(s). Should exist in either \code{colDataName} or
 \code{names(cellAnnotations)}. Default is the value of \code{cluster} in
c9178750
 \code{\link{runFindMarker}} when \code{orderBy} is not \code{NULL}, or
ae4ae5bd
 \code{NULL} otherwise.}
 
88b9f5b5
 \item{rowSplitBy}{character vector. Do semi-heatmap based on the grouping of
 this(these) annotation(s). Should exist in either \code{rowDataName} or
 \code{names(featureAnnotations)}. Default \code{"marker"}, which indicates an
 auto generated annotation for this plot.}
ae4ae5bd
 
f0f8cb90
 \item{rowDend}{Whether to display row dendrogram. Default \code{FALSE}.}
 
 \item{colDend}{Whether to display column dendrogram. Default \code{FALSE}.}
 
cd268d2f
 \item{title}{Text of the title, at the top of the heatmap. Default
 \code{"Top Marker Heatmap"}.}
 
ae4ae5bd
 \item{...}{Other arguments passed to \code{\link{plotSCEHeatmap}}.}
 }
 \value{
 A \code{\link[ComplexHeatmap]{Heatmap}} object
 }
 \description{
88b9f5b5
 This function will first reads the result saved in
 \code{metadata} slot, named by \code{"findMarker"} and generated by
b1877916
 \code{\link{runFindMarker}}. Then it do the filtering on the statistics
88b9f5b5
 based on the input parameters and get unique genes to plot. We choose the
 genes that are identified as up-regulated only. As for the genes identified
 as up-regulated for multiple clusters, we only keep the belonging towards the
 one they have the highest Log2FC value.
 In the heatmap, there will always be a cell annotation for the cluster
 labeling used when finding the markers, and a feature annotation for which
 cluster each gene belongs to. And by default we split the heatmap by these
 two annotations. Additional legends can be added and the splitting can be
 canceled.
ae4ae5bd
 }
930ec858
 \examples{
 data("sceBatches")
b1877916
 logcounts(sceBatches) <- log1p(counts(sceBatches))
930ec858
 sce.w <- subsetSCECols(sceBatches, colData = "batch == 'w'")
b1877916
 sce.w <- runFindMarker(sce.w, method = "wilcox", cluster = "cell_type")
 plotFindMarkerHeatmap(sce.w)
930ec858
 }
c9178750
 \seealso{
 \code{\link{runFindMarker}}, \code{\link{getFindMarkerTopTable}}
 }
ae4ae5bd
 \author{
 Yichen Wang
 }