This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Ma plot labelling

Hi there, I'm trying to generate a graph with the results from my first RNA seq experiment. I just used R for the first time few days ago and I'm still a bit lost with it.

I managed to make a nice plot with the script below but I'd like to label specific dot on the graph (eg: BCL2, BCL3, SYK...). So far I didn't find any solution for that. Can anyone help me with that?

Best Olivier

#to make MA plot 

res <- read.table("result.txt", header=TRUE)
head(res)

with(res, plot(log2FoldChange, baseMean, pch = 20,  main="MAplot", cex = 0.8, log = "y", xlim=c(-8.5,8.5)))
with(subset(res, padj < 0.0001), points(log2FoldChange,baseMean,  col = "grey",pch = 20))
with(subset(res, abs(log2FoldChange)>2), points(log2FoldChange, baseMean, pch=20, col="orange"))
with(subset(res, padj<0.0001 & abs(log2FoldChange)>4), points(log2FoldChange, baseMean,  pch=20, col="red"))
rna-seq r

Hi op263, You can use the 101010 option to format code blocks, making it easier to read here. Cheers, Wouter

2 answers

Easy to understand and visualize MA plot for RNA-seq data: https://reneshbedre.github.io/blog/ma.html

You can simply using text the same way as you use points, or take a look at ggrepel, which is a lillte bit fancier.

Log in to answer this question.