Need more color

37 views
Skip to first unread message

Jui-Hung

unread,
Aug 28, 2023, 3:15:30 PM8/28/23
to Circos
Hi there,

My species have 39 chromosomes. However, after 24 chromosome, the link color become black.

How can I get more color on the links?

Here is my links.conf:
<links>

<link>
file          = data/links_CbvsOb.txt
radius        = 0.95r
bezier_radius = 0.1r
#thickness     = 1

<rules>

<rule>

condition  = 1
color      = eval(sprintf("chr%s_a4",substr(var(chr2),2)))
z          = eval(remap_int(var(size2),0,10e6,0,-100))
thickness = 2p
flow = stop
</rule>

</rules>
</link>

</links>



Many thanks.
Jui-Hung


未命名.png

Martin

unread,
Aug 28, 2023, 3:19:46 PM8/28/23
to Circos

Colors are defined in etc/colors.conf (this file is included via <<include>> in your configuration). 

This file itself imports etc/colors.ucsc.conf, where chr1-chr24 colors are defined (see below).

The reason you're seeing black for chr25+ is because color names "chr25", "chr26" and so on have not been defined. You'll need to add these definitions using whatever RGB colors suit you. For example,

chr25 = 19,154,237

If you're looking for options for maximally distinct colors, see


# Default UCSC color scheme for chromosome colors.

chr1  = 153,102,0
chr2  = 102,102,0
chr3  = 153,153,30
chr4  = 204,0,0
chr5  = 255,0,0
chr6  = 255,0,204
chr7  = 255,204,204
chr8  = 255,153,0
chr9  = 255,204,0
chr10 = 255,255,0
chr11 = 204,255,0
chr12 = 0,255,0
chr13 = 53,128,0
chr14 = 0,0,204
chr15 = 102,153,255
chr16 = 153,204,255
chr17 = 0,255,255
chr18 = 204,255,255
chr19 = 153,0,204
chr20 = 204,51,255
chr21 = 204,153,255
chr22 = 102,102,102
chr23 = 153,153,153
chrX  = 153,153,153
chr24 = 204,204,204
chrY  = 204,204,204
chrM  = 204,204,153
chr0  = 204,204,153
chrUn = 121,204,61
chrNA = 255,255,255

Martin

unread,
Aug 28, 2023, 4:49:46 PM8/28/23
to Circos
Oh, and to add to my response, you can define the new colors in colors.ucsc.conf, or create your own file in etc/

# etc/colors.supplemental.conf
chr25 = ...
chr26 = ...

and then add an <<include>> directive in etc/colors.conf to import your file

# etc/colors.conf
# Brewer palette
<<include colors.brewer.conf>>
# Inferno, magma, mako, plasma, turbo and viridis palettes
<<include colors.viridis.conf>>
# chromosome color map (UCSC)
<<include colors.ucsc.conf>>
# HSV pure colors
<<include colors.hsv.conf>>
# Supplemental colors
<<include colors.supplemental.conf>>

To make sure that your color file was read in, you can ask Circos to dump out the colors block of its configuration -- you should see your colors among those listed.

circos -cdump colors

Jui-Hung

unread,
Aug 28, 2023, 11:42:28 PM8/28/23
to Circos
Thank you !

It's working perfectly !
Thank you for your detailed response !

Jui-Hung

Martin 在 2023年8月29日 星期二凌晨4:49:46 [UTC+8] 的信中寫道:
Reply all
Reply to author
Forward
0 new messages