bernatgel / karyoploteR

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

Incorrect Coordinates Chr. Labels #114

Closed merondun closed 2 years ago

merondun commented 2 years ago

Hey, I've been dealing with this issue for a few years now -- my standard solution is to save one figure as .pdf, and one as .png and overlay them after editing the chromosome labels, but I'm getting tired of this :)

For some reason with plot.type=4, I have always had issues with my chromosome labels being off-set. This is regardless of the plot.params, xoffset, or if I call custom chromosome labels with kpAddChromosomeNames. Any idea what causes this mismatch? I frequently change the ordering of my chromosomes (based on either number, size, or a focal arm), but the issue doesn't seem to be due to custom ordering. I have tried this on numerous custom genomes, and nearly always see the same issue.

I've attached a custom genome file, a quick Rscript to get it running, and my sessioninfo.

image

karyoploteR_chr_labels.Rscript.txt sessionInfo.txt genome5.7.bed.txt

Thanks for any insight!

bernatgel commented 2 years ago

Oh, wow! Never seen this happening to me! Thanks for reporting it. I'll take a look and try to see what's happening with the labels

I'll get back to you once this is fixed.

Bernat

bernatgel commented 2 years ago

Hi @merondun

This has now been fixed. Thanks for reporting it. In the end, it was a bug in the code storing the chromosome names in the karyoplot object which could have had more serious consequences. Thanks for reporting it.

I've also removed the debugging comments spitting nonsense to the console when calling kpAddBaseNumbers.

All this is available in version 1.20.2, now in github (branch RELEASE_3_14) and soon (up to 48 hours) in Bioconductor servers.

Please, give it a try and if you see anything similar or anything else wrong, please post an issue here.

Again, thanks for the report (and the example code! It has made my work MUCH easier!)

merondun commented 2 years ago

Looks great!! Thanks for getting to that so quick.

image

bernatgel commented 2 years ago

No problem! just had the time today :)