################################################### ### chunk number 1: set width ################################################### options(width=60) options(continue=" ") ################################################### ### chunk number 2: load data ################################################### library(ALL) library(hgu95av2.db) library(genefilter) library(eisa) library(GO.db) data(ALL) ################################################### ### chunk number 3: filter limits ################################################### varLimit <- 0.5 kLimit <- 4 ALimit <- 5 ################################################### ### chunk number 4: filtering the data ################################################### flist <- filterfun(function(x) var(x)>varLimit, kOverA(kLimit,ALimit)) ALL.filt <- ALL[genefilter(ALL, flist), ] ################################################### ### chunk number 5: keep B cell data only ################################################### ALL.filt2 <- ALL.filt[, grepl("^B", ALL.filt$BT)] ################################################### ### chunk number 6: run ISA ################################################### set.seed(2) modules <- ISA(ALL.filt2, flist=NA, thr.gene=seq(2,4,by=0.5), thr.cond=1) ################################################### ### chunk number 7: sweep ################################################### modules2 <- ISASweep(ALL.filt2, modules) ################################################### ### chunk number 8: sweep result ################################################### modules modules2 colnames(seedData(modules)) colnames(seedData(modules2)) ################################################### ### chunk number 9: getting the graph ################################################### G <- ISASweepGraph(modules2) ################################################### ### chunk number 10: G ################################################### list.graph.attributes(G) list.vertex.attributes(G) ################################################### ### chunk number 11: G size ################################################### G$width G$height ################################################### ### chunk number 12: plotting eval=FALSE ################################################### ## X11(width=G$width, height=G$height) ################################################### ### chunk number 13: plotting2 eval=FALSE ################################################### ## ISASweepGraphPlot(G) ################################################### ### chunk number 14: plot ################################################### ps.options(fonts=c("serif", "mono")) ISASweepGraphPlot(G) ################################################### ### chunk number 15: enrichment ################################################### GO <- ISAGO(modules2) ################################################### ### chunk number 16: customize ################################################### p.bp <- sapply(summary(GO$BP), function(x) as.integer(-log10(x$Pvalue[1]))) c.bp <- d.bp <- sapply(sigCategories(GO$BP), function(x) x[1]) d.bp[!is.na(c.bp)] <- sapply(mget(na.omit(c.bp), GOTERM), Term) d.bp <- abbreviate(d.bp, 6) colbar <- hcl(h=260, c=35, l=seq(30, 100, length=20)) colbar <- c("#FFFFFF", rev(colbar)) col <- colbar[p.bp] ################################################### ### chunk number 17: plotting3 eval=FALSE ################################################### ## X11(width=G$width, height=G$height) ################################################### ### chunk number 18: plotting4 eval=FALSE ################################################### ## ISASweepGraphPlot(G, vertex.color=col, vertex.size2=50, ## vertex.label.topleft=d.bp, ## vertex.label.topright=paste(V(G)$noFeatures, sep=",", ## V(G)$noSamples)) ################################################### ### chunk number 19: key eval=FALSE ################################################### ## key <- na.omit(d.bp)[unique(names(na.omit(d.bp)))] ## key2 <- paste(key, sep=": ", names(key)) ## legend("topright", key2) ################################################### ### chunk number 20: plot2 ################################################### ISASweepGraphPlot(G, vertex.color=col, vertex.size2=50, vertex.label.topleft=d.bp, vertex.label.topright=paste(V(G)$noFeatures, sep=",", V(G)$noSamples)) key <- na.omit(d.bp)[unique(names(na.omit(d.bp)))] key2 <- paste(key, sep=": ", names(key)) legend("topright", key2) ################################################### ### chunk number 21: sessioninfo ################################################### toLatex(sessionInfo())