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).

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

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

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

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

# S4 method for matrix,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. Note: scores never centered if knownDirection = FALSE

dispersionFun

A function, dispersion function with default being mad

knownDirection

A boolean, determining whether the gene set should be considered to be directional or not. A gene set is directional if the type of genes in it are known i.e. up- or down-regulated. This should be set to TRUE if the gene set is composed of both up- AND down-regulated genes. Defaults to TRUE. This parameter becomes irrelevant when both upSet(Colc) and downSet(Colc) 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.