日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

Circos手把手極簡(jiǎn)入門(Windows環(huán)境)

 微笑如酒 2018-08-04

Circos安裝及測(cè)試


首先,下載Circos安裝包官網(wǎng)


安裝包

標(biāo)黃的為最新版本的circos。


最下面也還有一個(gè)簡(jiǎn)單的tutorials,為L(zhǎng)inux版本的tutorial,包含了很多種類型的數(shù)據(jù)配置示例,共有十個(gè)示例,有興趣的不妨了解一波。

Windows下移動(dòng)到某個(gè)自定義文件夾下解壓壓縮文件即可,接下來就可以通過PowerShell進(jìn)行測(cè)試,驗(yàn)證是否可以作圖。

  1. # 進(jìn)入對(duì)應(yīng)的解壓文件夾下

  2. PS D:\Software\circos\circos-0.69-6> cd .\example\

  3. PS D:\Software\circos\circos-0.69-6\example> ls

  4.  目錄: D:\Software\circos\circos-0.69-6\example

  5. Mode LastWriteTime Length Name

  6. ---- ------------- ------ ----

  7. d----- 2018/6/20 13:32 data

  8. d----- 2018/6/20 13:32 etc

  9. -a---- 2017/6/17 7:36 3693061 circos.png

  10. -a---- 2017/6/17 7:37 258048 circos.svg

  11. -a---- 2017/6/4 9:05 1476 README

  12. -a---- 2017/6/4 9:05 202 run

  13. -a---- 2017/6/4 9:05 37130 run.out

  14. # 測(cè)試作圖

  15. PS D:\Software\circos\circos-0.69-6\example> ..\bin\circos -conf .\etc\circos.conf

  16. # 會(huì)出現(xiàn)一大串狀態(tài)信息,這里顯示最后一行信息

  17. debuggroup summary,timer 34.17s image took more than 30 s to generate. Component timings are shown above. To always show them, use -debug_group timer. To adjust the time cutoff, change debug_auto_timer_report in etc/housekeeping.conf.


Example plot


Perl模塊的安裝


這里我看了教程[1]選擇使用Strawberry Perl


日常安裝

隨后打開perl command line進(jìn)行模塊安裝


Perl command line


  1. # 在命令行下輸入以下代碼

  2. cpan Carp Clone Config::General Cwd Data::Dumper Digest::MD5 File::Basename File::Spec::Functions File::Temp FindBin Font::TTF::Font GD GD::Image Getopt::Long IO::File List::MoreUtils List::Util Math::Round Math::Trig Math::VecStat Memoize Params::Validate Pod::Usage POSIX Readonly Regexp::Common Statistics::Basic Storable Sys::Hostname Text::Balanced Text::Format Time::HiRes

靜靜的等待安裝結(jié)束, 隨后使用PS(以下都使用此代替power shell)檢查所需模塊是否都已經(jīng)安裝成功。

  1. PS D:\Software\circos\circos-0.69-6\bin> ./circos -module

  2. ok 1.23 Carp

  3. ok 0.31 Clone

  4. ok 2.60 Config::General

  5. ok 3.36 Cwd

  6. ok 2.131 Data::Dumper

  7. ok 2.51 Digest::MD5

  8. ok 2.82 File::Basename

  9. ok 3.33 File::Spec::Functions

  10. ok 0.22 File::Temp

  11. ok 1.50 FindBin

  12. ok 0.39 Font::TTF::Font

  13. ok 2.46 GD

  14. ok 0.2 GD::Polyline

  15. ok 2.38 Getopt::Long

  16. ok 1.15 IO::File

  17. ok 0.33 List::MoreUtils

  18. ok 1.23 List::Util

  19. ok 0.01 Math::Bezier

  20. ok 1.997 Math::BigFloat

  21. ok 0.06 Math::Round

  22. ok 0.08 Math::VecStat

  23. ok 1.02 Memoize

  24. ok 1.24 POSIX

  25. ok 1.05 Params::Validate

  26. ok 1.36 Pod::Usage

  27. ok 1.03 Readonly

  28. ok 2013031301 Regexp::Common

  29. ok 2.50 SVG

  30. ok 1.19 Set::IntSpan

  31. ok 1.6611 Statistics::Basic

  32. ok 2.30 Storable

  33. ok 1.16 Sys::Hostname

  34. ok 2.02 Text::Balanced

  35. ok 0.59 Text::Format

  36. ok 1.9724 Time::HiRes

  37. PS D:\Software\circos\circos-0.69-6\bin>

此步操作沒有問題,接下來就是愉快的作圖時(shí)光!


Linux下安裝Circos


老規(guī)矩還是anaconda

  1. conda install -c bioconda circos

[1]: 最美不過遇見你_8090


最低配上手教程


安裝好Circos后我們看到作者推薦從quick start系列教程開始學(xué)起,首先我們對(duì)circos的作圖模式有一個(gè)了解,只有掌握作圖邏輯才可以真正理解circos。

本節(jié)學(xué)習(xí)使用最少的配置文件,先把圖片畫出來。隨后再對(duì)需要的參數(shù)進(jìn)行詳細(xì)的研究。

本最低配圖片將展示人類上色后的24條染色體,當(dāng)然隨后我們也可以加入一些額外參數(shù)使圖片更好看些。


1

MINIMUM CONFIGURATIO


  1. # circos.conf

  2. karyotype = data/karyotype/karyotype.human.txt

  3. default = 0.005r

  4. radius = 0.9r

  5. thickness = 20bp

  6. fill = yes

  7. # 后面的內(nèi)容都是標(biāo)準(zhǔn)且必須的。每個(gè)circos作圖都會(huì)至少需要這些參數(shù),在需要的時(shí)候可以被修改,具體內(nèi)容請(qǐng)查看 etc/文件夾

  8. # 在circos文件夾下

  9. >

  10. # 顏色定義

  11. >

  12. # 調(diào)試參數(shù)

  13. >

2

KARYOTYPE


karyotype文件一般來說都是需要的,它定義了染色體的名稱,大小,顏色。但是circos可以展示很多其它的數(shù)據(jù),所以該文件的參數(shù)也并不限定針對(duì)染色體。

在安裝好的circos/data/karyotype/文件夾下已經(jīng)自帶了數(shù)個(gè)常見生物的序列信息:人類,小鼠,大鼠,果蠅。

當(dāng)參數(shù)karyotype指定了一個(gè)文件的位置的時(shí)候,文件路徑可以是絕對(duì)路徑或者是相對(duì)路徑,相對(duì)路徑的意思就是如果在運(yùn)行目錄沒有找到指定文件,就會(huì)在circos文件夾下尋找,這也是為什么此處我們只需要指定data/karyotype的原因。

3

IDEOGRAMS


一旦circos有了染色體信息可以用來作圖的時(shí)候,核型模式圖信息就會(huì)被需要來告訴circos在哪里進(jìn)行標(biāo)記。

ideogram區(qū)塊的參數(shù)可以指定,例如 radius, thickness, fill,除此之外, 參數(shù)也可以指定兩條染色體之間的間隔。


4

實(shí)戰(zhàn)


將以上代碼保存為circos.conf,powershell進(jìn)入該文件所在位置,調(diào)用circos即可作圖;

  1. PS D:\Software\circos\circos-0.69-6\my_circos> ..\bin\circos -conf .\circos.conf

  2. debuggroup summary 0.16s welcome to circos v0.69-6 31 July 2017 on Perl 5.014002

  3. debuggroup summary 0.16s current working directory D:/Software/circos/circos-0.69-6/my_circos

  4. debuggroup summary 0.16s command D:\Software\circos\circos-0.69-6\bin\circos.exe -conf .\circos.conf

  5. debuggroup summary 0.16s loading configuration from file .\circos.conf

  6. debuggroup summary 0.16s found conf file .\circos.conf

  7. debuggroup summary 0.49s debug will appear for these features: output,summary

  8. debuggroup summary 0.49s bitmap output image ./.\circos.png

  9. debuggroup summary 0.49s SVG output image ./.\circos.svg

  10. debuggroup summary 0.49s parsing karyotype and organizing ideograms

  11. debuggroup summary 0.58s karyotype has 24 chromosomes of total size 3,095,677,436

  12. debuggroup summary 0.58s applying global and local scaling

  13. debuggroup summary 0.59s allocating image, colors and brushes

  14. debuggroup summary 6.69s drawing 24 ideograms of total size 3,095,677,436

  15. debuggroup summary 6.69s drawing highlights and ideograms

  16. debuggroup output 6.73s generating output

  17. debuggroup output 7.10s created PNG image ./.\circos.png (84 kb)

  18. debuggroup output 7.12s created SVG image ./.\circos.svg (6 kb)

  19. PS D:\Software\circos\circos-0.69-6\my_circos>

結(jié)果如下:


結(jié)果

簡(jiǎn)單進(jìn)階:添加坐標(biāo)和標(biāo)簽


在此章,我們學(xué)習(xí)將在原有圖形基礎(chǔ)上添加標(biāo)簽和刻度。為了達(dá)到這個(gè)目的,我們需要在 ideogram分區(qū)添加label參數(shù),并增添 ticks分區(qū)。

1

DEOGRAM LABELS


label參數(shù)格式有很多,這里展示最少的需要的變量:

  1. default = 0.005r

  2. # ideogram的位置設(shè)定,顏色填充設(shè)定的,輪廓設(shè)定

  3. radius = 0.90r

  4. thichness = 20bp

  5. fill = yes

  6. stroke_color = dgrey

  7. strock_thickness = 2p

  8. # 標(biāo)簽最少參數(shù)設(shè)定示例

  9. show_label = yes

  10. # 支持字體可以在etc/fonts.conf文件中查看

  11. label_font = default

  12. label_radius = 1R + 75p

  13. label_size = 30

  14. label_parallel = yes

其中l(wèi)abel_radius參數(shù)可以自己設(shè)定為相對(duì)位置或者是絕對(duì)位置:

  1. # 以半徑為單位

  2. label_radius = 1.1r

  3. label_radius = 0.8r

  4. # 絕對(duì)位置

  5. label_radius = 500p

  6. # 相對(duì)加上絕對(duì)位置

  7. label_radius = 1r + 100p

  8. # 使用圖像大小來界定

  9. label_radius = dims(image,radius) - 50p

  10. # 使用核型模式圖來界定

  11. label_radius = dims(ideogram,radius_outer) + 50p

  12. label_radius = dims(ideogram,radius_inner) - 50p

2

TICK MARKS AND LABELS


刻度一般都是成組出現(xiàn)的,你可以指定它們的相對(duì)位置和絕對(duì)位置,最低配的參數(shù)如下:

  1. show_ticks = yes

  2. show_tick_labels = yes

  3. radius = 1r

  4. color = black

  5. thickness = 2p

  6. # 刻度標(biāo)簽

  7. multiplier = 1e-6

  8. # %d = 整數(shù)

  9. # %f = 浮點(diǎn)數(shù)

  10. # %.1f = 指定小數(shù)點(diǎn)后保留一位

  11. # %.2f = 指定小數(shù)點(diǎn)后保留兩位

  12. format = %d

  13. spacing = 5u

  14. size = 10bp

  15. spacing = 25u

  16. size = 15p

  17. show_label = yes

  18. label_size = 20p

  19. label_offset = 10p

  20. format = %d

我們可以看到這里指定了兩個(gè) ,是因?yàn)闀?huì)根據(jù)ideogram的情況自動(dòng)選擇最優(yōu)的展現(xiàn)方式。


3

實(shí)戰(zhàn)


隨后我們將這兩段代碼分別保存成 ideogram.conf和 ticks.conf文件,修改之前的circos.conf,將ideogram作為單獨(dú)模塊隔離出來同時(shí)指定其它模塊的作圖單位 chromsomes_units參數(shù),那么circos.conf會(huì)變成:

  1. karyotype = data/karyotype/karyotype.human.txt

  2. chromosomes_units = 1000000

  3. >

  4. >

  5. >

  6. >

  7. >

OK,一切搞定后再次調(diào)用powershell來作圖:

  1. PS D:\Software\circos\circos-0.69-6\my_circos> ..\bin\circos -conf .\circos.conf

  2. debuggroup summary 0.15s welcome to circos v0.69-6 31 July 2017 on Perl 5.014002

  3. debuggroup summary 0.15s current working directory D:/Software/circos/circos-0.69-6/my_circos

  4. debuggroup summary 0.15s command D:\Software\circos\circos-0.69-6\bin\circos.exe -conf .\circos.conf

  5. debuggroup summary 0.15s loading configuration from file .\circos.conf

  6. debuggroup summary 0.16s found conf file .\circos.conf

  7. debuggroup summary 0.32s debug will appear for these features: output,summary

  8. debuggroup summary 0.32s bitmap output image ./.\circos.png

  9. debuggroup summary 0.32s SVG output image ./.\circos.svg

  10. debuggroup summary 0.32s parsing karyotype and organizing ideograms

  11. debuggroup summary 0.40s karyotype has 24 chromosomes of total size 3,095,677,436

  12. debuggroup summary 0.41s applying global and local scaling

  13. debuggroup summary 0.42s allocating image, colors and brushes

  14. debuggroup summary 2.07s drawing 24 ideograms of total size 3,095,677,436

  15. debuggroup summary 2.07s drawing highlights and ideograms

  16. debuggroup output 2.53s generating output

  17. debuggroup output 2.94s created PNG image ./.\circos.png (271 kb)

  18. debuggroup output 2.94s created SVG image ./.\circos.svg (123 kb)

  19. PS D:\Software\circos\circos-0.69-6\my_circos>

現(xiàn)在我們就有標(biāo)記好的圖片了:



染色體選擇,縮放,顏色以及方向


本章節(jié)討論如何對(duì)已經(jīng)展示出來的元素進(jìn)行調(diào)整。


1

IDEOGRAM SECTION


默認(rèn)是展示所有的染色體,順序是按照文件里面的順序。但是可以通過 chromsomes_display_default參數(shù)來設(shè)定展示哪部分染色體:

  1. chromosomes_display_default = no

  2. chromosomes = hs1;hs2;hs3;h4

  3. # 正則也是支持的哦

  4. chromosomes = /hs[1-4]$/

  5. # 也可以結(jié)合使用

  6. chromosomes = /hs[1-4]$/;hs10;hs11

  7. # “-”號(hào)代表著不顯示某個(gè)染色體

  8. chromosomes = /hs[1-4]$/;-hs3

  9. # 注意是使用;分號(hào)來作為分隔符的

2

IDEOGRAM SCALE


設(shè)定染色體的大小有相對(duì)指定和絕對(duì)指定兩種模式。

首先來看絕對(duì)指定:

  1. # hs1 0.25x zoom

  2. # hs2 2.00x zoom

  3. chromosomes_scale = hs1=0.25,hs2=2.0

相對(duì)指定就是以相對(duì)半徑為單位了

  1. # hs1 25% of figure

  2. # hs2 50% of figure

  3. chromosomes_scale = hs1=0.25r,hs2=0.50r

也可以指定多少個(gè)染色體分享多少比例的圖片

  1. # hs1,hs2 distributed evenly within 50% of figure (each is 25%)

  2. chromosomes_scale = /hs[12]/=0.5rn

或者指定大家一塊均分

  1. # 所有的的ideogram均分整張圖片的比例

  2. chromosomes_scale = /./=1rn

3

SCALE PROGRESSION


默認(rèn)染色體的排列順序呢,是按照順時(shí)針方向的,但是可以通過在 模塊里面的 angle_orientation參數(shù)來設(shè)置:

  1. angle_orientation* = counterclockwise

  2. # * 號(hào)的意義在于覆蓋一個(gè)參數(shù)

  3. >

也可以指定特定的染色體的排列順序,使用 chromosomes-reverse參數(shù)

  1. chromosomes-reverse = /hs[234]/

這里沒有加入原字符$是沒有關(guān)系,因?yàn)檫@里只指定了畫1234染色體,當(dāng)然嚴(yán)謹(jǐn)起見最好還是習(xí)慣性的加上

4

IDEOGRAM COLOR


默認(rèn)的顏色設(shè)定來自于karyotype文件,可以通過 charomsomes_color參數(shù)設(shè)定

  1. chromosomes_color = hs1=red,hs2=orange,hs3=green,hs4=blue

5

IDEPGRAM RADIAL POSITION


默認(rèn)的參數(shù)是將所有的染色體以一樣的徑向位置排列的,但是在 模塊里面的 radial參數(shù)可以改變所有染色體的徑向位置,或者通過 chromosomes_radius參數(shù)改變單個(gè)或者多個(gè)染色體的徑向位置

  1. chromosomes_radius = hs4:0.9r

6

實(shí)戰(zhàn)


老規(guī)矩,把所有代碼保存為conf文件,調(diào)用powershell作圖:

  1. # circos.conf

  2. karyotype = data/karyotype/karyotype.human.txt

  3. chromosomes_units = 1000000

  4. # 設(shè)定作圖染色體防微

  5. chromosomes_display_default = no

  6. chromosomes = /hs[1-4]$/

  7. # 設(shè)定縮放比例

  8. chromosomes_scale = hs1=0.5r,/hs[234]/=0.5rn

  9. # 設(shè)置排列順序

  10. chromosomes_reverse = /hs[234]/

  11. # 設(shè)置填充顏色

  12. chromosomes_color = hs1=red,hs2=orange,hs3=green,hs4=blue

  13. # 設(shè)置徑向位置

  14. chromosomes_radius = hs4:0.9r

  15. # 調(diào)用默認(rèn)文件補(bǔ)齊其余參數(shù)

  16. >

  17. >

  18. >

  19. >

  20. >

  1. # ideogram.conf

  2. default = 0.005r

  3. radius = 0.90r

  4. thickness = 20p

  5. fill = yes

  6. stroke_color = dgrey

  7. stroke_thickness = 2p

  8. show_label = yes

  9. # see etc/fonts.conf for list of font names

  10. label_font = default

  11. label_radius = 1.075r

  12. # 假如想要標(biāo)簽盡可能靠近圖像,使用下一行代碼

  13. # label_radius = dims(image,radius) - 60p

  14. label_size = 30

  15. label_parallel = yes

  1. # ticks.conf

  2. show_ticks = yes

  3. show_tick_labels = yes

  4. radius = 1r

  5. color = black

  6. thickness = 2p

  7. multiplier = 1e-6

  8. format = %d

  9. spacing = 5u

  10. size = 10p

  11. spacing = 25u

  12. size = 15p

  13. show_label = yes

  14. label_size = 20p

  15. label_offset = 10p

  16. format = %d

  1. PS D:\Software\circos\circos-0.69-6\my_circos> ..\bin\circos -conf .\circos.conf

  2. debuggroup summary 0.31s welcome to circos v0.69-6 31 July 2017 on Perl 5.014002

  3. debuggroup summary 0.31s current working directory D:/Software/circos/circos-0.69-6/my_circos

  4. debuggroup summary 0.32s command D:\Software\circos\circos-0.69-6\bin\circos.exe -conf .\circos.conf

  5. debuggroup summary 0.32s loading configuration from file .\circos.conf

  6. debuggroup summary 0.32s found conf file .\circos.conf

  7. debuggroup summary 0.50s debug will appear for these features: output,summary

  8. debuggroup summary 0.50s bitmap output image ./.\circos.png

  9. debuggroup summary 0.50s SVG output image ./.\circos.svg

  10. debuggroup summary 0.50s parsing karyotype and organizing ideograms

  11. debuggroup summary 0.60s karyotype has 24 chromosomes of total size 3,095,677,436

  12. debuggroup summary 0.60s applying global and local scaling

  13. debuggroup summary 0.63s allocating image, colors and brushes

  14. debuggroup summary 2.68s drawing 4 ideograms of total size 881,626,704

  15. debuggroup summary 2.68s drawing highlights and ideograms

  16. debuggroup output 2.83s generating output

  17. debuggroup output 3.19s created PNG image ./.\circos.png (132 kb)

  18. debuggroup output 3.20s created SVG image ./.\circos.svg (34 kb)

  19. PS D:\Software\circos\circos-0.69-6\my_circos>



到此,入門就算告一段落,后面就是根據(jù)自己需求往上面添加各種tracks以及選擇各種炫酷的效果啦。

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多