% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cluster.R
\name{clusterDE}
\alias{clusterDE}
\title{Cluster Differential Expression}
\usage{
clusterDE(
  object,
  clustering,
  genes.dist = object@var.genes,
  effect.size = log(2),
  p.thresh = 0.01,
  frac.must.express = 0.1,
  genes.de = NULL,
  verbose = T
)
}
\arguments{
\item{object}{An URD object}

\item{clustering}{(Character) Name of a clustering (i.e. a column in \code{@group.ids})}

\item{genes.dist}{(Character vector) Genes to use for calculating distance (default: variable genes, NULL is all genes)}

\item{effect.size}{(Numeric) Minimum log fold-change for two genes to be considered differentially expressed}

\item{p.thresh}{(Numeric) Minimum significance value for teo genes to be considered expressed}

\item{frac.must.express}{(Numeric) Gene must be expressed in at least this fraction of cells in one of the two clusters to be considered.}

\item{genes.de}{(Character vector) Genes to consider for differential expression (default: NULL is all genes)}

\item{verbose}{(Logical) Report on progress}
}
\value{
A list with entries:
\itemize{
\item{$n.de:} a data frame describing each pair of clusters tested and the number of differentially expressed genes between them
\item{$genes:} a list of data frames for each pair of clusters with the differential gene expression test results
}
}
\description{
Calculates the differentially expressed genes between each cluster and its
nearest cluster (as determined by centroids in gene expression space). This
can be used to fuse nearby clusters that don't have significant gene expression
differences between them. This function uses the binomial differential expression
test (see \link{markersBinom}.)
}
\examples{
# Test all genes for differential expression again each cluster's nearest 
# cluster (by centroid distance in variable gene expression space)
cde <- clusterDE(object, clustering="Louvain-15", genes.dist=object@var.genes, 
effect.size=log(2), p.thresh=0.01, frac.must.express=0.1, genes.de=NULL, verbose=T)

}
