<p>It's likely that the fold-change of the <code>topGene</code> is greater than 5. Consequently, the circle is being drawn and the text produced, but they're outside the bounds of the plot (the bounds don't update if you add a circle and text label). Look at the <code>log2FoldChange</code> column of <code>resLFC1[topGene, ]</code> and increase the bounds to encompass that.</p>

CC BY-SA 3.0
2018-04-13T21:07:54.417Z
2018-04-13T21:07:54.417Z
Devon Ryan
<p>I am trying to make <code>MA</code>-plot for my <code>bulk-RNA-seq</code> dataset and experiencing issues with it. I just copy-pasted the code that can be found here:</p>

<p><a href="https://f1000research.com/articles/4-1070/v2" rel="noreferrer">https://f1000research.com/articles/4-1070/v2</a></p>

<p>which is:</p>

<pre><code>library("DESeq2")
plotMA(resLFC1, ylim=c(-5,5))
topGene &lt;- rownames(resLFC1)[which.min(resLFC1$padj)]
with(resLFC1[topGene, ], {
  points(baseMean, log2FoldChange, col="dodgerblue", cex=2, lwd=2)
  text(baseMean, log2FoldChange, topGene, pos=2, col="dodgerblue")
})
</code></pre>

<p>However, I am not getting the right plot with the top gene circled, but the following one:</p>

<p><a href="https://i.sstatic.net/SwZ1R.png" rel="noreferrer"><img src="https://i.sstatic.net/SwZ1R.png" alt="enter image description here"></a></p>

<p>Maybe it is a bug in the <code>plotMA</code> function, not sure. How can I reproduce the figure from the publication?</p>

CC BY-SA 3.0
2018-04-13T10:23:50.460Z
Are you sure that resLFC1 is created as stated in the article ? There seems to be a lot more points than in the article. Also, do you get any error or message?
llrs
CC BY-SA 3.0
2018-04-13T15:22:08.697Z
Are you sure the weird double quotes (“ versus ") are not the problem?
benn
CC BY-SA 3.0
2018-04-13T18:39:12.480Z
I corrected them, of course. `Rstudio` complains about it right away.
Nikita Vlasenko
CC BY-SA 3.0
2018-04-14T17:44:50.447Z
Your plot shows **all** genes as DE (red points). That’s suspicious.
Konrad Rudolph
<rna-seq><deseq2><figure-reproduction>
plotMA function issue: can not circle genes
# plotMA function issue: can not circle genes

(Asked by: username_0 on 2018-04-12)

I am trying to make MA-plot for my bulk-RNA-seq dataset and experiencing issues with it. I just copy-pasted the code that can be found here:
https://f1000research.com/articles/4-1070/v2
which is:
library("DESeq2")
plotMA(resLFC1, ylim=c(-5,5))
topGene <- rownames(resLFC1)[which.min(resLFC1$padj)]
with(resLFC1[topGene, ], {
  points(baseMean, log2FoldChange, col="dodgerblue", cex=2, lwd=2)
  text(baseMean, log2FoldChange, topGene, pos=2, col="dodgerblue")
})

However, I am not getting the right plot with the top gene circled, but the following one:

Maybe it is a bug in the plotMA function, not sure. How can I reproduce the figure from the publication?

**Tags:** rna-seq, deseq2, figure-reproduction
> **Comments:**
> **username_1**: Are you sure that resLFC1 is created as stated in the article ? There seems to be a lot more points than in the article. Also, do you get any error or message?  
> **username_2**: Are you sure the weird double quotes (“ versus ") are not the problem?  
> **username_0**: I corrected them, of course. `Rstudio` complains about it right away.  
> **username_3**: Your plot shows **all** genes as DE (red points). That’s suspicious.  

---

## 1 answers

### Answer by username_4 on 2018-04-13. Score: 4 | Accepted answer

It's likely that the fold-change of the `topGene` is greater than 5. Consequently, the circle is being drawn and the text produced, but they're outside the bounds of the plot (the bounds don't update if you add a circle and text label). Look at the `log2FoldChange` column of `resLFC1[topGene, ]` and increase the bounds to encompass that.


---

