This is a test version of Biostars. For the public version, visit https://www.biostars.org.
DESeq2 contrast need reference or not

Hi,

I am little bit confused, I will be very thankful if you help me to understand this:

When we used contrast to extract the the result for pair wise comparison, do we need to set reference or not:

Like here: I do have three treatment condition and I am interested in all pairwise comparison: T1_vs_T2, T2_vs_T3, T1_vs_T3;

deseq2 code is like this:

> diagdds = phyloseq_to_deseq2(root_M, ~ Treatment)

converting counts to
> integer mode
> > diagdds = DESeq(diagdds, test="Wald", fitType="parametric") 
  estimating size factors 
  estimating dispersions     
  gene-wise dispersion
> estimates mean-dispersion relationship final dispersion estimates
> fitting model and testing
> -- replacing outliers and refitting for 2848 genes
 > -- DESeq argument 'minReplicatesForReplace' = 7 
 > -- original counts are preserved in counts(dds) estimating dispersions fitting model and testing
  resultsNames(diagdds) [1] "Intercept"          "Treatment_T2_vs_T1" "Treatment_T3_vs_T1"
  
  > res-M-ROOT-T1.T3= results(diagdds, contrast = c("Treatment", "T1", "T3"), alpha = 0.1)

I am not sure whether I am wrong or right could you help me if below interpretation is right:

so from this code could I able extract the gene which are up and down regulated in T1 in COMARISON to T3 and T3 is acting as reference here:

 res-M-ROOT-T1.T3= results(diagdds, contrast = c("Treatment", "T1", "T3"), alpha = 0.1)
rna-seq deseq2

Looks good to me, should give T1 vs T3

1 answer

If you use contrast to explicitly say what to compare, it doesn't matter what the reference level is.

Log in to answer this question.