Ma plot labelling
2
3
Entering edit mode
8.1 years ago
op263 ▴ 50

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 • 5.2k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode
6.0 years ago
Renesh ★ 2.2k

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

ADD COMMENT
0
Entering edit mode
8.1 years ago
GZ1995 ▴ 410

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

ADD COMMENT

Login before adding your answer.

Traffic: 2712 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6