topTags {edgeR} | R Documentation

## Table of the Top Differentially Expressed Tags

### Description

Extracts the top DE tags in a data frame for a given pair of groups, ranked by p-value or absolute log-fold change.

### Usage

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

### Arguments

`object` | a `DGEExact` object (output from `exactTest`) or a `DGELRT` object (output from `glmLRT`), containing the (at least) the elements `table`: a data frame containing the log-concentration (i.e. expression level), the log-fold change in expression between the two groups/conditions and the p-value for differential expression, for each tag. If it is a `DGEExact` object, then `topTags` will also use the `comparison` element, which is a vector giving the two experimental groups/conditions being compared. The object may contain other elements that are not used by `topTags`.
`n` | scalar, number of tags to display/return
`adjust.method` | character string stating the method used to adjust p-values for multiple testing, passed on to `p.adjust`
`sort.by` | character string, should the top tags be sorted by p-value (`"PValue"`), by absolute log-fold change (`"logFC"`), or not sorted (`"none"`).
`p.value` | cutoff value for adjusted p-values. Only tags with lower p-values are listed.

### Value

an object of class `TopTags` containing the following elements for the top `n` most differentially expressed tags as determined by `sort.by`:

`table` | a data frame containing the elements `logFC`, the log-abundance ratio, i.e. fold change, for each tag in the two groups being compared, `logCPM`, the log-average concentration/abundance for each tag in the two groups being compared, `PValue`, exact p-value for differential expression using the NB model. When `adjust.method` is not `"none"`, there is an extra column of `FDR` showing the adjusted p-value if `adjust.method` is one of the `"BH"`, `"BY"` and `"fdr"`, or an extra column of `FWER` if `adjust.method` is one of the `"holm"`, `"hochberg"`, `"hommel"`, and `"bonferroni"`.
`adjust.method` | character string stating the method used to adjust p-values for multiple testing.
`comparison` | a vector giving the names of the two groups being compared.
`test` | character string stating the name of the test.

The dimensions, row names and column names of a `TopTags` object are defined by those of `table`, see `dim.TopTags` or `dimnames.TopTags`.

`TopTags` objects also have a `show` method so that printing produces a compact summary of their contents.

Note that the terms ‘tag’ and ‘gene’ are synonymous here. The function is only named as ‘Tags’ for historical reasons.

### Author(s)

Mark Robinson, Davis McCarthy, Gordon Smyth

### References

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`, `p.adjust`.

Analogous to `topTable` in the limma package.

### Examples

    # 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")

[Package edgeR version 3.20.9 Index]