gene.names <- paste("g",1:100, sep = "")
# create random gene expression data matrix
set.seed(100)
x <- matrix(rnorm(100*10),ncol=10)
rownames(x) <- gene.names
b <- matrix(2*rnorm(50),ncol=5)
ind <- sample(1:10,replace=FALSE)
x[ind,6:10] <- x[ind,6:10] + b
l <- rep(1:2,c(5,5))
# create random gene sets
y <- vector("list", 20)
for(i in 1:length(y)){
y[[i]] <- sample(gene.names, size = 10)
}
names(y) <- paste("set", as.character(1:20), sep="")
mGSZ.obj <- mGSZ(x, y, l, p = 100)
top.mGSZ.sets <- toTable(mGSZ.obj, n = 10)
# scoring function profile data across the ordered gene list for top 2 gene sets
data4plot <- StabPlotData(mGSZ.obj,rank.vector=c(1,2))
# profile plot for the top gene set
plotProfile(data4plot,1)
# gene sets in a gmt format can be converted to mGSZ readable format as follows:
# gene.sets <- geneSetsList("gene.sets.gmt")
Run the code above in your browser using DataLab