Perform gene set analysis on the result of differential expression using linear (mixed) modeling with variancePartition::dream
by considering the correlation between gene expression traits. This package is a slight modification of limma::camera
to 1) be compatible with dream, and 2) allow identification of gene sets with log fold changes with mixed sign.
Usage
zenith(
fit,
coef,
index,
use.ranks = FALSE,
allow.neg.cor = FALSE,
progressbar = TRUE,
inter.gene.cor = 0.01
)
Arguments
- fit
result of differential expression with dream
- coef
coefficient to test using
topTable(fit, coef)
- index
an index vector or a list of index vectors. Can be any vector such that
fit[index,]
selects the rows corresponding to the test set. The list can be made usingids2indices
.- use.ranks
do a rank-based test (
TRUE
) or a parametric test ('FALSE')?- allow.neg.cor
should reduced variance inflation factors be allowed for negative correlations?
- progressbar
if TRUE, show progress bar
- inter.gene.cor
if NA, estimate correlation from data. Otherwise, use specified value
Value
NGenes
: number of genes in this setCorrelation
: mean correlation between expression of genes in this setdelta
: difference in mean t-statistic for genes in this set compared to genes not in this setse
: standard error ofdelta
p.less
: p-value for hypothesis test ofH0: delta < 0
p.greater
: p-value for hypothesis test ofH0: delta > 0
PValue
: p-value for hypothesis testH0: delta != 0
Direction
: direction of effect based on sign(delta)FDR
: false discovery rate based on Benjamini-Hochberg method inp.adjust
Details
zenith
gives the same results as camera(..., inter.gene.cor=NA)
which estimates the correlation with each gene set.
For differential expression with dream using linear (mixed) models see Hoffman and Roussos (2020). For the original camera gene set test see Wu and Smyth (2012).
References
Hoffman GE, Roussos P (2020). “dream: Powerful differential expression analysis for repeated measures designs.” Bioinformatics. doi:10.1093/bioinformatics/btaa687 . Wu D, Smyth GK (2012). “Camera: a competitive gene set test accounting for inter-gene correlation.” Nucleic acids research, 40(17), e133. doi:10.1093/nar/gks461 .
Examples
library(variancePartition)
# simulate meta-data
info <- data.frame(Age=c(20, 31, 52, 35, 43, 45),Group=c(0,0,0,1,1,1))
# simulate expression data
y <- matrix(rnorm(1000*6),1000,6)
rownames(y) = paste0("gene", 1:1000)
colnames(y) = rownames(info)
# First set of 20 genes are genuinely differentially expressed
index1 <- 1:20
y[index1,4:6] <- y[index1,4:6]+1
# Second set of 20 genes are not DE
index2 <- 21:40
# perform differential expression analysis with dream
fit = dream(y, ~ Age + Group, info)
fit = eBayes(fit)
# perform gene set analysis testing Age
res = zenith(fit, "Age", list(set1=index1,set2=index2) )
head(res)
#> NGenes Correlation delta se p.less p.greater PValue
#> set1 20 0.01 -0.07795486 0.2438749 0.3850999 0.6149001 0.7701998
#> set2 20 0.01 0.03888067 0.2438860 0.5582674 0.4417326 0.8834653
#> Direction FDR
#> set1 Down 0.8834653
#> set2 Up 0.8834653