This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to adjust/add cytoband information in specific regions of karyoplot?

Hi

I am trying to plot copy number information using karyoploteR over the karyotype plot; a snapshot of which looks something like this

k

I just want to have the cytoband in the regions where there is either a pink or a green bar. For example, you can notice that there is no cytoband information at the regions where there is a pink rectangle at chr15 in the image. I know we can forcefully add all cytobands but this is not what I want as it become clumsy.

This is how I am plotting.

Plotting the ideogram

kp <- plotKaryotype(genome = "hg19", main="Copy Number data",plot.type=2, plot.params = pp)

Adding the cytoband information

kpAddCytobandLabels(kp)

Could you please help? Tagging bernatgel

karyoploter cnv bioconductor r

1 answer

Not tested (will check later when have more time).

kp$cytobands has cytoband ranges, we need to subset by overlap with our pink regions and update, something like:

kp$cytobands <- myRangeMergeByOverlapFun(kp$cytobands, myPinkRanges)

then call:

kpAddCytobandLabels(kp, force.all = TRUE)

Log in to answer this question.