Calculate single sample geneset score by average z-score method

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)
#> [1] TRUE