Question: Designing of model.matrix for batch correction of Time Course data ?
0
gravatar for unique379
3.0 years ago by
unique37970
Spain
unique37970 wrote:

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 ruvseq sva • 1.3k views
ADD COMMENTlink modified 2.9 years ago by Biostar ♦♦ 20 • written 3.0 years ago by unique37970
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 609 users visited in the last hour