YinLiLin / CMplot

📊 Circular and Rectangular Manhattan Plot
502 stars 111 forks source link

x11 issues with jpeg #57

Closed rbutleriii closed 2 years ago

rbutleriii commented 2 years ago

Hi,

Working on a cluster, and the CMPlot call gives the following warning:

Warning messages:
1: In polygon(c(log.Quantiles[index], log.Quantiles), c(-log10(c05)[index],  :
  semi-transparency is not supported on this device: reported only once per page
2: In polygon(c(log.Quantiles[index], log.Quantiles), c(-log10(c05)[index],  :
  X11 protocol error: BadLength (poly request too large or internal Xlib length error)

Is there a way to pass this as a grob to ggsave so I can use type=cairo ?

rbutleriii commented 2 years ago

I did find a workaround that makes it work when x11 is unavailable:

# plot qqs and manhattans
options(bitmapType='cairo')
CMplot(fh, file.output=TRUE, file="jpg", plot.type=c("m","q"), conf.int=T, 
       threshold=c(1e-5, 5e-8), threshold.col=c("grey", "black"), 
       threshold.lty=c(2,1), dpi=300, main=paste(outname,"Lambda:", lambda.fh), 
       highlight=SNPs, highlight.text=SNPs, highlight.col=NULL, memo=outname)
YinLiLin commented 2 years ago

Thanks for the question and the solution for this issue.