my affy limma
August 26, 2010
setwd (“/ home/wanguan2000/array/Original Data”)
library (“affy”)
celpath <- file.path ("/ home/wanguan2000/array/Original Data / CEL /")
abatch <- ReadAffy (celfile.path = celpath)
eset <- rma (abatch)
pData (eset)
library (“hgu133plus2.db”)
setwd (“/ home/wanguan2000 / array / Original Data “)
library (limma)
library (” affy “)
targets <- readTargets (" targets.txt " )
rownames (targets) <-targets $ Id
targets
celpath <- file.path ("/ home/wanguan2000/array / Original Data / CEL / ")
abatch <- ReadAffy (filenames = targets $ FileName, celfile.path = c elpath)
sampleNames (abatch)
< br /> eset <- rma (abatch)
pData (eset)
ct <- factor (targets $ Type)
design <- model.matrix (~ 0 ct)
colnames (design) <- levels (ct)
colnames (design)
fit <- lmFit (eset, design)
# “nonrecurrent” “normal” “R” “recurrence”
cont.matrix <- makeContrasts (NRvsR = nonrecurrent-recurrence, NRvsNORvsREC = recurrence-nonrecurrent-normal, levels = design)
fit2 <- contrasts.fit (fit, cont.matrix)
fit2 <- eBayes (fit2)
topTable (fit2, coef = 1, adjust = “BH”)
cont.matrix <- makeContrasts (NRvsR = nonrecurrent-recurrence, levels = design)
fit2 <- contrasts.fit (fit, cont.matrix)
fit2 <- eBayes (fit2)
topTable (fit2, coef = 1, adjust = “BH” ) -> topgene
topTable (fit2, coef = 1, adjust = “BH”, n = 50)
tab = topTable (fit2, coef = 1, adjust = “BH”, n = 50)
genenames = as.character (tab $ ID)
library (“annotate”)
# annotation (CLLf2)
library (“hgu133plus2.db”)
l1 = getEG (genenames, “hgu133plus2″)
sym = getSYMBOL (genenames , “hgu133plus2″)
tab = data.frame (sym, signif (tab [, -1], 3))
htmlpage (list (l1), othernames = tab, filename = “mycha1. html”, title = “HTML reprot”, table.center = T, table.head = c (“Entrez ID”, colnames (tab)))
browseURL ( “mycha1.html”)
