This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Adjusting distance between chromosome ideograms in karyoplote R

I am trying to use KaryoploteR to draw ideograms, mark regions and also annotate them using kpPlotMarkers. While I am able to get nice looking ideograms, I am having some trouble with the labeling using kpPlotMarkers. The annotations overlap with adjacent chromosomes.

I was wondering if there is a way to increase the distance between the chromosomes or if I should just make independent images for each chromosome and put it together later. I tried playing around with some of the plot parameters such as data1 and data2 height and margins but they did not help. Would appreciate any suggestions!

ideogram karyoploter

2 answers

You can try to change the plotting parameters (adjusting data1height to your need):

library(karyoploteR)

plot.params <- getDefaultPlotParams(plot.type = 2)
plot.params$data1height <- 1000

kp <-
  plotKaryotype(
    genome = "hg19",
    plot.type = 2,
    chromosomes = c("chr1", "chr2", "chr3"),
    plot.params = plot.params
  )

Have a look at 3.4 Changing the plotting parameters.

The ideogram is created by plotKaryotype which itself calls kpAddCytobands which calls graphics::rect. The linewidth argument lwd to this function was helpful for me to increase the spacing between chromosomes. It can modified at the level of plotKaryotype via ellipses.

Log in to answer this question.