Hello all,
I have a dataset for which I have 6 samples- 2 controls, 2 for Treatment A and 2 for Treatment B. If I have a column in my Metadata called Treatment and it looked like this. (The brackets are included in the name as well)
Treatment |
---|
Control (1) |
Control (2) |
Treatment A (1) |
Treatment A(2) |
Treatment B (1) |
Treatment B (2) |
And I wanted to compare control vs Treatment A and control vs Treatment B, would I be able to specify it under design= ~Treatment or would I have to use contrast? Or is it best to rename the rows altogether as Control, Treatment A and Treatment B?
Thanks!
Hi Michael,
Thank you for your concern. I have several datasets and the one concerning the question has raw counts and is not from the microarray experiment I had asked previously about!
What I have tried so far is renaming the rows to Control, Control, Treatment A, Treatment A, Treatment B, Treatment B and then the following:
dds<- DESeqDataSetFromMatrix(countData=df,colData=mtfinal, design=~Treatment)
dds$Treatment <- factor(dds$Treatment, levels =c('control','Treatment A','Treatment B'))
dds<- DESeq(dds)
res1<-results(dds, contrast=c('Treatment','control','Treatment A'))
res2<-results(dds, contrast=c('Treatment','control','Treatment B'))
Is this the right way or is there a better method? Thank you for your help.
Ok, assuming you have RNA-seq counts, then for this experiment you would use a design of ~treatment, followed by DESeq() and results(). See the help page for ?results, in particular the 'contrast' argument as to how you could compare B vs control and A vs control. You can find all the information in the help pages:
Thank you very much. If you do not mind, could you advice on how we would be able to tell if we were dealing with interaction terms? For instance, how can we tell if we should use
design(dds) <- ~ genotype + condition + genotype:condition
or
dds$group <- factor(paste0(dds$genotype, dds$condition))
Should we already know for a fact that condition affects genotype to use the former?
Thanks.