avereps: Average Over Irregular Replicate Probes

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

View source: R/dups.R

Description

Condense a microarray data object so that values for within-array replicate probes are replaced with their average.

Usage

1
2
3
4
5
6
## Default S3 method:
avereps(x, ID=rownames(x), ...)
## S3 method for class 'MAList'
avereps(x, ID=NULL, ...)
## S3 method for class 'EList'
avereps(x, ID=NULL, ...)

Arguments

x

a matrix-like object, usually a matrix, MAList or EList object.

ID

probe identifier.

...

other arguments are not currently used.

Details

A new data object is computed in which each probe ID is represented by the average of its replicate spots or features.

For an MAList object, the components M and A are both averaged in this way, as are weights and any matrices found in object$other. For an MAList object, ID defaults to MA$genes$ID is that exists, otherwise to rownames(MA$M).

EList objects are similar, except that the E component is averaged instead of M and A.

If x is of mode "character", then the replicate values are assumed to be equal and the first is taken as the average.

Value

A data object of the same class as x with a row for each unique value of ID.

Note

This function should only be applied to normalized log-expression values, and not to raw unlogged expression values. It will generate an error message if applied to RGList or EListRaw objects.

Author(s)

Gordon Smyth

See Also

avedups, avearrays. Also rowsum in the base package.

02.Classes gives an overview of data classes used in LIMMA.

Examples

1
2
3
4
x <- matrix(rnorm(8*3),8,3)
colnames(x) <- c("S1","S2","S3")
rownames(x) <- c("b","a","a","c","c","b","b","b")
avereps(x)

Example output

          S1          S2         S3
b  0.3242043 -0.01535667  0.6149504
a  0.2502608  0.50915581 -0.2936488
c -0.8335200  0.14981011  0.7973654

limma documentation built on Nov. 8, 2020, 8:28 p.m.