Hi everyone,
I have an RNA-seq experiment with the following factors - $timepoint (0,2,6,12), $outcome (complete, incomplete), and patient (1:10)
I want to make the following plots to ask the questions
- Does the gene SCAR1 differ between weeks 0 and 2 across all samples.
- In week 0, is SCAR1 expression different between complete and incomplete responders.
- In week 2, is SCAR1 expression different between complete and incomplete responders.
Here is an example dataframe:
data = data.frame(
counts = rnorm(40, mean = 100, sd = 10),
timepoint = c(
rep('0',10),
rep('2',10),
rep('6',10),
rep('12',10)
),
outcome = rep(c(rep('complete',5), rep('incomplete',5)), 4),
patient = rep(
rep(c('1','2','3','4','5','6','7','8','9','10'), 1), 4
)
)
How can I use DESeq2 for this? I am really struggling to get my head around the use of the design formula and contrasts. I've read the docs and read other forum questions and I still can't understand it. I'd greatly appreciate any help at all.
The closest I have in my mind is the following:
However, I don't understand whether this result is written properly. This design also does not correct for patient id of each sample.
Thank you for any help.