GSEA.listofgenes: GSEA for a list of genesets

Description Usage Arguments Value Author(s) See Also Examples

View source: R/GSEA.listofgenes.R

Description

GSEA.listofgenes actually takes a list of genesets as input and performs the GSEA analysis for all of the genesets. Useful for collection of genesets, e.g. from the Molecular Signatures Database

Usage

1
GSEA.listofgenes(m, lG, o = NULL, nperms = 1000, metric = c("SNR", "FC"))

Arguments

m

matrix of expressions. columns represent samples, rows are genes.

lG

list of gene sets. genes must be in rownames(m).

o

2-class factor where length(o) equals ncol(m). If left to NULL, m is considered as a paired difference between two classes.

nperms

number of permutations to use. Default:1000

metric

one of SNR or FC to respectively use snr.SNR or snr.FC function as metric in the GSEA analysis

Value

returns a list with 3 elements : lRes is a matrix of two columns and length(lG) rows. For each geneset, column 1 gives the Up-regulation p-value, column 2 gives the Down-regulation p-value.

Author(s)

maxime.tarabichi@ulb.ac.be

See Also

GSEA.plot; readgmt;

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
##creates matrix of expression with rownames = gene names
m<-matrix(rnorm(10*10000),10000,10)
rownames(m)<-paste("r",1:10000)

## creates 2-level factor
o<-as.factor(c(rep(1,5),rep(2,5)))


## creates list of 10 genesets of size 100
lG<-lapply(1:10,function(x) paste("r",sample(1:10000,100,rep=F)))
names(lG)<-paste("GS",1:10)


##perform GSEA analysis; may take ~1 minute for 1000 permutations;
##depending on your machine of course
res<-GSEA.listofgenes(m,lG,o,1000)
fdr<-computeFDRmedian(res)
str(fdr)

galder-max/GSEAlite documentation built on Jan. 30, 2021, 10:50 p.m.