Hi,
I have a dataset including 2 variables, pH (8 values) and strains consortium (5 values) all in triplicate. The pH variable can be seen as a time because I took samples during fermentation. I would like to answer two questions: 1- For a given strains consortium do I have gene expression differences at any pH point compared to my control pH point? 2- For a given pH point, do I have gene expression differences between my strains consortium compared to the control consortium? To answer these two questions I would like to know if it is possible with DESeq2 to block one of the 2 variables, for example comparing for the consortium of strain n°1 the differents pH points to the control pH or should I split my data set to keep only the results of counts of genes corresponding to the consortium of strain n°1 and use DESeq2 with a single variable, the pH?
I tried some models like :
dds <- DESeqDataSetFromTximport(txi, colData=colDesign, design= ~strain+pH)
dds <- DESeqDataSetFromTximport(txi, colData=colDesign, design= ~strain+pH+strain:pH)
But I can't get the desired comparisons : for pHcontrol :
controlstrain_vs_strain2 controlstrain_vs_strain3 controlstrain_vs_strain4 controlstrain_vs_strain5
for pH2 :
controlstrain_vs_strain2 controlstrain_vs_strain3 controlstrain_vs_strain4 controlstrain_vs_strain5
etc... for each pH value
And : for controlstrain :
pHcontrol_vs_pH2 pHcontrol_vs_pH3 pHcontrol_vs_pH4 pHcontrol_vs_pH5 pHcontrol_vs_pH6 pHcontrol_vs_pH7 pHcontrol_vs_pH8
for strain2 :
pHcontrol_vs_pH2 pHcontrol_vs_pH3 pHcontrol_vs_pH4 pHcontrol_vs_pH5 pHcontrol_vs_pH6 pHcontrol_vs_pH7 pHcontrol_vs_pH8
etc... for each strains consortium
I would like then generate one heatmap per pH comparison and per strain comparison since in each one I compare the samples to the same control. It would generate 13 heatmaps (8 with the pH and 5 with the strains consortium).
Thks for the help! I tried doing like this :
It give me only comparisons of all the groups against strain5.pH4.6. How can I get all the possible comparisons? like strain2.pH1_vs_strain2.pH2 and strain2.pH1_vs_strain2.pH3 etc...
Please see the vignette section towards contrasts, it's in there.
Thanks for the information! Now I am able to extract the comparisons I want like this:
From now on, I want to make a heatmap representing the comparisons extracted with contrast. However, if I've understood correctly, I'll need to normalize the data with vst, for example, to be able to cluster the most similar comparisons. But in most cases it is done on the dds. But when I do it like this :
I have this error : Error in results(ddsvst, contrast = c("group", "P3_6.45", "P3_J1")) : is(object, "DESeqDataSet") is not TRUE How could I make the comparisons I want like before but on the transformed data ?