pbDS: pseudobulk DS analysis

Description Usage Arguments Value Author(s) References Examples

View source: R/pbDS.R

Description

pbDS tests for DS after aggregating single-cell measurements to pseudobulk data, by applying bulk RNA-seq DE methods, such as edgeR, DESeq2 and limma.

Usage

1
2
3
pbDS(pb, method = c("edgeR", "DESeq2", "limma-trend", "limma-voom"),
  design = NULL, coef = NULL, contrast = NULL, min_cells = 10,
  verbose = TRUE)

Arguments

pb

a SingleCellExperiment containing pseudobulks as returned by aggregateData.

method

a character string.

design

For methods "edegR" and "limma", a design matrix with row & column names(!) created with model.matrix; For "DESeq2", a formula with variables in colData(pb). Defaults to ~ group_id or the corresponding model.matrix.

coef

passed to glmQLFTest, contrasts.fit, results for method = "edgeR", "limma-x", "DESeq2", respectively.

contrast

a matrix of contrasts to test for created with makeContrasts.

min_cells

a numeric. Specifies the minimum number of cells in a given cluster-sample required to consider the sample for differential testing.

verbose

logical. Should information on progress be reported?

Value

a list containing

Author(s)

Helena L Crowell & Mark D Robinson

References

Crowell, HL, Soneson, C, Germain, P-L, Calini, D, Collin, L, Raposo, C, Malhotra, D & Robinson, MD: On the discovery of population-specific state transitions from multi-sample multi-condition single-cell RNA sequencing data. bioRxiv 713412 (2018). doi: https://doi.org/10.1101/713412

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# simulate 5 clusters, 20% of DE genes
data(sce)
    
# compute pseudobulk sum-counts & run DS analysis
pb <- aggregateData(sce)
res <- pbDS(pb, method = "limma-trend")

names(res)
names(res$table)
head(res$table$`stim-ctrl`$`B cells`)

# count nb. of DE genes by cluster
vapply(res$table$`stim-ctrl`, function(u) 
  sum(u$p_adj.loc < 0.05), numeric(1))

# get top 5 hits for ea. cluster w/ abs(logFC) > 1
library(dplyr)
lapply(res$table$`stim-ctrl`, function(u)
  filter(u, abs(logFC) > 1) %>% 
    arrange(p_adj.loc) %>% 
    slice(seq_len(5)))

HelenaLC/muscat documentation built on Nov. 12, 2019, 1:36 a.m.