Design Matrix Microarray data analysis
1
0
Entering edit mode
9.7 years ago

Hi,

I'm analyzing a microarray data and stuck at the design matrix command.

I have few samples, in which I divided them into two groups i.e. "Controls" & "Diseased".

I assigned the samples information as a factor with two levels "C" & "D".

In what exact order should I assign the levels? If I assign levels as C, D then I get the logFC value as say X and if I do it as D, C I get the logFC value as -X.

Should I start with the diseased group (D) or control group (C)?

In default, in what exact order the design matrix take the levels?

My code is as follows:

info$Group<-factor(info$Group, levels=c("C","D"))

# ^^^ Which one should I consider first in the above command? The diseased group or control group? ^^^

levels(info$Group)

lev<-levels(info$Group)

design<-model.matrix(~0+info$Group)
colnames(design)<-lev
dim(design)
head(design)
fit<-lmFit(exp, design)
names(fit)
contr.str <- c()
len<-length(lev)
for(i in 1:(len-1))contr.str<-c(contr.str, paste(lev[(i+1):len], lev[i], sep="-"))
contr.str
contr.mat<-makeContrasts(contrasts=contr.str, levels=lev)
fit2<-contrasts.fit(fit, contr.mat)
fit2<-eBayes(fit2)
names(fit2)
top <- topTable(fit2, number=nrow(fit2), adjust.method="fdr")

Thanks in advance

design-matrix microarray • 3.4k views
ADD COMMENT
0
Entering edit mode
9.7 years ago
russhh 5.7k

It doesn't matter computationally, but it makes more sense to use the control sample as your referent, so levels = c('C', 'D') is a bit more pragmatic.

ADD COMMENT
0
Entering edit mode

Thanks a lot :)

ADD REPLY

Login before adding your answer.

Traffic: 1412 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6