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

Description Usage Arguments Examples

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

Description

Calculate single sample geneset score by average z-score method

Usage

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

Arguments

x

gene x sample matrix

summary

sqrt or mean

trim

calculate trimmed mean?

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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)

lianos/multiGSEA documentation built on Nov. 17, 2020, 1:26 p.m.