美文网首页
【可视化】circos之一爱的魔力转圈圈

【可视化】circos之一爱的魔力转圈圈

作者: XuningFan | 来源:发表于2020-08-23 22:45 被阅读0次
    image.png
    有没有那么一个圈,就这么吸引住了你的眼球.....
    有没有那么一个圆,就这么抓住了你的心.....
    

    从最初第一眼看到circos就被其美貌捕获,最近正好用的频率有点高,不禁想稍稍整理一下。

    circos图最核心的也是最巧妙以及最复杂的就是其它的配置文件了circos.conf。
    一般的circos.conf 首先需要引入ideogram.conf (核型设置) ticks.conf (ticks的设置)等等,其次绘制染色体核型,主要是在图片上显示染色体,其次是plot部分以及link部分。


    image.png

    格式如下:

    <<include colors_fonts_patterns.conf>>
    <<include ideogram.conf>>
    <<include ticks.conf>>
    <image>
    <<include etc/image.conf>>
    </image>
    
    
    karyotype   = karyotype.human.hg19.txt
    chromosomes_units = 1000000
    chromosomes       = hs1;hs2;hs3;hs4;hs5;hs6;hs7;hs8;hs9;hs10;hs11;hs12;hs13;hs14;hs15;hs16;hs17;hs18;hs19;hs20;hs21;hs22;hsX;hsY
    chromosomes_display_default = no
    
    
    <plots>
    <plot>
    #.......
    </plot>
    </plots>
    
    
    <links>
    <link>
    #........
    </link>
    </links>
    <<include etc/housekeeping.conf>>
    
    

    那么我们首先来看核型如下:
    核型文件以TAB键分割,前两列可以不变,第三列为染色体实际编号,第四列为图片中显示的编号,第五列代表开始位置,第六列代表终止位置,最后一列实际控制染色体的颜色。

    chr - hs1 1 0 249250621 chr1
    chr - hs2 2 0 243199373 chr2
    chr - hs3 3 0 198022430 chr3
    chr - hs4 4 0 191154276 chr4
    chr - hs5 5 0 180915260 chr5
    chr - hs6 6 0 171115067 chr6
    chr - hs7 7 0 159138663 chr7
    chr - hs8 8 0 146364022 chr8
    chr - hs9 9 0 141213431 chr9
    chr - hs10 10 0 135534747 chr10
    chr - hs11 11 0 135006516 chr11
    chr - hs12 12 0 133851895 chr12
    chr - hs13 13 0 115169878 chr13
    chr - hs14 14 0 107349540 chr14
    chr - hs15 15 0 102531392 chr15
    chr - hs16 16 0 90354753 chr16
    chr - hs17 17 0 81195210 chr17
    chr - hs18 18 0 78077248 chr18
    chr - hs19 19 0 59128983 chr19
    chr - hs20 20 0 63025520 chr20
    chr - hs21 21 0 48129895 chr21
    chr - hs22 22 0 51304566 chr22
    chr - hsX x 0 155270560 chrx
    chr - hsY y 0 59373566 chry
    band hs1 p36.33 p36.33 0 2300000 gneg
    band hs1 p36.32 p36.32 2300000 5400000 gpos25
    
    

    plot 部分可以画散点图,直方图等等。而这里我们只用来标记基因列表。也就是用到它的text部分.

    text文件格式如下:
    文件依然以TAB分割,前三列为染色体起始终止位置,最后一列为基因名称也就是标签信息

    hs10    51606988        51607988        TIMM23
    hs10    51732772        51733772        PARGP1
    hs17    20904276        20905276        USP22
    hs14    50053331        50054331        RN7SL1
    hs1     32053130        32054130        TINAGL1
    hs14    50329493        50330493        RN7SL2
    hs20    32078107        32079107        CBFA2T2
    hs10    105152223       105153223       USMG5
    hs4     6698890 6699890 S100P
    hs6     62284046        62285046        MTRNR2L9
    hs17    7571954 7572954 TP53
    hs14    50053372        50054372        RN7SL1
    hs7     20193816        20194816        MACC1
    hs16    11642638        11643638        LITAF
    hs14    50053372        50054372        RN7SL1
    

    之后我们来看一下 text的配置:

    <plots>
    <plot>
    type  = text
    file =label_example.txt
    color = black
    r1    = 1.6r
    r0    = 1.1r
    label_size = 40
    label_font = light
    padding    = 5p
    rpadding   = 5p
    
    label_snuggle = yes
    max_snuggle_distance = 2r
    snuggle_sampling = 2
    snuggle_tolerance = 0.25r
    snuggle_link_overlap_tolerance = 2p
    
    show_links     = yes
    link_dims      = 5p,4p,8p,4p,0p
    link_thickness = 2
    link_color     = dgrey
    label_parallel   = no
    </plot>
    </plots>
    

    处理完了text,我们再把链接加上,也就是link部分:
    link 文件如下:
    link也是以TAB分割,分别代表弧线左端的位置和右端的位置。

    hs17    20904276        20904276        hs14    50053331        50053331
    hs1     32053130        32053130        hs14    50329493        50329493
    hs20    32078107        32078107        hs10    105152223       105152223
    hs4     6698890 6698890 hs6     62284046        62284046
    hs17    7571954 7571954 hs14    50053372        50053372
    hs16    11642638        11642638        hs14    50053372        50053372
    hs4     77080773        77080773        hs14    50053332        50053332
    hs11    18264199        18264199        hs14    50053372        50053372
    hs14    50053354        50053354        hsX     70520319        70520319
    
    

    看一下link配置:

    <links>
    <link>
    file =  links.txt
    radius        = 0.98r
    bezier_radius = 0r
    color         = 204,171,187
    thickness     = 8
    <rules>
    <rule>
    condition     = 1
    color = "black"
    #color         = eval(var(chr2))
    flow          = continue
    </rule>
    </rules>
    </link>
    </links>
    

    最终效果如下:


    image.png

    整体配置如下:

    <<include colors_fonts_patterns.conf>>
    <<include ideogram.conf>>
    <<include ticks.conf>>
    <image>
    <<include etc/image.conf>>
    </image>
    karyotype   = karyotype.human.hg19.txt
    
    chromosomes_units = 1000000
    chromosomes       = hs1;hs2;hs3;hs4;hs5;hs6;hs7;hs8;hs9;hs10;hs11;hs12;hs13;hs14;hs15;hs16;hs17;hs18;hs19;hs20;hs21;hs22;hsX;hsY
    chromosomes_display_default = no
    <plots>
    <plot>
    type  = text
    file =text_example.txt
    color = black
    r1    = 1.6r
    r0    = 1.1r
    label_size = 40
    label_font = light
    padding    = 5p
    rpadding   = 5p
    
    label_snuggle = yes
    max_snuggle_distance = 2r
    snuggle_sampling = 2
    snuggle_tolerance = 0.25r
    snuggle_link_overlap_tolerance = 2p
    
    show_links     = yes
    link_dims      = 5p,4p,8p,4p,0p
    link_thickness = 2
    link_color     = dgrey
    label_parallel   = no
    </plot>
    </plots>
    <links>
    <link>
    file =  links.txt
    radius        = 0.98r
    bezier_radius = 0r
    color         = 204,171,187
    thickness     = 8
    <rules>
    <rule>
    condition     = 1
    color = "black"
    #color         = eval(var(chr2))
    flow          = continue
    </rule>
    </rules>
    </link>
    </links>
    <<include etc/housekeeping.conf>>
    

    相关文章

      网友评论

          本文标题:【可视化】circos之一爱的魔力转圈圈

          本文链接:https://www.haomeiwen.com/subject/snbwjktx.html