zScore: Calculate single sample geneset score by average z-score...

View source: R/single-sample-scoring-methods.R

zScoreR Documentation

Calculate single sample geneset score by average z-score method

Description

Calculate single sample geneset score by average z-score method

Usage

zScore(x, summary = c("mean", "sqrt"), trim = 0, ...)

Arguments

x

gene x sample matrix with rows already subsetted to the ones you care about.

summary

sqrt or mean

trim

calculate trimmed mean?

...

pass through arguments

Value

A list of stats related to the zscore. You care mostly about ⁠$score⁠.

Examples

vm <- exampleExpressionSet(do.voom=TRUE)
gdb <- conform(exampleGeneSetDb(), vm)
features <- featureIds(gdb, 'c2', 'BURTON_ADIPOGENESIS_PEAK_AT_2HR',
                       value='x.idx')
zscores <- zScore(vm[features,])

## Use scoreSingleSamples to facilitate scoring of all gene sets
scores.all <- scoreSingleSamples(gdb, vm, 'zscore', summary = "mean")
s2 <- with(subset(scores.all, name == 'BURTON_ADIPOGENESIS_PEAK_AT_2HR'),
           setNames(score, sample_id))
all.equal(s2, zscores$score)

lianos/sparrow documentation built on Dec. 8, 2024, 2:19 a.m.