How to set different color for every gene family using chromoMap?
Entering edit mode
22 months ago

Hello! I need some help please!!

My issue is, that I want to give a specific color for each gene family, for all the CYP (so CYP1...CYPx), one color for all GST (GST1...GSTx), one color for all the GT (GT1...GTx) and one color for all the ABC (ABC1...ABCx). I tried a lot but nothing worked properly. I would appreciate your help.

I have these txt files: chromosome.txt Chr1 1 781000000 Chr2 1 571000000 Chr3 1 522000000 Chr4 1 443000000 Chr5 1 369000000 Chr6 1 359000000 Chr7 1 351000000 Chr0 1 171000000

annotation.txt CYP1 Chr1 780000000 781000000 GST1 Chr2 3053 3153 CYP2 Chr2 3154 3300 GST2 Chr3 55000 55500 GT1 Chr4 12300 12399 GT2 Chr4 16000 16300 ABC1 Chr6 45000 46000 ABC2 Chr7 54555 56555 GST3 Chr5 1 200



Read tabular data into R

anno_file <- read.table("annotation.txt", header = FALSE, sep = "", dec = ".")

chr_file <- read.table("chromosome.txt", header = FALSE, sep = "", dec = ".")




passing data.frames directly instead of files


from the above command I take Rplot.png

ChromoMap(list(chr_file),list(anno_file), labels =T, chr_color = c("black"), anno_col = c ("red"), label_angle = -65, chr_length = 6, chr_width = 7, canvas_width = 800, title = "Metabolic enzymes", title_font_size = 12, top_margin = 25, left_margin = 25)

from the above command I take "metabolic enzymes" plot

Rplot Metabolic enzymes

Thank you very much!

chromoMap family color gene • 659 views
Entering edit mode
20 months ago


In order to visualize each gene family with a different color, you need to create a discrete color map using the gene families as groups (provided in data column).

While you have provided that information in the data column, you need to change it to include a gene family as a group instead of using individual genes in the family( the change in your file is highlighted in bold below)

annotation.txt CYP1 Chr1 780000000 781000000 GST Chr2 3053 3153 CYP Chr2 3154 3300 GST Chr3 55000 55500 GT Chr4 12300 12399 GT Chr4 16000 16300 ABC Chr6 45000 46000 ABC Chr7 54555 56555 GST Chr5 1 200

then you can plot the discrete color map by adding the following arguments to your code.

chromoMap( ... data_based_color_map = T, data_type = "categorical" .. )

the chromoMap will automatically assign a color to a group. You can manually set the colors by using the data_colors argument as used here. Also, set the legends argument to TRUE to show the legends.

I hope that answers your question. Thanks for using chromoMap.

Regards, Lakshay


Login before adding your answer.

Traffic: 1157 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6