Ploting gene density on my custom chromosomes
Hi,
Thank you for your excellent work. I am new in R. I met with difficulties when I used karyoploteR to plot gene density on chromosomes. Coud you provide some examples about ploting gene densitywith gene bed file and chromosome size file ?
Thank you for your help.
Hi @cell-c
You should be able to find the code you need at the tutorial page (https://bernatgel.github.io/karyoploter_tutorial/). The idea is that you should combine the code to use a custom genome (https://bernatgel.github.io/karyoploter_tutorial//Tutorial/CustomGenomes/CustomGenomes.html) with the code to plot the density from a GRanges object at the Gene Density example (https://bernatgel.github.io/karyoploter_tutorial//Examples/GeneDensity/GeneDensity.html). The only missing piece for you would be how to use a bed file instead of a GRanges object and for that you can either use toGRanges as in
my.genes <- toGRanges("my.bed.file")
or simply use the path to your bed file in the kpPlotDensity call
kpPlotDensity(kp, "my.bed.file")
If you need more help or you encounter specific problems, just comment on this issue and I'll be happy to help.
Bernat