summarizeSamples: Summarize samples by applying the function to sample subsets

View source: R/summarizeSamples.R

summarizeSamplesR Documentation

Summarize samples by applying the function to sample subsets

Description

The function takes an eSet object and a factor of the same length as the object, and summarizes samples of the same factor level by applying the function.

Usage

summarizeSamples(
  eset,
  indSamples = eset$SAMPLEID,
  removeInvarCols = TRUE,
  fun = sum,
  ...
)

poolReplicates(eset, indSamples = eset$SAMPLEID, removeInvarCols = TRUE)

avgReplicates(eset, indSamples = eset$SAMPLEID, removeInvarCols = TRUE)

medianReplicates(eset, indSamples = eset$SAMPLEID, removeInvarCols = TRUE)

Arguments

eset

An eSet object.

indSamples

A factor of the same length as the sample number of the object

removeInvarCols

Logical, whether invariant columns of the resulting eSet pheno data should be removed or not. This is useful in case there are technical replicates.

fun

The function to be applied to summarize samples

...

Other parameters passed to the function

Details

poolReplicates and avgReplicates are two specific form of the more generic summarizeSamples function: they take sum and average of replicates given by the factor, respectively.

From version 1.1-7, the function summarizes not only exprs, but also all other objects in assayData

Value

A eSet object.

Author(s)

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

See Also

The function calls summarizeColumns internally.

Also see summarizeProbesets.

Examples


data(ribios.ExpressionSet, package="ribiosExpression")
index <- factor(c(gl(12,2), 13, 14))

(ss.eset1 <- summarizeSamples(ribios.ExpressionSet, index))

(ss.eset2 <- summarizeSamples(ribios.ExpressionSet, index, fun=mean,
na.rm=TRUE))
## equivalently
(ss.eset2 <- poolReplicates(ribios.ExpressionSet, index))

(ss.eset3 <- avgReplicates(ribios.ExpressionSet, index))


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