camera.DGEList: Competitive Gene Set Tests for Digital Gene Expression Data

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/geneset-DGEList.R

Description

Test whether a set of genes is highly ranked relative to other genes in terms of differential expression, accounting for inter-gene correlation.

Usage

1
2
3
## S3 method for class 'DGEList'
camera(y, index, design, contrast = ncol(design), weights = NULL,
       use.ranks = FALSE, allow.neg.cor=FALSE, inter.gene.cor=0.01, sort = TRUE, ...)

Arguments

y

a DGEList object containing dispersion estimates.

index

an index vector or a list of index vectors. Can be any vector such that y[index,] selects the rows corresponding to the test set. The list can be made using ids2indices.

design

design matrix. Defaults to y$design or, failing that, to model.matrix(~y$samples$group).

contrast

contrast of the linear model coefficients for which the test is required. Can be an integer specifying a column of design, or else a numeric vector of same length as the number of columns of design.

weights

numeric matrix of observation weights of same size as y, or a numeric vector of array weights with length equal to ncol(y), or a numeric vector of gene weights with length equal to nrow(y).

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?

inter.gene.cor

numeric, optional preset value for the inter-gene correlation within tested sets. If NA or NULL, then an inter-gene correlation will be estimated for each tested set.

sort

logical, should the results be sorted by p-value?

...

other arguments are not currently used

Details

The camera gene set test was proposed by Wu and Smyth (2012) for microarray data. This function makes the camera test available for digital gene expression data. The negative binomial count data is converted to approximate normal deviates by computing mid-p quantile residuals (Dunn and Smyth, 1996; Routledge, 1994) under the null hypothesis that the contrast is zero. See camera for more description of the test and for a complete list of possible arguments.

Value

A data.frame giving the gene set results, with most significant sets to the top. See camera for details.

Author(s)

Yunshun Chen, Gordon Smyth

References

Dunn, PK, and Smyth, GK (1996). Randomized quantile residuals. J. Comput. Graph. Statist., 5, 236-244. http://www.statsci.org/smyth/pubs/residual.html

Routledge, RD (1994). Practicing safe statistics with the mid-p. Canadian Journal of Statistics 22, 103-110.

Wu, D, and Smyth, GK (2012). Camera: a competitive gene set test accounting for inter-gene correlation. Nucleic Acids Research 40, e133. https://doi.org/10.1093/nar/gks461

See Also

roast.DGEList, camera.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
mu <- matrix(10, 100, 4)
group <- factor(c(0,0,1,1))
design <- model.matrix(~group)

# First set of 10 genes that are genuinely differentially expressed
iset1 <- 1:10
mu[iset1,3:4] <- mu[iset1,3:4]+10

# Second set of 10 genes are not DE
iset2 <- 11:20

# Generate counts and create a DGEList object
y <- matrix(rnbinom(100*4, mu=mu, size=10),100,4)
y <- DGEList(counts=y, group=group)

# Estimate dispersions
y <- estimateDisp(y, design)

camera(y, iset1, design)
camera(y, iset2, design)

camera(y, list(set1=iset1,set2=iset2), design)

Example output

Loading required package: limma
     NGenes Direction       PValue
set1     10        Up 2.432363e-05
     NGenes Direction    PValue
set1     10      Down 0.6678383
     NGenes Direction       PValue          FDR
set1     10        Up 2.432363e-05 4.864726e-05
set2     10      Down 6.678383e-01 6.678383e-01

edgeR documentation built on Jan. 16, 2021, 2:03 a.m.