topTags: Table of the Top Differentially Expressed Genes/Tags

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

View source: R/topTags.R

Description

Extracts the most differentially expressed genes (or sequence tags) from a test object, ranked either by p-value or by absolute log-fold-change.

Usage

1
topTags(object, n = 10, adjust.method = "BH", sort.by = "PValue", p.value = 1)

Arguments

object

a DGEExact or DGELRT object containing test statistics and p-values. Usually created by exactTest, glmLRT, glmTreat or glmQLFTest.

n

integer, maximum number of genes/tags to return.

adjust.method

character string specifying the method used to adjust p-values for multiple testing. See p.adjust for possible values.

sort.by

character string specifying the sort method. Possibilities are "PValue" for p-value, "logFC" for absolute log-fold change or "none" for no sorting.

p.value

numeric cutoff value for adjusted p-values. Only tags with adjusted p-values equal or lower than specified are returned.

Details

This function is closely analogous to the topTable function in the limma package. It accepts a test statistic object created by any of the edgeR functions exactTest, glmLRT, glmTreat or glmQLFTest and extracts a readable data.frame of the most differentially expressed genes. The data.frame collates the annotation and differential expression statistics for the top genes. The data.frame is wrapped in a TopTags output object that records the test statistic used and the multiple testing adjustment method.

TopTags objects will return dimensions and hence functions such as dim, nrow or ncol are defined on them. TopTags objects also have a show method so that printing produces a compact summary of their contents.

topTags permits ranking by fold-change but the authors do not recommend fold-change ranking or fold-change cutoffs for routine RNA-seq analysis. The p-value ranking is intended to more biologically meaningful, especially if the p-values were computed using glmTreat.

Value

An object of class TopTags, which is a list-based class with the following components:

table

a data.frame containing differential expression results for the top genes in sorted order. The number of rows is the smaller of n and the number of genes with adjusted p-value less than or equal to p.value. The data.frame includes all the annotation columns from object$genes and all statistic columns from object$table plus one of:

FDR: false discovery rate (only when adjust.method is "BH", "BY" or "fdr")
FWER: family-wise error rate (only when adjust.method is "holm", "hochberg", "hommel" or "bonferroni").
adjust.method

character string specifying the method used to adjust p-values for multiple testing, same as input argument.

comparison

character vector giving the names of the two groups being compared (for DGEExact objects) or the glm contrast being tested (for DGELRT objects).

test

character string stating the name of the test.

Note

The terms ‘tag’ and ‘gene’ are used synonymously on this page and refer to the rows of object. In general, the rows might be genes, sequence tags, transcripts, exons or whatever type of genomic feature is appropriate for the analysis at hand.

Author(s)

Mark Robinson, Davis McCarthy, Yunshun Chen, Gordon Smyth

References

Chen Y, Lun ATL, and Smyth, GK (2016). From reads to genes to pathways: differential expression analysis of RNA-Seq experiments using Rsubread and the edgeR quasi-likelihood pipeline. F1000Research 5, 1438. http://f1000research.com/articles/5-1438

McCarthy, DJ, Chen, Y, Smyth, GK (2012). Differential expression analysis of multifactor RNA-Seq experiments with respect to biological variation. Nucleic Acids Research 40, 4288-4297. https://doi.org/10.1093/nar/gks042

Robinson MD, Smyth GK (2008). Small-sample estimation of negative binomial dispersion, with applications to SAGE data. Biostatistics 9, 321-332.

Robinson MD, Smyth GK (2007). Moderated statistical tests for assessing differences in tag abundance. Bioinformatics 23, 2881-2887.

See Also

exactTest, glmLRT, glmTreat, glmQLFTest, dim.TopTags, p.adjust.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# generate raw counts from NB, create list object
y <- matrix(rnbinom(80,size=1,mu=10),nrow=20)
d <- DGEList(counts=y,group=rep(1:2,each=2),lib.size=rep(c(1000:1001),2))
rownames(d$counts) <- paste("gene",1:nrow(d$counts),sep=".")

# estimate common dispersion and find differences in expression
# here we demonstrate the 'exact' methods, but the use of topTags is
# the same for a GLM analysis
d <- estimateCommonDisp(d)
de <- exactTest(d)

# look at top 10
topTags(de)
# Can specify how many genes to view
tp <- topTags(de, n=15)
# Here we view top 15
tp
# Or order by fold change instead
topTags(de,sort.by="logFC")

Example output

Loading required package: limma
Comparison of groups:  2-1 
            logFC   logCPM     PValue       FDR
gene.13  3.927546 13.41831 0.06297185 0.7427030
gene.14  3.439276 13.48287 0.08997453 0.7427030
gene.8  -2.604663 14.14897 0.16130806 0.7427030
gene.2  -3.292920 12.35154 0.16684627 0.7427030
gene.11  2.709441 12.95951 0.18567576 0.7427030
gene.4  -1.765370 13.08835 0.36446255 0.8708413
gene.18 -1.540804 14.10916 0.39230442 0.8708413
gene.20  1.512666 13.51340 0.41733222 0.8708413
gene.7  -1.448462 13.35194 0.44360298 0.8708413
gene.15  1.527247 12.54427 0.47286474 0.8708413
Comparison of groups:  2-1 
             logFC   logCPM     PValue       FDR
gene.13  3.9275462 13.41831 0.06297185 0.7427030
gene.14  3.4392758 13.48287 0.08997453 0.7427030
gene.8  -2.6046629 14.14897 0.16130806 0.7427030
gene.2  -3.2929201 12.35154 0.16684627 0.7427030
gene.11  2.7094408 12.95951 0.18567576 0.7427030
gene.4  -1.7653703 13.08835 0.36446255 0.8708413
gene.18 -1.5408038 14.10916 0.39230442 0.8708413
gene.20  1.5126656 13.51340 0.41733222 0.8708413
gene.7  -1.4484615 13.35194 0.44360298 0.8708413
gene.15  1.5272471 12.54427 0.47286474 0.8708413
gene.10  1.2889099 13.86638 0.47896274 0.8708413
gene.9  -1.0188040 14.49895 0.56422674 0.9403779
gene.17  0.7155244 13.88963 0.69975800 0.9702383
gene.5   0.4551239 13.98204 0.81209970 0.9702383
gene.19  0.3422718 14.61758 0.85413225 0.9702383
Comparison of groups:  2-1 
            logFC   logCPM     PValue       FDR
gene.13  3.927546 13.41831 0.06297185 0.7427030
gene.14  3.439276 13.48287 0.08997453 0.7427030
gene.2  -3.292920 12.35154 0.16684627 0.7427030
gene.11  2.709441 12.95951 0.18567576 0.7427030
gene.8  -2.604663 14.14897 0.16130806 0.7427030
gene.4  -1.765370 13.08835 0.36446255 0.8708413
gene.18 -1.540804 14.10916 0.39230442 0.8708413
gene.15  1.527247 12.54427 0.47286474 0.8708413
gene.20  1.512666 13.51340 0.41733222 0.8708413
gene.7  -1.448462 13.35194 0.44360298 0.8708413

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