I am using DESeq2_1.12.0 on R (version 3.3.0) to analyze RNASeq. I have some questions on how to set up the design formula and have looked at a number of multifactor analysis but can't quite find what I am looking for.
I have a total of 24 samples from twelve subjects.
- These twelve subjects are divided into two groups (group A and group B).
- In group A, samples were taken at day 0 and day 1.
- In group B, samples were taken at day 0 and day 5.
- The different sampling time between the groups is due to the destructive sampling procedure
- Within each group, half of the subject received treatment, while the other half didn't.
Here is how I set up the metadata table, with an added column for paired analysis (paired.subject)
Group |
treatment | time | subject | paired.subject |
---|---|---|---|---|
A |
control | day0 | one | one |
A |
control | day1 | one | one |
A |
control | day0 | two | two |
A |
control | day1 | two | two |
A |
control | day0 | three | three |
A |
control | day1 | three | three |
A |
treated | day0 | four | one |
A |
treated | day1 | four | one |
A |
treated | day0 | five | two |
A |
treated | day1 | five | two |
A |
treated | day0 | six | three |
A |
treated | day1 | six | three |
B |
control | day0 | seven | four |
B |
control | day5 | seven | four |
B |
control | day0 | eight | five |
B |
control | day5 | eight | five |
B |
control | day0 | nine | six |
B |
control | day5 | nine | six |
B |
treated | day0 | ten | four |
B |
treated | day5 | ten | four |
B |
treated | day0 | eleven | five |
B |
treated | day5 | eleven | five |
B |
treated | day0 | twelve | six |
B |
treated | day5 | twelve | six |
To figure out the differences between treated vs control within each group between the different time points, I subset the data based on groups and analyzed them separately.
dds <- DESeqDataSetFromMatrix(countData = countdata,
colData = coldata,
design = ~ treatment)
dds$combined <- factor(paste0(dds$treatment, dds$time))
m1 <- model.matrix(~paired.subject + combined, colData(dds))
- For example, for group A, difference between treated and control on day 1 was extracted by:
resdds <- results(dds, contrast = list("combined.treated.day1", "combined.control.day1")
My questions are:
- Is it possible to compare the differences between (combined.treated.day1-combined.treated.day0) to (combined.control.day1-combined.control.day0)?
- I know in the vignette and also in other posts that adding extra samples is typically better for the dispersion estimate DESeq2 design matrix for 6 groups.
- However, for this dataset, I don't get any DE genes when I combined groupA and groupB together, which is why I subset them. Any suggestion on what to do if I want to compare between day 1 and day 5?
Thanks for your feedback.
Can you post colData, so I can see if it matches what I was suggesting?