Solve overlapping gene labels in volcano plot when using textxy
0
0
Entering edit mode
Nithisha ▴ 10
@nithisha-14272
Last seen 6.2 years ago

Hi everyone, 

This is the code I used to create a volcano plot: I am trying to plot several genes and highlight the top 20 most downregulated and top 20 most downregulated genes using green and red.

#Plot a volcano plot
  library(calibrate)
  head(afinal)
  threshold.high <- afinal$logFC[20]
  threshold.low <- sort(afinal$logFC, decreasing = FALSE)[20]
  file_nname <- sub('.csv','',file_name)
  plot_title = paste(file_nname, sep='-')
  with(afinal, plot(logFC, -log10(P.Value), pch=20, main = plot_title, xlim=c(-7,7)))
  with(subset(afinal, logFC>threshold.high), points(logFC, -log10(P.Value),pch=20, col='red'))
  with(subset(afinal, logFC<threshold.low),points(logFC, -log10(P.Value),pch=20, col="green"))
  with(subset(afinal,logFC>threshold.high | logFC<threshold.low), textxy(logFC, -log10(P.Value), labs=SYMBOL, cex= .8, offset = 0.8))

 However, I get overlapping gene labels. Is there anyway to avoid this? I know there is ggrepel but is there something similar for textxy?

R • 1.2k views
ADD COMMENT
0
Entering edit mode

Hi,

I have same question, did you find any solution for this? Thanks

ADD REPLY

Login before adding your answer.

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