Question: How to pull pairwise comparison results after running DESeq() with more than two condition
0
gravatar for imrankhanbioinfo
4 months ago by
Canada/London/Western University
imrankhanbioinfo10 wrote:

Hi there,

I am running into this issue of pulling pairwise comparison from more than two conditions. In my metadata file, I have 4 conditions (control, treatment A, treatment B, treatment C). I run DESeq() using these all in the experiment design. Now, I like to pull only pairwise comparison between control vs treatment A, control vs treatment B, control vs treatment C. I used the R script to obtain results from dds object:

results(dds, contrast = c("Condition", "control", "treatment A"))
results(dds, contrast = c("Condition", "control", "treatment B"))
results(dds, contrast = c("Condition", "control", "treatment C"))

Unfortunately, this showing me the same log2 fold change results in all conditions. I am not sure what I am missing to pull the specific results.

Any thoughts apart from splitting the condition into separate files and later run DESeq?

Best:
Imran

rna-seq R • 201 views
ADD COMMENTlink modified 4 months ago • written 4 months ago by imrankhanbioinfo10
1

Please read about Contrastsin DESeq2: http://bioconductor.org/packages/devel/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#contrasts

It would also help to see your full code, especially the design matrix.

ADD REPLYlink modified 4 months ago • written 4 months ago by ATpoint40k

This is what I did.

dds<-DESeqDataSetFromMatrix(countData=countData, colData=metaData, design=~Condition, tidy=TRUE)

dds_res2<-DESeq(dds)

results(dds_res2, contrast = c("Condition", "control", "treatment A")) results(dds_res2, contrast = c("Condition", "control", "treatment B")) results(dds_res2, contrast = c("Condition", "control", "treatment C"))

results(dds_res2, contrast = c("Condition", "control", "treatment A")) log2 fold change (MLE): Condition control vs treatment A Wald test p-value: Condition control vs treatment A DataFrame with 20502 rows and 6 columns

        baseMean log2FoldChange     lfcSE       stat      pvalue        padj
       <numeric>      <numeric> <numeric>  <numeric>   <numeric>   <numeric>

A1BG 157.39191 0.8297996 0.147513 5.625258 1.85231e-08 6.18794e-08 A1CF 1.67040 0.0294139 0.199701 0.147289 8.82904e-01 9.11316e-01 A2BP1 52.16153 4.1836383 0.351342 11.907600 1.08042e-32 2.60123e-31 A2LD1 102.03092 0.1000050 0.062534 1.599209 1.09774e-01 1.49459e-01 A2ML1 2.79658 -0.1559784 0.203047 -0.768188 4.42375e-01 5.18189e-01 ... ... ... ... ... ... ... ZYX 3293.91652 0.42727856 0.0971345 4.3988351 1.08833e-05 2.66548e-05 ZZEF1 1282.99635 -0.40347250 0.0518192 -7.7861584 6.90773e-15 4.23169e-14 ZZZ3 878.40774 -0.27809665 0.0529993 -5.2471732 1.54451e-07 4.70318e-07 psiTPTE22 309.35599 -0.35879000 0.1498057 -2.3950358 1.66187e-02 2.63847e-02 tAKR 1.66077 0.00708931 0.1998572 0.0354718 9.71703e-01 9.80386e-01

results(dds_res2, contrast = c("Condition", "control", "treatment B")) log2 fold change (MLE): Condition control vs treatment B Wald test p-value: Condition control vs treatment B DataFrame with 20502 rows and 6 columns

        baseMean log2FoldChange     lfcSE        stat    pvalue      padj
       <numeric>      <numeric> <numeric>   <numeric> <numeric> <numeric>

A1BG 157.39191 -0.2854052 0.371324 -0.76861404 0.4421225 0.807200 A1CF 1.67040 0.0663138 0.513970 0.12902278 0.8973396 0.989695 A2BP1 52.16153 -1.6888653 0.844896 -1.99890440 0.0456187 0.368484 A2LD1 102.03092 0.0015500 0.157749 0.00982574 0.9921603 0.998789 A2ML1 2.79658 -0.1205759 0.516024 -0.23366311 0.8152465 0.982951 ... ... ... ... ... ... ... ZYX 3293.91652 -0.129132 0.245672 -0.525626 0.599148 0.897379 ZZEF1 1282.99635 0.119083 0.131342 0.906670 0.364581 0.754840 ZZZ3 878.40774 0.189783 0.134421 1.411857 0.157992 0.552120 psiTPTE22 309.35599 -0.106312 0.379135 -0.280405 0.779167 0.975233 tAKR 1.66077 -0.415441 0.439627 -0.944985 0.344666 0.740627

ADD REPLYlink modified 4 months ago • written 4 months ago by imrankhanbioinfo10
1
gravatar for swbarnes2
4 months ago by
swbarnes28.9k
United States
swbarnes28.9k wrote:

What you wrote should work. Are you sure that you didn't just overwrite the results with the last contrast?

ADD COMMENTlink written 4 months ago by swbarnes28.9k
0
gravatar for imrankhanbioinfo
4 months ago by
Canada/London/Western University
imrankhanbioinfo10 wrote:

I see its working. I did not check the padj. values which is different in all comparisons. Thank you very much!

ADD COMMENTlink written 4 months ago by imrankhanbioinfo10
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1131 users visited in the last hour