R/single-sample-scoring-methods.R
zScore.Rd
Calculate single sample geneset score by average z-score method
zScore(x, summary = c("mean", "sqrt"), trim = 0, ...)
A list of stats related to the zscore. You care mostly about
$score
.
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