#|==========================================================|#
#| circos configuration template -- autogenerated by fsnviz |#
#|==========================================================|#

# general imports
<<include etc/housekeeping.conf>>

<colors>
  <<include etc/colors.conf>>
</colors>

<fonts>
  <<include etc/fonts.conf>>
</fonts>

# global settings
chromosomes_display_default = yes
chromosomes_units           = 1000000
karyotype                   = {{ karyotype }}

# output image
<image>
  <<include etc/image.conf>>
  angle_offset*      = -90
  auto_alpha_colors* = yes
  auto_alpha_steps*  = 5
  background*        = white
  dir*               = {{ image_dir|default(".") }}
  file*              = {{ image_file }}
  png*               = {{ image_png|default("no") }}
  radius*            = 2000p
  svg*               = {{ image_svg|default("yes") }}
</image>

# ideogram
<ideogram>
  thickness        = 100p
  stroke_thickness = 2
  stroke_color     = black
  fill             = yes
  fill_color       = black

  # fractional radius position of chromosome ideogram within image
  label_case     = upper
  label_font     = condensedbold
  label_parallel = yes
  label_radius   = dims(ideogram,radius) - 0.13r
  label_size     = 40p
  label_with_tag = yes
  radius         = 0.70r
  show_label     = yes

  # cytogenetic bands
  band_stroke_thickness = 2
  band_transparency     = 0
  fill_bands            = yes
  show_bands            = yes

  <spacing>
    axis_break         = yes
    axis_break_at_edge = yes
    axis_break_style   = 2
    break              = 5u
    default            = 40u

    <break_style 1>
      fill_color       = blue
      stroke_color     = black
      stroke_thickness = 2
      thickness        = 0.25r
    </break>

    <break_style 2>
      stroke_color     = black
      stroke_thickness = 3
      thickness        = 1.5r
    </break>
  </spacing>
</ideogram>

# fusion links
<links>
  bezier_radius = 0.6r
  radius        = 0.93r
  z             = 0

  <link segdup>
    file      = {{ fusion_links_file }}
    show      = yes
    color     = vvdgrey
    thickness = 8

  <rules>
    <rule>
      bezier_radius = 0.02r
      condition     = var(chr1) ne var(chr2)
      color         = orange
      importance    = 120
    </rule>

    <rule>
      condition     = var(chr1) eq var(chr2)
      color         = blue
      importance    = 110
    </rule>
  </rules>

  </link>
</links>

# gene labels
<plots>
  <plot>
    color                          = black
    file                           = {{ gene_labels_file }}
    label_font                     = condensed
    label_rotate                   = yes
    label_size                     = 40p
    label_snuggle                  = yes
    link_color                     = grey
    link_dims                      = 4p,200p,40p,20p,10p
    link_thickness                 = 4p
    max_snuggle_distance           = 4r
    padding                        = 10p
    r0                             = 1.01r
    r1                             = 1.01r+500p
    rpadding                       = 0p
    show                           = yes
    show_links                     = yes
    snuggle_link_overlap_test      = yes
    snuggle_link_overlap_tolerance = 0p
    snuggle_refine                 = no
    snuggle_sampling               = 2
    snuggle_tolerance              = 0r
    type                           = text
  </plot>

  <plot>

    type             = scatter
    file             = {{ junction_reads_file }}
    fill_color       = dred
    color            = dred
    glyph            = circle
    glyph_size       = 18

    max   = 7.0
    min   = 0.0
    r1    = 1.08r
    r0    = 1.01r

    <backgrounds>
        <background>
        color     = vlred_a4
        y1        = 0.33r
        </background>
        <background>
        color     = vlred_a4
        y1        = 0.67r
        </background>
        <background>
        color     = vlred_a4
        </background>
    </backgrounds>
  </plot>

  <plot>
    type             = scatter
    file             = {{ spanning_frags_file }}
    fill_color       = dpurple
    color            = dpurple
    glyph            = circle
    glyph_size       = 18

    max   = 3.5
    min   = 0.0
    r1    = 1.16r
    r0    = 1.09r

    <backgrounds>
        <background>
        color     = vlpurple_a4
        y1        = 0.33r
        </background>
        <background>
        color     = vlpurple_a4
        y1        = 0.67r
        </background>
        <background>
        color     = vlpurple_a4
        </background>
    </backgrounds>
  </plot>
</plots>

# ticks
show_ticks       = no
show_tick_labels = no
<ticks>
  color            = black
  label_separation = 1p
  multiplier       = 1/1u
  radius           = dims(ideogram,radius_outer)
  size             = 20p
  skip_first_label = no
  skip_last_label  = no
  thickness        = 4p
  tick_separation  = 3p

  <tick>
    color      = dgrey
    show_label = no
    spacing    = 1u
    thickness  = 2p
  </tick>

  <tick>
    color      = vdgrey
    show_label = no
    spacing    = 5u
    thickness  = 3p
  </tick>

  <tick>
    format         = %d
    grid           = yes
    grid_color     = dgrey
    grid_end       = 0.999r
    grid_start     = 0.5r
    grid_thickness = 1p
    label_offset   = 10p
    label_size     = 20p
    show_label     = yes
    spacing        = 10u
  </tick>
</ticks>

