# Load example input data (dummy p-values and gene set collection):
data("gsa_input")
# Load gene set collection:
gsc <- loadGSC(gsa_input$gsc)
# Randomly select 100 genes of interest (as an example):
genes <- sample(unique(gsa_input$gsc[,1]),100)
# Run gene set analysis using Fisher's exact test:
res <- runGSAhyper(genes, gsc=gsc)
# If you have p-values for the genes and want to make a cutoff for significance:
genes <- names(gsa_input$pvals) # All gene names
p <- gsa_input$pvals # p-values for all genes
res <- runGSAhyper(genes, p, pcutoff=0.001, gsc=gsc)
# If the 20 first genes are the interesting/significant ones they can be selected
# with a binary vector:
significant <- c(rep(0,20),rep(1,length(genes)-20))
res <- runGSAhyper(genes, significant, gsc=gsc)
Run the code above in your browser using DataLab