bernatgel / karyoploteR

karyoploteR - An R/Bioconductor package to plot arbitrary data along the genome
https://bernatgel.github.io/karyoploter_tutorial/
295 stars 42 forks source link

Adding Base Numbers with plot.type = 6 (ideograms only) #60

Open etnite opened 4 years ago

etnite commented 4 years ago

Hello @bernatgel - thank you for all of your work on this great package!

I'm not sure if I'm missing something obvious, but if I try to make an ideograms only plot (plot.type 6), adding base numbers causes the axis text to overlap each chromosome ideogram:

kp <- plotKaryotype(plot.type = 6)
kpAddBaseNumbers(kp)

ideograms

I'm wondering if there is some way to give an option so that kpAddBaseNumbers() would only add a single x-axis for basepair coordinates at the bottom of the image, which would be much cleaner in the case of only working with ideograms. I've tried using a simple call to axis(), but the problem seems a little more complicated than that.

Thank you.

bernatgel commented 4 years ago

Hi @etnite

One option would be to add some enlarge the margin between chromosomes to add some space for the base numbers using setting the plotting parameters.

pp <- getDefaultPlotParams(6)
pp$data2outmargin <- 100

kp <- plotKaryotype(plot.type = 6, plot.params = pp)
kpAddBaseNumbers(kp)

issue_60

Although I think your idea of adding an independent scale could be a better option in some situations. It's a bit more complex than calling axis, certainly, but I'm adding it to our TODO list!

Bernat

etnite commented 4 years ago

Many thanks and sorry for a slow response. I will try out your margin size suggestion for the time being.

AHinsu commented 1 year ago

Hi, I was wondering if there is any update to adding an independent scale for the plot.

Thanks, Ankit