Hi Everybody,
I have a question regarding limma design matrix. I searched for "limma and design" but could not find an answer for my question. I will be happy if you could send me the link if a similar question has been answered previously!
I am re-analyzing a data set from GEO (GSE74615) to compare with some published microarray data and an RNA-Seq that we have.
I generated the target file as bellow:
FileName Cy3 Cy5
US12302316_252665511011_S01_GE2-v5_95_Feb07_1_1.txt microglia_WT microglia_AD
US12302316_252665511011_S01_GE2-v5_95_Feb07_1_2.txt microglia_AD microglia_WT
US12302316_252665511011_S01_GE2-v5_95_Feb07_1_3.txt microglia_WT microglia_AD
US12302316_252665511011_S01_GE2-v5_95_Feb07_1_4.txt microglia_AD microglia_WT
US12302316_252665511015_S01_GE2-v5_95_Feb07_1_1.txt microglia_WT microglia_AD
US12302316_252665511015_S01_GE2-v5_95_Feb07_1_2.txt microglia_AD microglia_WT
US12302316_252665511015_S01_GE2-v5_95_Feb07_1_3.txt microglia_AD microglia_WT
US12302316_252665511016_S02_GE2-v5_95_Feb07_1_1.txt astrocytes_AD astrocytes_WT
US12302316_252665511016_S02_GE2-v5_95_Feb07_1_2.txt astrocytes_WT astrocytes_AD
US12302316_252665511016_S02_GE2-v5_95_Feb07_1_3.txt astrocytes_WT astrocytes_AD
US12302316_252665511016_S02_GE2-v5_95_Feb07_1_4.txt astrocytes_AD astrocytes_WT
What I want to do for DE gene analysis is to compare the followings:
1) microglia_AD vs microglia_WT
2) astrocytes_AD vs astrocytes_WT
3) astrocytes_AD vs microglia_AD
4) astrocytes_WT vs microglia_WT
I did the first 2 comparisons with the script below
library("limma")
wtFun <- function(x) as.numeric(x$ControlType == 0)
targets <- readTargets()
microglia <- targets[!(targets$Cy3 %in% "astrocytes_AD") & !(targets$Cy5 %in% "astrocytes_AD"),]
astrocytes <- targets[!(targets$Cy3 %in% "microglia_AD") & !(targets$Cy5 %in% "microglia_AD"),]
#1) microglia_AD vs microglia_WT
RG <- read.maimages(microglia, source = "agilent", annotation = "ProbeName", wt.fun = wtFun)
RG <- backgroundCorrect(RG, method = "normexp", offset = 50)
MA <- normalizeBetweenArrays(RG, method = "quantile")
MA <- avereps(MA, ID = MA$genes$ProbeName)
design <- modelMatrix(microglia, ref = "microglia_WT")
fit <- lmFit(MA, design)
fit <- eBayes(fit, trend = TRUE)
allResults <- topTable(fit, n = Inf)
#2) astrocytes_AD vs astrocytes_WT
RG <- read.maimages(astrocytes, source = "agilent", annotation = "ProbeName", wt.fun = wtFun)
RG <- backgroundCorrect(RG, method = "normexp", offset = 50)
MA <- normalizeBetweenArrays(RG, method = "quantile")
MA <- avereps(MA, ID = MA$genes$ProbeName)
design <- modelMatrix(astrocytes, ref = "astrocytes_WT")
fit <- lmFit(MA, design)
fit <- eBayes(fit, trend = TRUE)
allResults <- topTable(fit, n = Inf)
is there an easier way to design a design matrix that can do all the comparisons?
thank you very much in advance,
ilyas.
Note first that there was a typo on the 10th line of your targets file, which had "astroyctes" instead of "astrocytes". I have edited your post to fix that, and you should obviously make sure this is correct in your analysis as well.