Use the latest version of Circos and read Circos best practices—these list recent important changes and identify sources of common problems.
If you are having trouble, post your issue to the Circos Google Group and include all files and detailed error logs. Please do not email me directly unless it is urgent—you are much more likely to receive a timely reply from the group.
Don't know what question to ask? Read Points of View: Visualizing Biological Data by Bang Wong, myself and invited authors from the Points of View series.
Below is a block template for a general configuration file. Not all blocks are required. For some, duplicate blocks will be merged (e.g. <colors>
), while others will be stored as a list (e.g. <tick>
).
<colors> </colors> <fonts> </fonts> <patterns> </patterns> <zooms> <zoom> </zoom> <zoom> </zoom> ... </zooms> <ideogram> <spacing> <pairwise> </pairwise> <pairwise> </pairwise> ... </spacing> <break_style> </break_style> <break_style> </break_style> ... <rules> <rule> </rule> <rule> </rule> ... </rules> </ideogram> <ticks> <tick> </tick> <tick> </tick> ... </ticks> <highlights> <highlight> <rules> <rule> </rule> <rule> </rule> ... </rules> </highlight> <highlight> </highlight> ... </highlights> <plots> <plot> <rules> <rule> </rule> <rule> </rule> ... </rules> <axes> <axis> </axis> <axis> </axis> ... </axes> <backgrounds> <background> </background> <background> </background> ... </backgrounds> </plot> <plot> </plot> ... </plots> <links> <link> <rules> <rule> </rule> <rule> </rule> ... </rules> </link> <link> </link> ... </links>
A configuration file can be included in another with the <<include FILE
>> directive.
################################################################ # circos.conf <<include ideogram.conf>> <<include ticks.conf>> ################################################################ # ideogram.conf <ideogram> ... </ideogram> ################################################################ # ticks.conf <ticks> ... </ticks>
When including the file, a relative file name will be interpreted relative to the location of the file in which it is being included. If it is not found there, the Circos distribution directory will be searched. For example,
<<include etc/housekeeping.conf>>
will include etc/housekeeping.conf
from the Circos distribution.
Parameters are defined as variable/value pairs.
param = value
In some cases the parameter accepts a list (usually comma-delimited, but not always).
param = value,value,...
In a very few cases the parameter accepts multiple instances.
radius = 0.9r radius = 0.8r
If you attempt multiple definitions for a parameter that does not allow this, you'll see an error.
Circos understands three units: p
(pixel), r
(relative) and u
(chromosome units). Depending on a parameter, one or more of these units can be used. In some cases, in an arithmetic expression (e.g. 0.5r+10p
).
Parameters with the relative unit, r
, are evaluated relative to the value of another parameter. For example, expressing the ideogram position in relative units determines the position relative to the size of the image.
Parameters that specify axis position or spacing typically use the u
unit. When this unit is used, the value is expressed as a multiple of chromosomes_units
. This helps shorten values of parameters (e.g. 10u
vs 10000000
) such as spacing
in <tick>
blocks.
Anywhere in the configuration file you can refer to the value of another parameter using the conf()
function.
To access configuration parameters from the root of the configuration file,
show_histogram = yes ... <plots> <plot> show = conf(show_histogram) type = histogram ...
To access configuration parameters from anywhere in the configuration file, include the list of blocks before the parameter name.
<plots> show_histogram = yes <plot> show = conf(plots,show_histogram) type = histogram ...
To refer to a parameter in the current block and perform a search up the block hierarchy, specify ".
" for the path.
<plots> <plot> type = histogram r0 = 0.5r r1 = conf(.,r0)+50p ...
The search is useful in rules
<plots> <plot> x = 10 ... <rules> <rule> # x is not defined in thisblock, but it will # be found from the outerblock condition = conf(.,x) == 10 ...
In rules, to access a data point's property, such as position or value, use var()
.
<rule>
color = var(id)
If you are using the value as a part of an expression, make sure you pass it through eval()
(see below).
You can express a parameter using Perl code. Use eval()
to make sure that it is evaluated. This is common in rules.
<rule> condition = on(hs1) value = eval(log(var(value))/log(2)) </rule>
The condition
parameter in <rule>
blocks is automatically evaluated.
Generally most parameters do not accept multiple instances. The following is not allowed and will produce an error
<ideogram> position = 0.9r position = 0.8r ... </ideogram>
However, if you add the *
suffix to one of the parameter names, it will be used to override the previously defined value of the parameter.
<ideogram> position = 0.9r position* = 0.8r # this value will be used ... </ideogram>
You can use as many *
in the suffix as you want — the parameter with the largest number of *
will be the one used. This facility is useful in overriding parameters from included files (see below).
Blocks logically group parameters and help name collisions.
Certain blocks can have multiple instances, as indicated by the flags in the table below.
Some blocks define lists of objects, such as <plot>
or <tick>
. In these cases multiple entries will be stored as a list. In others, such as <color>
, multiple instances will be merged into a single block.
# two <color> blocks are ... <color> color1 = 255,100,100 </color> <color> color2 = 255,255,100 </color> # ... merged into one <color> color1 = 255,100,100 color2 = 255,255,100 </color>
You can take advantage of merging by adding or overriding parameters in blocks which were included from another file.
# default <colors> block with pre-defined colors <<include etc/colors_fonts_patterns.conf>> # to add more colors, define them in a second <colors> block, # which will be merged <colors> mycolor = 255,100,100 </colors>
When overriding parameters, use the *
suffix.
# suppose you are including your <ideogram> block from a file <<include ideogram.conf>> # to change the position parameter with in this block, you can # override it without having to edit ideogram.conf <ideogram> position* = 0.95r </ideogram>
Block flags: R required, M multiple blocks will be merged, + multiple blocks allowed.
etc/colors_fonts_patterns.conf
.
etc/colors_fonts_patterns.conf
.
etc/colors_fonts_patterns.conf
.
<spacing>
<ideogram>
<pairwise>
<spacing>
etc/image.conf
and override as necessary.
<ticks>
<zoom>
<zooms>
<highlight>
etc/image.conf
and override as necessary.
<plot>
<link>
<highlights>
etc/image.conf
and override as necessary.
<plots>
<rules>
, <axes>
, <backgrounds>
<links>
<rules>
<plot>
, <link>
, <highlight>
, <ideogram>
<rule>
<rules>
<plot>
<axis>
<axes>
<plot>
<background>
<backgrounds>