baySeq (version 2.6.0)

topCounts: Get the top counts corresponding to some group from a 'countData' object

Description

Takes posterior likelihoods and returns the counts with highest (or lowest) likelihood of association with a given group.

Usage

topCounts(cD, group, ordering, decreasing = TRUE, number = 10, likelihood, FDR, FWER, normaliseData = FALSE)

Arguments

cD
countData or pairedData object, containing posterior likelihoods for each group.
group
Which group should we give the counts for? See Details.
ordering
If specified, restricts the analysis to a particlar ordering on the group.
decreasing
Ordering on posterior likelihoods.
number
How many results should be returned?
likelihood
If given, ignores `number' and returns all results above a certain likelihood.
FDR
If given, ignores `number' and returns all results with an FDR lower than this threshold. Will be ignored if `likelihood' is given.
FWER
If given, ignores `number' and returns all results with an FWER lower than this threshold. Will be ignored if `likelihood' or FDR are given.
normaliseData
Should the displayed counts be normalised? See details. Defaults to FALSE.

Value

A dataframe of the top counts associated with some model (group), described by annotation drawn from the '@annotation' slot of the 'cD' object and the raw data from the '@data' slot, together with the posterior likelihoods and false discovery rates.

Details

The argument 'group' can be specified either as a number, giving the index of an element in the cD@groups list, or as a character string identifying an element by name. Partial matching is allowed. If group = NULL, then the function looks at the posterior likelihoods that the data have no true differential expression (if calculated). If a countData object is given, the returned dataframe will contain either the raw counts for that object, or (if 'normaliseData = TRUE' the counts normalised by library size.

If a pairedData object is given, the returned data frame will contain either the raw counts shown as a ratio, or (if 'normaliseData = TRUE' the counts in the '@data' slot as a percentage of the total counts in the '@data' and '@pairData' slots.

See Also

countData

Examples

Run this code

# We load in a `countData' object containing the estimated posterior
# likelihoods of expression (see `getLikelihoods').

data(CDPost)

# Report the top ten rows of data that have highest likelihood of belonging to
# group 2 of the data (i.e., differentially expressed)

topCounts(CDPost, group = "DE", number = 10)

# equivalently...
topCounts(CDPost, group = 2, number = 10)


# Report the top ten rows of data that have highest likelihood of belonging to
# group 2 of the data (i.e., differentially expressed), with group 1
# being overexpressed compared to group 2.

topCounts(CDPost, group = "DE", ordering = "1>2", number = 10)

Run the code above in your browser using DataLab