Entering edit mode
7.4 years ago
VHahaut
★
1.2k
Hi!
I would like to dynamically modify the axis from custom genomes plotted with karyoploteR.
Example:
library(karyoploteR)
custom.genome <- toGRanges(data.frame(chr="chr1", start=1, end=10e7)
kp <- plotKaryotype(genome = custom.genome)
regions <- GRanges(seqnames=rep("chr1", 100), IRanges(start=round(runif(100,min = 100, max=10e7)), width=10000))
kpPlotDensity(kp, data=regions)
Then use:
kpAxis(kp, ymax=kp$latest.plot$computed.values$max.density, r0=0, r1=1, cex=0.8)
In order to get an ymax properly representing my data. So far it seems to work for hg19 but not for a custom genome. Does someone knows how to deal with this?
Thanks!