The code for the MA plot was adapted from: https://www.bioconductor.org/help/course-materials/2015/BioC2015/bioc2015rnaseq.html
Assuming your results are assigned to res
, your gene of interest is "Gene", and the column of the data frame mapped to the hgnc_symbols is labelled as symbol
:
plotMA(res, ylim = c(-5,5))
with(subset(res, symbol == "Gene"), {
points(baseMean, log2FoldChange, col = "dodgerblue", cex = 2, lwd = 2)
text(baseMean, log2FoldChange, "Gene", pos = 2, col = "dodgerblue")
})
For multiple genes you can do:
plotMA(res, ylim = c(-5,5))
with(subset(res, symbol %in% c("Gene1", "Gene2")), {
points(baseMean, log2FoldChange, col = "dodgerblue", cex = 2, lwd = 2)
text(baseMean, log2FoldChange, c("Gene1", "Gene2"), pos = 2, col = "dodgerblue")
})
Thank you, Phil.