simpleScore {singscore}R Documentation

single-sample gene-set scoring method

Description

This function computes 'singscores' using a ranked gene expression matrix obtained from the rankGenes() function and a gene set or a pair of up-regulated and down-regulated gene sets. It returns a data.frame of scores and dispersions for each sample. The gene sets can be in vector format or as GeneSet objects (from GSEABase packages). If samples need to be scored against a single gene set, the upSet argument should be used to pass the gene set while the downSet argument is set to NULL. This setting is ideal for gene sets representing gene ontologies where the nature of the genes is unknown (up- or down-regulated).

Usage

simpleScore(rankData, upSet, downSet = NULL, subSamples = NULL,
  centerScore = TRUE, dispersionFun = mad, knownDirection = TRUE)

## S4 method for signature 'ANY,vector,missing'
simpleScore(rankData, upSet, downSet = NULL,
  subSamples = NULL, centerScore = TRUE, dispersionFun = mad,
  knownDirection = TRUE)

## S4 method for signature 'ANY,GeneSet,missing'
simpleScore(rankData, upSet, downSet = NULL,
  subSamples = NULL, centerScore = TRUE, dispersionFun = mad,
  knownDirection = TRUE)

## S4 method for signature 'ANY,vector,vector'
simpleScore(rankData, upSet, downSet = NULL,
  subSamples = NULL, centerScore = TRUE, dispersionFun = mad,
  knownDirection = TRUE)

## S4 method for signature 'ANY,GeneSet,GeneSet'
simpleScore(rankData, upSet, downSet = NULL,
  subSamples = NULL, centerScore = TRUE, dispersionFun = mad,
  knownDirection = TRUE)

Arguments

rankData

A matrix object, ranked gene expression matrix data generated using the rankGenes() function

upSet

A GeneSet object or character vector of gene IDs of up-regulated gene set or a gene set where the nature of genes is not known

downSet

A GeneSet object or character vector of gene IDs of down-regulated gene set or NULL where only a single gene set is provided

subSamples

A vector of sample labels/indices that will be used to subset the rankData matrix. All samples will be scored if not provided

centerScore

A Boolean, specifying whether scores should be centered around 0, default as TRUE

dispersionFun

A function, dispersion function with default being mad

knownDirection

A boolean flag, it deterimines whether the scoring method should derive the scores in a directional mannar when the gene signature only contains one set of gene set (passing the gene set via upSet). It is default as TRUE but one can set the argument to be FALSE to derive the score for a single gene set in a undirectional way. This parameter becomes irrelevant when both upSet and downSet are provided.

Value

A data.frame consists of singscores and dispersions for all samples

See Also

rank "GeneSet"

Examples

ranked <- rankGenes(toy_expr_se)
scoredf <- simpleScore(ranked, upSet = toy_gs_up, downSet = toy_gs_dn)
# toy_gs_up is a GeneSet object, alternatively a vector of gene ids may also 
# be supplied.

[Package singscore version 1.0.0 Index]