gsvaEnrichment | R Documentation |
Extract and plot enrichment data from GSVA scores.
## S4 method for signature 'gsvaRanksParam'
gsvaEnrichment(
param,
column = 1,
geneSet = 1,
plot = c("auto", "base", "ggplot", "no"),
...
)
param |
A |
column |
The column for which we want to retrieve the enrichment data.
This parameter is only available in the |
geneSet |
Either a positive integer number between 1 and the number of
available gene sets in |
plot |
A character string indicating whether an enrichment plot should
be produced using either base R graphics ( |
... |
Further arguments passed to the |
When plot="no"
, this method returns the enrichment data. When
plot="ggplot"
, this method returns a ggplot
object. When plot="base"
no value is returned.
Hänzelmann, S., Castelo, R. and Guinney, J. GSVA: Gene set variation analysis for microarray and RNA-Seq data. BMC Bioinformatics, 14:7, 2013. DOI
library(GSVA)
p <- 10 ## number of genes
n <- 30 ## number of samples
nGrp1 <- 15 ## number of samples in group 1
nGrp2 <- n - nGrp1 ## number of samples in group 2
## consider three disjoint gene sets
geneSets <- list(gset1=paste0("g", 1:3),
gset2=paste0("g", 4:6),
gset3=paste0("g", 7:10))
## sample data from a normal distribution with mean 0 and st.dev. 1
y <- matrix(rnorm(n*p), nrow=p, ncol=n,
dimnames=list(paste("g", 1:p, sep="") , paste("s", 1:n, sep="")))
## genes in set1 are expressed at higher levels in the last 'nGrp1+1' to 'n' samples
y[geneSets$set1, (nGrp1+1):n] <- y[geneSets$set1, (nGrp1+1):n] + 2
## build GSVA parameter object
gsvapar <- gsvaParam(y, geneSets)
## calculate GSVA ranks
gsvarankspar <- gsvaRanks(gsvapar)
gsvarankspar
## by default the enrichment data for the first column and the first
## gene set are retrieved
gsvaEnrichment(gsvarankspar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.