Learn R Programming

saps (version 2.4.2)

plotEnrichment: Plot concordance indices for a geneset

Description

This function draws concordance indices for a given geneset relative to the concordance indices for all the genes in the dataset (i.e., the degree of enrichment for the geneset).

Usage

plotEnrichment(geneset, rankedGenes)

Arguments

geneset
A geneset as returned by saps.
rankedGenes
A vector of concordance index z-scores. Usually this will be the rankedGenes element returned by saps.

Value

  • The function is used for side-effects (drawing a plot). No value is returned.

See Also

saps rankConcordance

Examples

Run this code
# 25 patients, none lost to followup
followup <- rep(1, 25)

# first 5 patients have good survival (in days)
time <- c(25, 27, 24, 21, 26, sample(1:3, 20, TRUE))*365

# create data for 100 genes, 25 patients
dat <- matrix(rnorm(25*100), nrow=25, ncol=100)
colnames(dat) <- as.character(1:100)

# create two random genesets of 5 genes each
set1 <- sample(colnames(dat), 5)
set2 <- sample(colnames(dat), 5)

genesets <- rbind(set1, set2)

# run saps
results <- saps(genesets, dat, time, followup, random.samples=100)

set <- results$genesets[["set1"]]

# p_enrich should not be significant
plotEnrichment(set, results$rankedGenes)

# increase expression levels for set1 for first 5 patients
dat[1:5, set1] <- dat[1:5, set1]+10

# run saps again
results <- saps(genesets, dat, time, followup, random.samples=100)

set <- results$genesets[["set1"]]

# now it should be significant
plotEnrichment(set, results$rankedGenes)

Run the code above in your browser using DataLab