Description Usage Arguments Details Value Note Author(s) See Also Examples
Extract a table of the topranked genes from a linear model fit.
1 2 3 4 5 
fit 
list containing a linear model fit produced by 
coef 
column number or column name specifying which coefficient or contrast of the linear model is of interest. For 
number 
maximum number of genes to list 
genelist 
data frame or character vector containing gene information.
For 
adjust.method 
method used to adjust the pvalues for multiple testing. Options, in increasing conservatism, include 
sort.by 
character string specifying which statistic to rank the genes by.
Possible values for 
resort.by 
character string specifying statistic to sort the selected genes by in the output data.frame. Possibilities are the same as for 
p.value 
cutoff value for adjusted pvalues. Only genes with lower pvalues are listed. 
lfc 
minimum absolute log2foldchange required.

confint 
logical, should confidence 95% intervals be output for 
... 
other 
These functions summarize the linear model fit object produced by lmFit
, lm.series
, gls.series
or mrlm
by selecting the topranked genes for any given contrast, or for a set of contrasts.
topTable
assumes that the linear model fit has already been processed by eBayes
.
topTreat
assumes that the fit has been processed by treat
.
If coef
has a single value, then the moderated tstatistics and pvalues for that coefficient or contrast are used.
If coef
takes two or more values, the moderated Fstatistics for that set of coefficients or contrasts are used.
If coef
is left NULL
, then all the coefficients or contrasts in the fitted model are used, except that any coefficient named (Intercept)
will be removed.
The pvalues for the coefficient/contrast of interest are adjusted for multiple testing by a call to p.adjust
.
The "BH"
method, which controls the expected false discovery rate (FDR) below the specified value, is the default adjustment method because it is the most likely to be appropriate for microarray studies.
Note that the adjusted pvalues from this method are bounds on the FDR rather than pvalues in the usual sense.
Because they relate to FDRs rather than rejection probabilities, they are sometimes called qvalues.
See help("p.adjust")
for more information.
Note, if there is no good evidence for differential expression in the experiment, that it is quite possible for all the adjusted pvalues to be large, even for all of them to be equal to one.
It is quite possible for all the adjusted pvalues to be equal to one if the smallest pvalue is no smaller than 1/ngenes
where ngenes
is the number of genes with nonmissing pvalues.
The sort.by
argument specifies the criterion used to select the top genes.
The choices are: "logFC"
to sort by the (absolute) coefficient representing the logfoldchange; "A"
to sort by average expression level (over all arrays) in descending order; "T"
or "t"
for absolute tstatistic; "P"
or "p"
for pvalues; or "B"
for the lods
or Bstatistic.
Normally the genes appear in order of selection in the output table.
If a different order is wanted, then the resort.by
argument may be useful.
For example, topTable(fit, sort.by="B", resort.by="logFC")
selects the top genes according to logodds of differential expression and then orders the selected genes by logratio in decreasing order.
Or topTable(fit, sort.by="logFC", resort.by="logFC")
would select the genes by absolute logfoldchange and then sort them from most positive to most negative.
Toptable output for all probes in original (unsorted) order can be obtained by topTable(fit,sort="none",n=Inf)
.
However write.fit
or write
may be preferable if the intention is to write the results to a file.
A related method is as.data.frame(fit)
which coerces an MArrayLM
object to a data.frame.
By default number
probes are listed.
Alternatively, by specifying p.value
and number=Inf
, all genes with adjusted pvalues below a specified value can be listed.
The argument lfc
gives the ability to filter genes by logfold change.
This argument is not available for topTreat
because treat
already handles foldchange thresholding in a more sophisticated way.
The function topTableF
is scheduled for removal in a future version of limma.
It is equivalent to topTable
with coef=NULL
.
A dataframe with a row for the number
top genes and the following columns:
genelist 
one or more columns of probe annotation, if genelist was included as input 
logFC 
estimate of the log2foldchange corresponding to the effect or contrast (for 
CI.L 
left limit of confidence interval for 
CI.R 
right limit of confidence interval for 
AveExpr 
average log2expression for the probe over all arrays and channels, same as 
t 
moderated tstatistic (omitted for 
F 
moderated Fstatistic (omitted for 
P.Value 
raw pvalue 
adj.P.Value 
adjusted pvalue or qvalue 
B 
logodds that the gene is differentially expressed (omitted for 
If fit
had unique rownames, then the row.names of the above data.frame are the same in sorted order.
Otherwise, the row.names of the data.frame indicate the row number in fit
.
If fit
had duplicated row names, then these are preserved in the ID
column of the data.frame, or in ID0
if genelist
already contained an ID
column.
Although topTable
enables users to set pvalue and lfc cutoffs simultaneously, this is not generally recommended.
If the fold changes and pvalues are not highly correlated, then the use of a fold change cutoff can increase the false discovery rate above the nominal level.
Users wanting to use fold change thresholding are usually recommended to use treat
and topTreat
instead.
In general, the adjusted pvalues returned by adjust.method="BH"
remain valid as FDR bounds only when the genes remain sorted by pvalue.
Resorting the table by logfoldchange can increase the false discovery rate above the nominal level for genes at the top of resorted table.
Gordon Smyth
An overview of linear model and testing functions is given in 06.LinearModels.
See also p.adjust
in the stats
package.
1  # See lmFit examples

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.