zenith: Gene set analysis following differential expression with...

View source: R/zenith.R

zenithR Documentation

Gene set analysis following differential expression with dream

Description

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 using ids2indices.

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

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).

Value

  • NGenes: number of genes in this set

  • Correlation: mean correlation between expression of genes in this set

  • delta: difference in mean t-statistic for genes in this set compared to genes not in this set

  • se: standard error of delta

  • p.less: p-value for hypothesis test of H0: delta < 0

  • p.greater: p-value for hypothesis test of H0: delta > 0

  • PValue: p-value for hypothesis test H0: delta != 0

  • Direction: direction of effect based on sign(delta)

  • FDR: false discovery rate based on Benjamini-Hochberg method in p.adjust

References

\insertRef

hoffman2020dreamzenith

\insertRef

wu2012camerazenith

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)


GabrielHoffman/zenith documentation built on March 10, 2024, 11:43 p.m.