Sunday, October 28, 2007

Marray

library(marray)

datadir <- system.file("swirldata", package="marray")
dir(datadir)
swirlTargets <- read.marrayInfo(file.path(datadir, "SwirlSample.txt"))

# To read Spot files (.spot)
mraw <- read.Spot(targets=swirlTargets, path=datadir)

# To read GenePix files (.gpr)
data <- read.GenePix(targets=swirlTargets)

galinfo <- read.Galfile("fish.gal", path=datadir)
mraw@maLayout <- galinfo$layout
mraw@maGnames <- galinfo$gnames

# Array quality assessment
library(arrayQuality)
maQualityPlots(mraw)
image(mraw[,1])
boxplot(mraw)
plot(mraw[,2])

# Normalization
normdata <- maNorm(mraw)
summary(normdata)

# Write normalized data
write.marray(normdata)

# data analysis with limma
LMres <- lmFit(normdata, design=c(1,-1,-1,1), weights=NULL)
LMres <- eBayes(LMres)
restable <- toptable(LMres, number=50, genelist=maGeneTable(normdata), resort.by="M")

# output
table2html(restable, disp="file")

No comments: