Hi
I am trying to plot copy number information using karyoploteR over the karyotype plot; a snapshot of which looks something like this
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
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.
