zScore.Rd
Calculate single sample geneset score by average z-score method
zScore(x, summary = c("mean", "sqrt"), trim = 0, ...)
x | gene x sample matrix |
---|---|
summary | sqrt or mean |
trim | calculate trimmed mean? |
vm <- exampleExpressionSet(do.voom=TRUE) gdb <- conform(getMSigGeneSetDb('H', "human", "entrez"), vm) features <- featureIds(gdb, 'H', 'HALLMARK_INTERFERON_GAMMA_RESPONSE', value='x.idx') scores <- zScore(vm[features,])$score ## Use scoreSingleSamples to facilitate scoring of all gene sets scores.all <- scoreSingleSamples(gdb, vm, 'zscore') s2 <- with(subset(scores.all, name == 'HALLMARK_INTERFERON_GAMMA_RESPONSE'), setNames(score, sample_id)) all.equal(s2, scores)#> [1] "Mean relative difference: 0.08505654"