I just want to make sure that I am doing this right
If I want to select the first three column of my data to be my control the design should look like below?
design <- model.matrix(~c(rep(0,3),rep(1,3)))
is this the same for DESq2?
Assuming there are only 6 samples and your final three columns are the non-control samples, this will work. However, you might want to give the columns of the design matrix more meaningful names than generated by your code. For example,
design <- model.matrix(~ c(0,0,0,1,1,1))
colnames(design) <- c("baseline", "treatment")
In this design the second column corresponds to the difference between treatment and control, so this should be used as your contrast.
@russhh are you sure that when we have the control , we should assign 0 to it and not 1?
Theoretically it doesn't matter. Try it both ways, see how your experimental changes (contrast coefficients) differ when you use the two different model matrices: look at boxplots of the raw counts when you're doing this. Personally, I think it makes sense for the control to be the baseline. There are many other ways to set up a model matrix for this experiment: you could have ones for control and zeros for treated in column1 and zeros for control and ones for treated in column2; you could have all ones in column1 and -1 for control, 1 for treated in column2. I've probably just confused matters....
Login before adding your answer.
Use of this site constitutes acceptance of our User Agreement and Privacy