Skip to content.

bioconductor.org

Bioconductor is an open source and open development software project
for the analysis and comprehension of genomic data.

Sections

AffyLab-lab.R

################################################### ### chunk number 1: loadaffy ################################################### library("affy")

################################################### ### chunk number 2: ReadAffy eval=FALSE ################################################### ## MyData <- ReadAffy()

################################################### ### chunk number 3: ReadAffy2 eval=FALSE ################################################### ## ReadAffy(filenames=filenames.of.your.data)

################################################### ### chunk number 4: readdata ################################################### library("SpikeInSubset") data(spikein95) ## There's a problem with the name of the annotation data ## so we fix it here. Normally, this should not be needed. spikein95@cdfName <- "hgu95av2"

################################################### ### chunk number 5: addPhenoData ################################################### pd <- data.frame(population=factor(c("Pop1", "Pop1", "Pop1", "Pop2", "Pop2", "Pop2")), replicate=c(1, 2, 3, 1, 2, 3)) rownames(pd) <- sampleNames(spikein95) vl <- list(population="Pop1 is control, Pop2 is treatment", replicate="1, 2, 3, arbitrary numbering") phenoData(spikein95) <- new("phenoData", pData=pd, varLabels=vl)

################################################### ### chunk number 6: rma ################################################### eset <- rma(spikein95)

################################################### ### chunk number 7: justrma eval=FALSE ################################################### ## eset<- just.rma(filenames=list.celfiles())

################################################### ### chunk number 8: exprsDemo ################################################### e <- exprs(eset) dim(e)

################################################### ### chunk number 9: ################################################### pData(eset) pData(spikein95)

################################################### ### chunk number 10: columnAccess ################################################### Index1 <- which(eset$population == "Pop1") Index2 <- which(eset$population == "Pop2")

################################################### ### chunk number 11: gcrma ################################################### library("gcrma") eset2 <- gcrma(spikein95)

################################################### ### chunk number 12: threestep ################################################### library("affyPLM") eset3 <- threestep(spikein95, background=FALSE, summary.method="tukey.biweight")

################################################### ### chunk number 13: rowM ################################################### d <- rowMeans(e[, Index2]) - rowMeans(e[, Index1])

################################################### ### chunk number 14: rowMeans ################################################### a <- rowMeans(e)

################################################### ### chunk number 15: rowttests ################################################### library("genefilter") tt <- rowttests(eset, "population")

################################################### ### chunk number 16: eBayesEx ################################################### library("limma") design <- model.matrix(~eset$population) fit <- lmFit(eset, design) ebayes <- eBayes(fit)

################################################### ### chunk number 17: volcano ################################################### lod <- -log10(tt$p.value)

plot(d, lod, cex=.25, main="Volcano plot for $t$-test") abline(h=2)

################################################### ### chunk number 18: ################################################### table(tt$p.value<=0.01)

################################################### ### chunk number 19: toptable ################################################### tab <- topTable(ebayes,coef=2,adjust.method="BH",n=10) genenames <- as.character(tab$ID)

################################################### ### chunk number 20: annotate1 ################################################### library("annotate")

################################################### ### chunk number 21: annotate2 ################################################### annotation(eset)

################################################### ### chunk number 22: annotate3 ################################################### library("hgu95av2")

################################################### ### chunk number 23: entrezGeneAndSybol ################################################### ll <- getLL(genenames, "hgu95av2") sym <- getSYMBOL(genenames, "hgu95av2")

################################################### ### chunk number 24: output ################################################### tab <- data.frame(sym, signif(tab[,-1], 3)) htmlpage(ll, filename="GeneList1.html", title="HTML report", othernames=tab, table.head=c("Locus ID",colnames(tab)), table.center=TRUE)

################################################### ### chunk number 25: ################################################### browseURL("GeneList1.html")

################################################### ### chunk number 26: ################################################### library("KEGG") library("GO") library("annaffy") atab <- aafTableAnn(genenames, "hgu95av2", aaf.handler()) saveHTML(atab, file="GeneList2.html")

################################################### ### chunk number 27: annaffy2 ################################################### aaf.handler() atab <- aafTableAnn(genenames, "hgu95av2", aaf.handler()[c(2,5,8,12)]) saveHTML(atab, file="GeneList3.html")

News
2009-10-26

BioC 2.5, consisting of 352 packages and designed to work with R 2.10.z, was released today.

2009-01-07

R, the open source platform used by Bioconductor, featured in a series of articles in the New York Times.