This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Problems drawing cytobands with karyoploteR

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)

Commercial Photography

But when I used the centromeres information, only the centromeres are represented:

kp <- plotKaryotype(genome=custom.genome, cytobands = custom.cent)

Commercial Photography

I am not really sure why it is not working. I was following a package tutorial. Thank you beforehand, Alicia

rna-seq r bioconductor

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.