Microarray Time series data analysis through limma ?
1
0
Entering edit mode
7.1 years ago
unique379 ▴ 90

Dear all,

I need to understand that whether my design matrix and analysis are correct or not. I have tow conditions, 4 time points for each and their corresponding replicates (total 31 sample, unfortunately experiment is not equal designed). I have done my analysis through and the aim was to see differential changes in between times (age), differential changes in between groups (conditions) and differential changes in between time and groups.

# target file

Replicate    Group    Time
WT.T1.1    WT    1
WT.T1.2    WT    1
WT.T1.3    WT    1
WT.T2.1    WT    2
WT.T2.2    WT    2
WT.T2.3    WT    2
WT.T2.4    WT    2
WT.T3.1    WT    3
WT.T3.2    WT    3
WT.T3.3    WT    3
WT.T3.4    WT    3
WT.T4.3    WT    4
WT.T4.4    WT    4
WT.T4.5    WT    4
WT.T4.6    WT    4
KO.T1.1    KO    1
KO.T1.2    KO    1
KO.T1.3    KO    1
KO.T2.1    KO    2
KO.T2.2    KO    2
KO.T2.3    KO    2
KO.T2.4    KO    2
KO.T3.1    KO    3
KO.T3.2    KO    3
KO.T3.3    KO    3
KO.T3.4    KO    3
KO.T4.2    KO    4
KO.T4.3    KO    4
KO.T4.4    KO    4
KO.T4.5    KO    4
KO.T4.6    KO    4

age<-factor(substring(colnames(wt.ko_counts),4,5))
> age
 [1] T1 T1 T1 T2 T2 T2 T2 T3 T3 T3 T3 T4 T4 T4 T4 T1 T1 T1 T2 T2 T2 T2 T3 T3
[25] T3 T3 T4 T4 T4 T4 T4
Levels: T1 T2 T3 T4
grp=factor(target$Group, levels=c("WT","KO"))
> grp
 [1] WT WT WT WT WT WT WT WT WT WT WT WT WT WT WT KO KO KO KO KO KO KO KO KO
[25] KO KO KO KO KO KO KO
Levels: WT KO

The aim was to see differential changes over times (age), differential changes in between groups (conditions) and differential changes in between time and groups.

design <- model.matrix(~age*grp)
colnames(design)

[1] "(Intercept)" "ageT2"       "ageT3"       "ageT4"       "grpKO"      
[6] "ageT2:grpKO" "ageT3:grpKO" "ageT4:grpKO"

lm.fit <- lmFit(wt.ko_counts, design)
eb <- eBayes(lm.fit)
topTable(eb, adjust="BH")

Finally, I plotted the expression values (from topTable) of each genes (taking the mean of replicates) which has lower than 0.05 FDR.

Query: Considering my aim, I need to understand that whether my design matrix and analysis are correct or not. or should I have to change something in my code or in design matrix? Please note that here I didn't consider natural regression spline and degree of freedom as described in limma user-guide. Is it necessary?

Thanks

microarray bioconductor RNA-Seq R limma • 3.6k views
ADD COMMENT
3
Entering edit mode
7.1 years ago
vivekbhr ▴ 660

I suggest you use a design matrix of all-to-all comparison (no intercept). Take all groups separately and collapse the replicates.

From your target_file data frame above, make a column called grp_time:

target_file$grptime <- paste(target_file$Group,target_file$Time,sep="_")
target_file <- target_file[c("Replicate","grptime")] # keep only replicate and grp_time column

Now convert it to factor and make the design matrix from this:

design <- model.matrix(~ 0 + target_file$grptime)
colnames(design) <- target_file$Replicate
fit <- lmfit(yourdata,design)

Now you can extract the differences you like, using appropriate contrast matrix. For example, which genes changed over time in WT.

cont.wt <- makeContrasts("WT_2 - WT_1","WT_3 - WT_2","WT_4 - WT_3",levels=design)
fit.wt <- contrasts.fit(fit,cont.wt)
eb <- eBayes(fit.wt)
topTable(eb, adjust="BH")

You can make different contrast matrices, depending on your question.

Hope this was useful.

ADD COMMENT
0
Entering edit mode

First of all thanks vivek for your kind reply and clear explanations. My previous analysis gives more information according to my biological questions. 1) changes over times (age) 2) differential changes in between groups (conditions) 3) differential changes in between time and groups (Interaction between groups too).

However, you way of analysis can elaborated my view and results thanks for that. I will make cont for KO as well.

by the way...

colnames(design) <- target_file$Replicate ## is not equal so I made changes
colnames(design) <- c("KO_1","KO_2","KO_3","KO_4","WT_1","WT_2","WT_3","WT_4")

Thanks once again. So kind of you.

ADD REPLY

Login before adding your answer.

Traffic: 844 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