This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to set different color in every gene and add legend using Chromomap?

Dear all! I have plot my data to make gene position in chromosome using chromoMap.

Here my data

chr file

chr file

chr anot file chr anot file and these are my scripts

library(chromoMap) col.set = c("purple", "#4CBB17","#0096FF", "blue", "brown") chr.data <- read.csv("chr_file.csv", header=T) anno.data <- read.csv("chr_anot.csv", header = T) chromoMap(list(chr.data),list(anno.data), labels = T, data_based_color_map = T, data_color = list(c(col.set)))

I got the result like this output file data result

I would like to set every gene with different color and add the legend.

Any idea what should I do? Please help me. Thank you

chromomap gene color

1 answer

See here

chromoMap(list(chr.data),list(anno.data), labels = T, data_based_color_map = T, data_color = list(c("purple", "#4CBB17","#0096FF", "blue", "brown)), legend = T)

I have tried to see the link that you sent above and run your script but the output like this, output new

Thank you. Upvote and accept if you find the comment helpful.

Log in to answer this question.