summarizeProbesets: Summarize probesets belonging to the same gene

View source: R/summarizeProbesets.R

summarizeProbesetsR Documentation

Summarize probesets belonging to the same gene

Description

The summarizeRows function summarizes (collapses) rows of a numeric matrix by calculating summarizing statistics of rows that belong to the same factor level.

Usage

summarizeProbesets(
  eset,
  index.name,
  fun = mean,
  keep.nonindex = FALSE,
  keep.featureNames = FALSE,
  ...
)

Arguments

eset

An ExpressionSet object

index.name

Charcter, one column name in the eset, indicating the index of probesets, probably the column holding the GeneID.

fun

Function or character, the function used to summarize probes, mean by default. Other possibilities include median.

keep.nonindex

Logical, whether probesets without valid indices should be kept or not.

keep.featureNames

Logical, whether the featureNames of the input object should be kept whenever possible. When multiple probesets are summarized into one value representing, for example, one gene (by GeneID), one arbitrary probeset is used to name the value when this option is set to TRUE. Otherwise the GeneID will be used as the name of the value. In case no summary was possible, for instance the index is NA, old feature names are kept any way.

...

Futher parameters passed to the function

Details

summarizeRows is called internally by summarizeProbesets to collapse probesets that belong to one index (e.g. GeneID).

The action of this function is univariate: namely the fun is applied to all probesets on each sample independently. For example, if fun is mean, the average value of mutliple probesets is taken for each sample. With this function, there is no way to distinguish probesets on their expression profiles (for instance: find the probeset with the maximum average signal).

Value

An ExpressionSet, with probesets summarized by indices specified.

Author(s)

Jitao David Zhang <jitao_david.zhang@roche.com>

See Also

summarizeRows in the ribiosUtils package.

Examples


data(ribios.ExpressionSet, package="ribiosExpression")
ribios.mean <- summarizeProbesets(ribios.ExpressionSet,
index.name="GeneID", fun=mean)
ribios.mean

data(ribios.ExpressionSet, package="ribiosExpression")
ribios.mean.keepFeatureNames <- summarizeProbesets(ribios.ExpressionSet,
index.name="GeneID", fun=mean, keep.featureNames=TRUE)
ribios.mean

ribios.inval.mean <- summarizeProbesets(ribios.ExpressionSet,
index.name="GeneID", fun=mean, keep.nonindex=TRUE)

## the underlying method
ribios.meanMat <- ribiosUtils::summarizeRows(exprs(ribios.ExpressionSet),
fData(ribios.ExpressionSet)$GeneID, mean)
stopifnot(identical(exprs(ribios.mean), ribios.meanMat))

## keep old featureNames
ribios.inval.mean.old <- summarizeProbesets(ribios.ExpressionSet,
index.name="GeneID", fun=mean, keep.nonindex=TRUE, keep.featureNames=TRUE)


bedapub/ribiosExpression documentation built on Sept. 2, 2023, 4:37 a.m.