I am working with karyoploteR to represent DEG. I am working with the pombe genome, so I created a custom genome with karyoploteR. But when I try to add the centromeres as cytobands, only the centromeres are represented. Here below is the code I used:
custom.genome <-toGRanges(data.frame(chr=c("I", "II", "III"), start=c(1,1,1), end=c(5579133,4539804,2452883)))
custom.cent <- toGRanges(data.frame(chr=c("I", "II", "III"), start=c(3753687,1602264,1070904), end=c(3789421,1644747,1137003), name=c("cent", "cent", "cent"), gieStain = c("stalk", "stalk", "stalk")))
When I don't use the centromeres information I get the chromosomes:
kp <- plotKaryotype(genome=custom.genome)
But when I used the centromeres information, only the centromeres are represented:
kp <- plotKaryotype(genome=custom.genome, cytobands = custom.cent)
I am not really sure why it is not working. I was following a package tutorial. Thank you beforehand, Alicia
1 answer
I know it's 4 years later... but just in case someone bumps into this:
This is not a bug in karyoploteR but the expected behavior. If available, the cytobands are not plotted on top of the chromosomes but are used to plot the chromosomes themselves. Actually, if no cytobands are available, karyoploteR internally creates a fake cytobands object with a single gray cytoband per chromosome.
The correct way to add the centromeres would have been to create a cytoband for arm p, the add the centromere, and then a second cytoband for the q arm of each chromosome. Another option to achieve the same effect would have been to plot the chromosomes with no centromeres and then use kpRect of kpPlotRegion to paint the centromeres on the ideogram using data.panel="ideogram". You can find more info in the Data Panels section of the karyoploteR tutorial.
Log in to answer this question.


Very nice formatting question, with examples and figures, well done !
I guess that you found a bug in
karyoploteR, when thecustome.genomedisplay is removed when you addcustom.cytobandsI suggest you to open a new issue to bernatgel github : https://github.com/bernatgel/karyoploteR/issues