ggplot2 : Volcano Plot. Weird connecting lines are appearing
1
0
Entering edit mode
2.6 years ago
VenGeno ▴ 100

Hi,

I am using ggplot2 to visualize a differentially expressed gene set generated using ballgown. When I visualize it I see these weird connecting lines (blue) and small blue and tiny red dots. Link to the image :
I don't understand why it is happening. Following is the code I used,

options(ggrepel.max.overlaps = Inf)
ggplot(data=results_genes[results_genes$diffexpressed != "No",], aes(x=de, y=-log10(pval), label=gene_label, color = diffexpressed)) +
  xlab("log2Foldchange") +
  scale_color_manual(name = "Differentially expressed", values=c("blue", "red")) +
  geom_point() +
  theme_minimal() +
  geom_text_repel() +
  geom_vline(xintercept=c(-1, 1), col="red") +
  geom_hline(yintercept=-log10(0.05), col="red") +
  guides(colour = guide_legend(override.aes = list(size=5))) +
  geom_point(data = results_genes[results_genes$diffexpressed == "No",], aes(x=de, y=-log10(pval)), colour = "black")

Thank you in advance.

ggplot2 volcano plot R • 1.3k views
ADD COMMENT
2
Entering edit mode

change the geom_text_repel to geom_text_repel(size = 4). Adjust the font size as per the graph.

ADD REPLY
4
Entering edit mode
2.6 years ago

Maybe try without the geom_text_repel() layer?

I would suppose those small blue and red dots are in reality tiny gene name labels and the connecting lines the lines that connect the actual position with the label.

ADD COMMENT
0
Entering edit mode

It wokred. Thank you Matthias Zepper !🙏

ADD REPLY
1
Entering edit mode

You are welcome! Good luck with your analysis!

ADD REPLY

Login before adding your answer.

Traffic: 1915 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