Using Bioconductor To Analyse Microarray Data: Difference between revisions
mNo edit summary |
|||
| (5 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
[[Category:R]] | [[Category:R]] | ||
[[Category:Bioinformatics]] | [[Category:Bioinformatics]] | ||
[[Category: Bioconductor]] | |||
==Software Requirements== | ==Software Requirements== | ||
| Line 27: | Line 28: | ||
**series - '''GSE''' | **series - '''GSE''' | ||
<pre> | <pre> | ||
gds <- getGEO(" | gds <- getGEO("GDS2946") #load GDS162 dataset | ||
Meta(gds) #show extracted meta data | Meta(gds) #show extracted meta data | ||
table(gds)[1:10,] #show first ten rows of dataset | table(gds)[1:10,] #show first ten rows of dataset | ||
| Line 40: | Line 41: | ||
<pre> | <pre> | ||
library(limma) #load limma package | library(limma) #load limma package | ||
library(affyPLM) #load affyPLM package | |||
eset.norm <- normalize.ExpressionSet.quantiles(eset) #normalize expression set by quantile method | |||
pData(eset) #to see phenotype annotation data | pData(eset) #to see phenotype annotation data | ||
design | design=model.matrix(~ -1+factor(c(1,1,1,1,1,1,1,2,2,2,2,2,2,2,2) #set design matirx | ||
colnames(design) <- c(" | colnames(design) <- c("obese","lean") # give names to the treatment groups | ||
design #check the design matrix | design #check the design matrix | ||
fit <- lmFit(eset,design) | fit <- lmFit(eset.norm, design) #Fit data to linear model | ||
fit.eb <- eBayes(fit) | cont.matrix <- makeContrasts(Obese.vs.Lean=obese-lean, levels=design) | ||
write.csv(fit.eb, file="filename.csv") #write to CSV file | fit.cont <- contrasts.fit(fit, cont.matrix) | ||
fit.cont.eb <- eBayes(fit.norm) #Empirical Bayes | |||
write.csv(fit.cont.eb, file="filename.csv") #write to CSV file | |||
</pre> | |||
==Clustering Analysis== | |||
Bioconductor packages can calculate distance matrices: | |||
<pre> | |||
hc <- hclust(dist(t(exprs(eset.norm)))) | |||
plot(hc) | |||
</pre> | </pre> | ||