<p>Hi,</p>

<p>In DESeq(1) it was possible to compare between conditions like this:</p>

<p>res = nbinomTest( cds, "1", "5" )</p>

<p>Where 1 and 5 are were the conditions I wished to compare (and in total there were 6 conditions).</p>

<p>I have just started using DESeq2 but I cannot work out how to replicate this analysis.</p>

<p>I tried "res &lt;- results(cds,"1","5")" but that doesn't work. Does using the follow specify what is being compared?</p>

<p>colDATA(cuffcdsnorepdeseq2)$condition &lt;- factor(colData(cuffcdsnorepdeseq2)$condition,levels=c("1","5"))</p>

<p>The problem is when I use this and then "res &lt;- results(cds)" I am unsure about exactly what is being compared.</p>

<p>How can I do a pariwise comparison in DESeq2?</p>

<p>Thanks,</p>

<p>Jon. </p>

You'll want to use the `contrasts=` part of the `results()` functions. So something like:

    res <- results(cds, contrasts=c("conditions","firstCondition","fifthCondition"))

This way, you can be confident in which comparisons you're making. I recall reading that the contrasts functionality is relatively new, so you may need to update if you haven't already done so recently.

Update: In fact it appears that the contrasts functionality is new in what is currently the devel branch (Bioconductor 2.13).