DESeq2 analysis
1
0
Entering edit mode
Adèle • 0
@90de674c
Last seen 15 months ago
Canada

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).

DESe DESeq2 • 1.1k views
ADD COMMENT
0
Entering edit mode
ATpoint ★ 4.6k
@atpoint-13662
Last seen 20 minutes ago
Germany

It is often easiest to combine two covariates into a single one, for example pH and strain becomes a column "ph.strain" and then you do ~ph.strain as design. Using contrasts (see vignette) you can then conveniently formulate any pairwise comparison that is required and extract results accordingly, e.g. for the heatmaps.

ADD COMMENT
0
Entering edit mode

Thks for the help! I tried doing like this :

files <- file.path("pathto_abundance_files/","Salmon_ORFs", samples$sample, "quant.sf")
names(files) <- samples$sample
txi <- tximport(files, type='salmon', txOut=TRUE, dropInfReps=TRUE)
colDesign <- data.frame(row.names=samples$sample, strain=samples$strain, pH=samples$pH, replicate=samples$replicate, group=samples$group )

dds <- DESeqDataSetFromTximport(txi, colData=colDesign, design= ~group) #with group = strain.pH
dds <- DESeq(dds)
resultsNames(dds)

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...

ADD REPLY
0
Entering edit mode

Using contrasts (see vignette)

Please see the vignette section towards contrasts, it's in there.

ADD REPLY
0
Entering edit mode

Thanks for the information! Now I am able to extract the comparisons I want like this:

respH2_pHcontrol <- results(dds, contrast=c("group", "controlstrain_pH2", "controlstrain_pHcontrol"))
respH3_pHcontrol<- results(dds, contrast=c("group", "controlstrain_pH3", "controlstrain_pHcontrol"))
respH4_pHcontrol<- results(dds, contrast=c("group", "controlstrain_pH4", "controlstrain_pHcontrol"))
respH5_pHcontrol<- results(dds, contrast=c("group", "controlstrain_pH5", "controlstrain_pHcontrol"))
respH6_pHcontrol<- results(dds, contrast=c("group", "controlstrain_pH6", "controlstrain_pHcontrol"))
respH7_pHcontrol<- results(dds, contrast=c("group", "controlstrain_pH7", "controlstrain_pHcontrol"))
respH8_pHcontrol<- results(dds, contrast=c("group", "controlstrain_pH8", "controlstrain_pHcontrol"))
ADD REPLY
0
Entering edit mode

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 :

ddsvst <- vst(dds)
respH2_pHcontrol <- results(ddsvst , contrast=c("group", "controlstrain_pH2", "controlstrain_pHcontrol"))

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 ?

ADD REPLY

Login before adding your answer.

Traffic: 838 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6