Description Usage Arguments Details Value Examples
View source: R/single-sample-scoring-methods.R
This method was developed by Jason Hackney and first introduced in the following paper doi:10.1038/ng.3520. It produces a single sample gene set score in values that are in "expression space," the innards of which mimic something quite similar to an eigengene based score.
To easily use this method to score a number of gene setes across an
experiment, you'll want to have the scoreSingleSamples()
method
drive this function via specifying "svd"
as one of the
methods
.
1 2 3 4 5 6 7 8 9 10 11 12 |
x |
An expression matrix of genes x samples. When using this to score
geneset activity, you want to reduce the rows of |
eigengene |
the "eigengene" you want to get the score for. only accepts a single value for now. |
center, scale |
center and/or scale data before scoring? |
uncenter, unscale |
uncenter and unscale the data data on the way out?
Defaults to the respective values of |
retx |
Works the same as |
... |
these aren't used in here |
.drop.sd |
When zero-sd (non varying) features are scaled, their values
are |
The difference between this method vs the eigengene score is that the SVD is used to calculate the eigengene. The vector of eigengenes (one score per sample) is then multiplied through by the SVD's left matrix. This produces a matrix which we then take the colSums of to get back to a single sample score for the geneset.
Why do all of that? You get data that is back "in expression space" and we
also run around the problem of sign of the eigenvector. The scores you get
are very similar to average zscores of the genes per sample, where the
average is weighted by the degree to which each gene contributes to the
principal component chosen by eigengene
, as implemented in the
eigenWeightedMean()
function.
The core functionality provided here is taken from the soon to be released GSDecon package by Jason Hackney
A list of useful transformation information. The caller is likely
most interested in the $score
vector, but other bits related to
the SVD/PCA decomposition are included for the ride.
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 <- gsdScore(vm[features,])$score
## Use scoreSingleSamples to facilitate scoring of all gene sets
scores.all <- scoreSingleSamples(gdb, vm, 'gsd')
s2 <- with(subset(scores.all, name == 'HALLMARK_INTERFERON_GAMMA_RESPONSE'),
setNames(score, sample_id))
all.equal(s2, scores)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.