Designing of model.matrix for batch correction of Time Course data ?
0
0
Entering edit mode
8.3 years ago
unique379 ▴ 120

Dear folks,

I would like to correct batch of my time course data but the problem is to design matrix for sva as input. So is there way to design matrix having two groups (WT and KO) along with four time points (1 month, 3 months, 12 months and 22 months) including their replicates ??

> wt.ko.edesign
              time Time Group Replicates WT KO
F1WT5wks fiveWeeks    1    WT          1  1  0
F2WT5wks fiveWeeks    1    WT          1  1  0
F3WT5wks fiveWeeks    1    WT          1  1  0
F1WTY        young    3    WT          2  1  0
F2WTY        young    3    WT          2  1  0
F3WTY        young    3    WT          2  1  0
F4WTY        young    3    WT          2  1  0
F1WT1Y    one_year   12    WT          3  1  0
F2WT1Y    one_year   12    WT          3  1  0
F3WT1Y    one_year   12    WT          3  1  0
F4WT1Y    one_year   12    WT          3  1  0
F1WTOld        Old   22    WT          4  1  0
F2WTOld        Old   22    WT          4  1  0
F3WTOld        Old   22    WT          4  1  0
F4WTOld        Old   22    WT          4  1  0
F5WTOld        Old   22    WT          4  1  0
F6WTOld        Old   22    WT          4  1  0
F1KO5wks fiveWeeks    1    KO          5  0  1
F2KO5wks fiveWeeks    1    KO          5  0  1
F3KO5wks fiveWeeks    1    KO          5  0  1
F1KOY        young    3    KO          6  0  1
F2KOY        young    3    KO          6  0  1
F3KOY        young    3    KO          6  0  1
F4KOY        young    3    KO          6  0  1
F1KO1Y    one_year   12    KO          7  0  1
F2KO1Y    one_year   12    KO          7  0  1
F3KO1Y    one_year   12    KO          7  0  1
F4KO1Y    one_year   12    KO          7  0  1
F1KOOld        Old   22    KO          8  0  1
F2KOOld        Old   22    KO          8  0  1
F3KOOld        Old   22    KO          8  0  1
F4KOOld        Old   22    KO          8  0  1
F5KOOld        Old   22    KO          8  0  1
F6KOOld        Old   22    KO          8  0  1

I tried with :

ddsTC <- DESeqDataSetFromMatrix(countData=filtered, colData = wt.ko.edesign, design = ~Group + time +Group:time)

## Transfrom matrix in rlog
rld <- rlog(ddsTC,blind = TRUE)
dat <- as.matrix(assay(rld))

## design matrix for sva
mod <- model.matrix(~ Group + time + Group:time, colData(ddsTC))

## Run sva
sva_covariates <- sva(dat, mod, mod=NULL, n.sv=1)

But i am not sure whether i am doing right design matrix or should i only consider groups as :

mod <- model.matrix(~ Group, colData(ddsTC))

or Group and Time both as:

mod <- model.matrix(~ Group+ time, colData(ddsTC))

?? please help Thank you.

RNA-Seq sva RUVSeq • 2.5k views
ADD COMMENT

Login before adding your answer.

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