<p>The <code>makeContrasts</code> function is from edgeR so it does not help here. If you want to compare one group vs the average of several others here is a suggestion of how this could be done. It uses a design without intercept so all groups are easily accessable as coefficients in <code>resultsNames(dds)</code>:</p>
<pre class="lang-r prettyprint-override"><code>suppressMessages(library(DESeq2))

#/ Example with four groups
set.seed(1)
dds &lt;- makeExampleDESeqDataSet(m=12)
dds$condition &lt;- factor(as.character(rep(LETTERS[1:4], each=3)))

#/ Use a design without intercept so all four groups are accessable as coefficients
design(dds) &lt;- ~0+condition
dds &lt;- DESeq(dds)
#&gt; estimating size factors
#&gt; estimating dispersions
#&gt; gene-wise dispersion estimates
#&gt; mean-dispersion relationship
#&gt; final dispersion estimates
#&gt; fitting model and testing

#/ results using listValues to get A vs the average ov B,C,D
res &lt;- results(dds, contrast=list(c(&quot;conditionA&quot;), c(&quot;conditionB&quot;, &quot;conditionC&quot;, &quot;conditionD&quot;)), listValues=c(1, -1/4))

Created on 2022-06-21 by the reprex package (v2.0.1)

</code></pre>
<p>Determining whether or not it is appropriate to do this in a particular situation is up to you. You have to know what question you want to answer for your work. I cannot help with that.</p>

CC BY-SA 4.0
2022-06-21T08:14:00.880Z
2022-06-21T09:39:12.213Z
2022-06-21T09:39:12.213Z
Prontus Hieronymus
<p>This <a href="https://f1000research.com/articles/9-1444" rel="nofollow noreferrer">article</a> talked about various deseq2 designs etc. One of the designs I would like to use is explained as this:</p>
<p>Control versus treatment average</p>
<pre><code>makeContrasts((treatmentI+treatmentII+treatmentIII)/3-treatmentCTL,
  levels=colnames(design))
</code></pre>
<p>I'm not sure how to incorporate this in deseq2 run which step?</p>
<p>Is it after running this</p>
<pre><code>dds &lt;- DESeq(dds)
</code></pre>
<p>Can I call the <code>makeContrasts</code> function?</p>

<deseq2>
deseq2 makeContrasts function
# deseq2 makeContrasts function

(Asked by: username_0 on 2022-06-20)

This article talked about various deseq2 designs etc. One of the designs I would like to use is explained as this:
Control versus treatment average
makeContrasts((treatmentI+treatmentII+treatmentIII)/3-treatmentCTL,
  levels=colnames(design))

I'm not sure how to incorporate this in deseq2 run which step?
Is it after running this
dds <- DESeq(dds)

Can I call the makeContrasts function?

**Tags:** deseq2

---

## 1 answers

### Answer by username_1 on 2022-06-21. Score: 3 | Accepted answer

The makeContrasts function is from edgeR so it does not help here. If you want to compare one group vs the average of several others here is a suggestion of how this could be done. It uses a design without intercept so all groups are easily accessable as coefficients in resultsNames(dds):
suppressMessages(library(DESeq2))

#/ Example with four groups
set.seed(1)
dds <- makeExampleDESeqDataSet(m=12)
dds$condition <- factor(as.character(rep(LETTERS[1:4], each=3)))

#/ Use a design without intercept so all four groups are accessable as coefficients
design(dds) <- ~0+condition
dds <- DESeq(dds)
#> estimating size factors
#> estimating dispersions
#> gene-wise dispersion estimates
#> mean-dispersion relationship
#> final dispersion estimates
#> fitting model and testing

#/ results using listValues to get A vs the average ov B,C,D
res <- results(dds, contrast=list(c("conditionA"), c("conditionB", "conditionC", "conditionD")), listValues=c(1, -1/4))

Created on 2022-06-21 by the reprex package (v2.0.1)


Determining whether or not it is appropriate to do this in a particular situation is up to you. You have to know what question you want to answer for your work. I cannot help with that.


---

