color within the ideogram || ancestry
complexgenome opened this issue · 3 comments
hi there, thanks for this package.
This is really great. I'm interested to create graphics to display ancestry information, something like https://github.com/jordanlab/tagore
Is this something that can be achieved?
Thanks
Yes, of course. For example, you have three kinds of ancestry information types. Set three colors by colorset1 = c("#66c2a5", "#fc8d62", "#8da0cb")
, and confer the three ancestry information types with values of "1", "2", and "3" in the overlaid file.
For example:
require(RIdeogram)
gene_density$Value <- sample(1:3, nrow(gene_density), replace = TRUE)
LTR_density$Value <- sample(1:3, nrow(gene_density), replace = TRUE)
ideogram(karyotype = human_karyotype, overlaid = gene_density, label = LTR_density, label_type = "heatmap", colorset1 = c("#66c2a5", "#fc8d62", "#8da0cb"), colorset2 = c("#66c2a5", "#fc8d62", "#8da0cb"))
convertSVG("chromosome.svg", device = "png")
If you have four types, then set four different colors and "1", "2", "3", and "4".
en, I can create graphics to display ancestry information, but how to change the legend ? I want the legend to be one color for one ancestry type ,not in heatmap format.