This is a test version of Biostars. For the public version, visit https://www.biostars.org.
ggmaplot error: Unlabeled data points (too many overlaps). Consider increasing max.overlaps

Hello All. I am trying to create a differential expression with ggmaplot. I am using this because its more convenient for me to add specific gene labels. The issue is the labels are overlapping and some of them are being excluded from the plot. I am trying to add a label repel for this particular plot so all labels can be shown on the plot. See my command below.

ggmaplot(cts_NEGvsDBR, main = expression("WT vs DBR"),
         fdr = 0.05, fc = 2, size = 0.4,
         palette = c("#B31B21", "#1465AC", "darkgray"),
         genenames = as.vector(cts_NEGvsDBR$MiRTS),
         legend = "top", top = 20,
         font.label = c("bold", 11), label.rectangle = TRUE,
         font.legend = "bold",
         font.main = "bold",
         ggtheme = ggplot2::theme_minimal())

Please how can I add the repel command to the above? Thanks

maplot r ggplot2 ggmaplot

1 answer

You should use options(ggrepel.max.overlaps = Inf) to set this globally for your entire session.

options(ggrepel.max.overlaps = Inf)

ggmaplot(cts_NEGvsDBR, main = expression("WT vs DBR"), fdr = 0.05, fc = 2, size = 0.4, palette = c("#B31B21", "#1465AC", "darkgray"), genenames = as.vector(cts_NEGvsDBR$MiRTS), legend = "top", top = 20, font.label = c("bold", 11), label.rectangle = TRUE, font.legend = "bold", font.main = "bold", ggtheme = ggplot2::theme_minimal())

Log in to answer this question.