jokergoo / circlize

Circular visualization in R
http://jokergoo.github.io/circlize_book/book/
Other
959 stars 141 forks source link

rainfallTransform() for circos.genomicRainfall() does not work for single locus per chromosome #390

Open evan-john opened 3 months ago

evan-john commented 3 months ago

Hi, I am trying to plot a genomicRainfall track. Some data have only 1 locus per chromosome (I have some important data points to present that are low frequency occurrence). After some investigating, it seems the rainfallTransform() function to obtain the plotting dist returns 'NA' for those single-locus-per-chromosome. See the example below for Chr1.

head(rainfallTransform(x)) chr start end dist 1 Chr1 2474424 2476277 NA 2 Chr2 52994 55607 86197.0 3 Chr2 141804 143777 86197.0 4 Chr3 76845 79978 4656.0 5 Chr3 84634 86360 2871.5 6 Chr3 87447 88624 810.0

The issue is, when I plot, I can not observe in Chr1, but Ch2/Chr3 data points are fine. I couldn't figure out a workaround. Is there a fix you can suggest?