man/plotDimReduceCluster.Rd
5cd84669
 % Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/plot_dr.R
b599ba2a
 \name{plotDimReduceCluster}
 \alias{plotDimReduceCluster}
05a1113d
 \alias{plotDimReduceCluster,SingleCellExperiment-method}
 \alias{plotDimReduceCluster,vector-method}
4fddb4dd
 \title{Plotting the cell labels on a dimension reduction plot}
5cd84669
 \usage{
05a1113d
 plotDimReduceCluster(x, ...)
 
 \S4method{plotDimReduceCluster}{SingleCellExperiment}(
   x,
f8826e1e
   reducedDimName,
898ab9e0
   altExpName = "featureSubset",
f3b143d0
   dim1 = NULL,
   dim2 = NULL,
05a1113d
   size = 1,
   xlab = "Dimension_1",
   ylab = "Dimension_2",
   specificClusters = NULL,
   labelClusters = FALSE,
   groupBy = NULL,
   labelSize = 3.5
 )
 
 \S4method{plotDimReduceCluster}{vector}(
f3b143d0
   x,
706c16ac
   dim1,
   dim2,
   size = 1,
   xlab = "Dimension_1",
   ylab = "Dimension_2",
   specificClusters = NULL,
   labelClusters = FALSE,
   groupBy = NULL,
   labelSize = 3.5
 )
5cd84669
 }
 \arguments{
05a1113d
 \item{x}{Integer vector of cell cluster labels or a
 \linkS4class{SingleCellExperiment} object
 containing cluster labels for each cell in \code{"celda_cell_cluster"}
 column in \code{colData(x)}.}
 
7028c654
 \item{...}{Ignored. Placeholder to prevent check warning.}
 
f8826e1e
 \item{reducedDimName}{The name of the dimension reduction slot in
 \code{reducedDimNames(x)} if \code{x} is a
 \linkS4class{SingleCellExperiment} object. Ignored if both \code{dim1} and
 \code{dim2} are set.}
 
82cc7a6a
 \item{altExpName}{The name for the \link{altExp} slot
898ab9e0
 to use. Default "featureSubset".}
 
58380509
 \item{dim1}{Numeric vector. First dimension from data
4fddb4dd
 dimension reduction output.}
5cd84669
 
58380509
 \item{dim2}{Numeric vector. Second dimension from data
4fddb4dd
 dimension reduction output.}
5cd84669
 
 \item{size}{Numeric. Sets size of point on plot. Default 1.}
 
 \item{xlab}{Character vector. Label for the x-axis. Default "Dimension_1".}
 
 \item{ylab}{Character vector. Label for the y-axis. Default "Dimension_2".}
 
58380509
 \item{specificClusters}{Numeric vector.
 Only color cells in the specified clusters.
 All other cells will be grey.
c26f47e0
 If NULL, all clusters will be colored. Default \code{NULL}.}
918ae097
 
58380509
 \item{labelClusters}{Logical. Whether the cluster labels are plotted.
 Default FALSE.}
918ae097
 
fe25283d
 \item{groupBy}{Character vector. Contains sample labels for each cell.
 If NULL, all samples will be plotted together. Default NULL.}
 
58380509
 \item{labelSize}{Numeric. Sets size of label if labelClusters is TRUE.
 Default 3.5.}
5cd84669
 }
d1154f0b
 \value{
 The plot as a ggplot object
 }
5cd84669
 \description{
58380509
 Create a scatterplot for each row of a normalized
  gene expression matrix where x and y axis are from a
4fddb4dd
  data dimension reduction tool.
b8f36492
  The cells are colored by "celda_cell_cluster" column in
   \code{colData(altExp(x, altExpName))} if \code{x} is a
   \linkS4class{SingleCellExperiment} object, or \code{x} if \code{x} is
   a integer vector of cell cluster labels.
5cd84669
 }
ff43602d
 \examples{
05a1113d
 data(sceCeldaCG)
f3b143d0
 sce <- celdaTsne(sceCeldaCG)
f8826e1e
 plotDimReduceCluster(x = sce,
   reducedDimName = "celda_tSNE",
   specificClusters = c(1, 2, 3))
d544583e
 library(SingleCellExperiment)
05a1113d
 data(sceCeldaCG, celdaCGMod)
f3b143d0
 sce <- celdaTsne(sceCeldaCG)
f8826e1e
 plotDimReduceCluster(x = celdaClusters(celdaCGMod)$z,
ba2b938f
   dim1 = reducedDim(altExp(sce), "celda_tSNE")[, 1],
   dim2 = reducedDim(altExp(sce), "celda_tSNE")[, 2],
05a1113d
   specificClusters = c(1, 2, 3))
ff43602d
 }