Closed zx8754 closed 2 years ago
OK, found it, of course it is implemented, srt = 90
would rotate it:
kp <- plotKaryotype(genome = "hg19", plot.type = 4, srt = 90)
kpDataBackground(kp)
Any chance we can have staggered option?
Hi @zx8754
Glad you found a solution. I usually use 45 degrees instead of 90, but it's a question of preferences. Also, take into account that that srt will also rotate the main title if there is one!
I had not thought about the staggered option, which makes a lot of sense. I'm pretty sure you can achieve this with a bit of hacking right now:
You should:
Something along the lines of
library(karyoploteR)
kp <- plotKaryotype(genome = "hg19", plot.type=4, labels.plotter=NULL)
evens <- ((1:length(chr.names))%%2)==0
chr.names <- kp$chromosomes
even.names <- chr.names
even.names[!evens] <- ""
odd.names <- chr.names
odd.names[evens] <- ""
kpAddChromosomeNames(kp, chr.names = odd.names)
kpAddChromosomeNames(kp, chr.names = even.names, yoffset = -10)
You can also modify the names vector to remove "chr", etc... If you have any problem with this, please ask
In any case, I'll log the request for the staggered option for future developments :)
Thanks!
I looked through the karyoploteR tutorials couldn't find solution, apologies if this was already implemented.
When we plot as below, the chromosome labels overlap for chr17 to chr22
Any chance we could have labels vertical, as in
las = 3
in base R:Alternatively, have it staggered?