Finds markers (differentially expressed genes) for cell clusters using MAST: a flexible statistical framework for assessing transcriptional changes and characterizing heterogeneity in single-cell RNA sequencing data (Finak et al, Genome Biology, 2015)

differentialExpression(counts, celda.mod, c1, c2 = NULL, only.pos = FALSE,
  log2fc.threshold = NULL, fdr.threshold = 1)

Arguments

counts

Integer matrix. Rows represent features and columns represent cells. This matrix should be the same as the one used to generate `celda.mod`.

celda.mod

Celda model. Options are "celda_C" or "celda_CG".

c1

Integer vector. Cell populations to include in group 1 for the differential expression analysis.

c2

Integer vector. Cell populations to include in group 2 for the differential expression analysis. If NULL, everything in c1 is compared to all other clusters. Default NULL.

only.pos

Logical. Whether to only return markers with positive log2fc. Default FALSE.

log2fc.threshold

Numeric. A number greater than 0 that specifies the absolute log2 fold change threshold. Only features with absolute value above this threshold will be returned.

fdr.threshold

Numeric. A number between 0 and 1 that specifies the false discovery rate (FDR) threshold. Only features below this threshold will be returned.

Value

Data frame containing a ranked list (based on the absolute value of log2fc) of putative markers, and associated statistics (p-value, log2fc and FDR).

Examples

celda.sim = simulateCells("celda_CG") celda.mod = celda_CG(celda.sim$counts, K=celda.sim$K, L=celda.sim$L, nchains=1, max.iter=1)
#> --------------------------------------------------------------------
#> Starting Celda_CG: Clustering cells and genes.
#> --------------------------------------------------------------------
#> Thu Sep 06 12:56:46 2018 .. Initializing chain 1 with 'random' (seed=12345)
#> Thu Sep 06 12:56:46 2018 .... Determining if any cell clusters should be split.
#> Thu Sep 06 12:56:46 2018 .... Cluster 4 was reassigned and cluster 3 was split in two.
#> Thu Sep 06 12:56:46 2018 .... Determining if any gene clusters should be split.
#> Thu Sep 06 12:56:47 2018 .... Cluster 2 was reassigned and cluster 9 was split in two.
#> Thu Sep 06 12:56:47 2018 .... Completed iteration: 1 | logLik: -1272652.93151523
#> Thu Sep 06 12:56:47 2018 .. Finished chain 1 with seed 12345
#> --------------------------------------------------------------------
#> Completed Celda_CG. Total time: 0.6036341 secs
#> --------------------------------------------------------------------
cluster.diffexp.res = differentialExpression(celda.sim$counts, celda.mod, c1=c(1,2))
#> Assuming data assay in position 1, with name et is log-transformed.
#> .
#> .
#> .
#> .
#> .
#> #> Done!
#> Combining coefficients and standard errors
#> Calculating log-fold changes
#> Calculating likelihood ratio tests
#> Refitting on reduced model...
#> .
#> .
#> .
#> .
#> .
#> #> Done!