Learn R Programming

gCMAP (version 1.16.0)

gsealm_score-methods: Methods for Function gsealm_score in Package gCMAP

Description

This method extends functions from the GSEAlm package to perform label-permutation based differential expression analysis. In addition to gene set membership, information about the gene sign (up- or down-regulated) is taken into consideration.

Usage

"gsealm_score"( query, set, removeShift=FALSE, predictor=NULL, formula=NULL, nPerm=1000, parametric=FALSE, respect.sign=TRUE, keep.scores=FALSE, ...)
"gsealm_score"(query, set, element="exprs", ... )
"gsealm_score"(query, set, predictor=NULL, ...)
"gsealm_score"(query, set, element="exprs",...)
"gsealm_score"(query, set, ...)
"gsealm_score"(query, set,...)
"gsealm_score"(query, set,...)
"gsealm_score"(query, set, element="exprs", ...)
"gsealm_score"(query, set, ...)

Arguments

query
An ExpressionSet or matrix with normalized expression data.
set
A CMAPCollection, GeneSetCollection or GeneSet object containing gene sets. Gene ids must match those of the 'query'
removeShift
logical: should normalization begin with a column-wise removal of the mean shift? Note: this option is not available for analysis of big.matrix backed eSet objects.
predictor
A character string identifying one column in the pData slot of a 'query' ExpressionSet from which to construct the formula for the linear model. Ignored if 'formula' is provided.
formula
The formula to be used in the linear model. See gsealmPerm for details.
nPerm
The number of sample-label permutations to perform.
parametric
Logical, if set to 'TRUE', no label permutations are performed. Instead, p-values are calculated based on a parametric approximation.
respect.sign
Logical, if set to 'FALSE', gene sign information is ignored, considering up- and down-regulated genes to be equal.
element
Character string specifying which element to extract when coercing an ExpressionSet from an eSet subclass.
keep.scores
Logical: keep gene-level scores for all gene sets (Default: FALSE) ? The size of the generated CMAPResults object increases with the number of contained gene sets. For very large collections, setting this parameter to 'TRUE' may require large amounts of memory.
...
Additional arguments passed on to downstream functions.

Value

This method returns a CMAPResults object.

See Also

gsealmPerm lmPerGene

Examples

Run this code
data(gCMAPData)

## induce gene sets from a collection of z-scores
gene.set.collection <- induceCMAPCollection(
  gCMAPData,
  "z",
  higher=2,
  lower=-2)
sampleNames(gene.set.collection) <- c("set1", "set2", "set3")

## random score matrix
y <- matrix(rnorm(1000*6),1000,6,
            dimnames=list(featureNames(gCMAPData), 1:6))

## set1 is differentially regulated
effect <- as.vector(members(gene.set.collection[,1]) * 2)
y[,4:6] <- y[,4:6] + effect

predictor <- c( rep("Control", 3), rep("Case", 3))

## run analysis and keep gene-level expression scores
res <- gsealm_score(
  y,
  gene.set.collection,
  predictor=predictor,
  nPerm=100,
  keep.scores=TRUE)
res

## heatmap of expression scores for set1
set1.expr <- geneScores(res)[["set1"]]
heatmap(set1.expr, scale="none", Colv=NA, labCol=predictor,
        RowSideColors=ifelse(
          attr(set1.expr, "sign") == "up", "red", "blue"),
        margin=c(7,5))
legend(0.35,0,legend=c("up", "down"),
    fill=c("red", "blue"),
    title="Annotated sign",
    horiz=TRUE, xpd=TRUE)

Run the code above in your browser using DataLab