Adjusting distance between chromosome ideograms in karyoplote R
2
0
Entering edit mode
5.5 years ago

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.5k views
ADD COMMENT
0
Entering edit mode
5.5 years ago
AK ★ 2.2k

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.

ADD COMMENT
0
Entering edit mode
4.9 years ago

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.

ADD COMMENT

Login before adding your answer.

Traffic: 1890 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6