Record of circos usage
歡迎關(guān)注天下博客:http://blog.genesino.com/2012/04/circos-usage/
Circos是繪制圈圖的神器,在http://circos.ca/images/頁面有很多CIRCOS可視化的示例。
Circos可以在線使用,在線使用時是把表格轉(zhuǎn)為圈圖,不過只允許最大75行和75列;做一些簡單的示意圖會比較好,最后時會介紹下在線的tableviewer的使用。
也可以安裝在本地,在本地可以繪制基于基因組的更復(fù)雜的圖。
Circos由Perl寫成,安裝相對簡單,只要Perl的包都裝好了就可以了。
Circos安裝
從http://circos.ca/software/download/circos/下載Circos安裝包,并解壓,把安裝包內(nèi)的bin目錄加載到環(huán)境變量。
wget http://circos.ca/distribution/circos-0.69-6.tgz tar xvzf circos-0.69-6.tgz ln -s `pwd`/circos-0.69-6/bin/* ~/bin #make sure ~/bin is in $PATHor# 注意pwd兩側(cè)的反引號export PATH=$PATH:`pwd`/circos-0.69/bin安裝依賴的Perl包
配置CPANM (CPANM是一個文件,下載下來,增加可執(zhí)行屬性,放到環(huán)境變量中即可使用)
# 若無根用戶權(quán)限,也可放入自己家目錄下在環(huán)境變量內(nèi)的目錄中就可以 wget https://raw.githubusercontent.com/miyagawa/cpanminus/master/cpanm -O /sbin/cpanm chmod +x /sbin/cpanm獲得依賴的Perl包,circos -module
ok 1.11 Carp missing Clone missing Config::General ok 3.3 Cwd ok 2.124 Data::Dumper ok 2.55 Digest::MD5 ok 2.77 File::Basename ok 3.3 File::Spec::Functions ok 0.22 File::Temp ok 1.50 FindBin missing Font::TTF::Font missing GD missing GD::Polyline ok 2.38 Getopt::Long ok 1.14 IO::File missing List::MoreUtils ok 1.21 List::Util missing Math::Bezier ok 1.60 Math::BigFloat missing Math::Round missing Math::VecStat ok 1.01_03 Memoize ok 1.17 POSIX missing Params::Validate ok 1.36 Pod::Usage missing Readonly missing Regexp::Common missing SVG missing Set::IntSpan missing Statistics::Basic ok 2.20 Storable ok 1.11 Sys::Hostname ok 2.0.0 Text::Balanced missing Text::Format ok 1.9721 Time::HiRes獲取缺失模塊并安裝
# 第一句話的目的只是查看需要運行的命令,直接運行第二句就好circos -module | grep 'missing' | awk '{a=a" "$2;}END{print "cpanm"a}' circos -module | grep 'missing' | awk '{a=a" "$2;}END{system("cpanm"a);}'再運行circos -module發(fā)現(xiàn)GD和GD::Polyline沒安裝上,查看錯誤信息是No package 'gdlib' found
# 根用戶yum install gd-devel然后再用cpanm安裝GD和GD::Polyline。
最簡單出圖
把下面的內(nèi)容存儲到任意目錄下的任意文件比如ehbio.conf下,然后運行circos -conf ehbio.conf就可以獲得circos的圖circos.png和circos.svg。
karyotype = data/karyotype/karyotype.human.txt<ideogram><spacing> default = 0.005r </spacing>radius = 0.9r thickness = 20p fill = yes</ideogram>################################################################ # The remaining content is standard and required. It is imported # from default files in the Circos distribution. # # These should be present in every Circos configuration file and # overridden as required. To see the content of these files, # look in etc/ in the Circos distribution.<image> # Included from Circos distribution. <<include etc/image.conf>> </image># RGB/HSV color definitions, color lists, location of fonts, fill patterns. # Included from Circos distribution. <<include etc/colors_fonts_patterns.conf>># Debugging, I/O an dother system parameters # Included from Circos distribution. <<include etc/housekeeping.conf>>上述命令是怎么運行的呢?
# karyotype定義染色體的名字、ID、起始位置信息,是繪制圖的根本 karyotype = data/karyotype/karyotype.human.txt# 必須的部分,控制染色體信息顯示 <ideogram># 定義染色體之間的間距,為圖形半徑的5% (r代表radius,半徑) <spacing> default = 0.005r </spacing># 染色體區(qū)域的繪制位置,默認(rèn)所有染色體都處于遠離圓心同樣距離的位置 # 這里設(shè)置的是圖形半徑的0.9倍的位置 # 也可以設(shè)置絕對像素值 radius = 0.9r # 染色體區(qū)域的寬度,可以是相對圖形半徑,也可以說絕對像素值 thickness = 20p# 染色體區(qū)域填充顏色 fill = yes</ideogram>################################################################ # The remaining content is standard and required. It is imported # from default files in the Circos distribution. # # These should be present in every Circos configuration file and # overridden as required. To see the content of these files, # look in etc/ in the Circos distribution.# 這些都是引用文件,暫時不去管什么意思,后面用到再逐個解釋。 # 但是繪圖時這些必須引用。下面會解釋下最關(guān)鍵的引用位置。 <image> # Included from Circos distribution. <<include etc/image.conf>> </image># RGB/HSV color definitions, color lists, location of fonts, fill patterns. # Included from Circos distribution. <<include etc/colors_fonts_patterns.conf>># Debugging, I/O an dother system parameters # Included from Circos distribution. <<include etc/housekeeping.conf>>最開始看CIRCOS的配置文件時,不理解其是如何查找用到的數(shù)據(jù)和配置目錄時,不過上面配置文件中被注釋掉的一句話泄露了天機look in etc/ in the Circos distribution。配置文件和數(shù)據(jù)文件默認(rèn)先在當(dāng)前目錄查找,若沒有則去CIRCOS的安裝目錄下查找。
下面列出了CIRCOS搜索配置文件時查找的目錄(搜索數(shù)據(jù)時也類似)
. ./etc /MPATHB/soft/circos-0.69-6/bin/etc /MPATHB/soft/circos-0.69-6/bin/../etc /MPATHB/soft/circos-0.69-6/bin/.. /MPATHB/soft/circos-0.69-6/bin不得不敢寫CIRCOS的日志輸出,很詳細(xì),每次都刷屏。當(dāng)我們運行CIRCOS失敗時,看下日志信息,會得到很多提示。
數(shù)據(jù)和配置文件都在CIRCOS安裝目錄下,那么先看看它的目錄結(jié)構(gòu)吧。
circos安裝目錄介紹
bin: 目錄下是circos可執(zhí)行程序,加入環(huán)境變量即可
data: 目錄下有一個文件夾karyotype,里面收錄了幾個物種染色體信息文件。
karyotype.chimp.txt karyotype.arabidopsis.tair10.txt karyotype.human.hg38.txt karyotype.human.hg19.txt karyotype.mouse.mm10.txt karyotype.yeast.txt karyotype.zeamays.txt這個是繪制CIRCOS圖所必須的一個文件 (文件的內(nèi)容雖然通常是染色體的信息,但不局限于染色體信息,其它的區(qū)域信息、時間序列信息都可以使用)
文件內(nèi)容如下 (#后面是注釋,會被忽略)
前兩列是固定的,chr -。chr表示定義一條染色體;-表示指定這個區(qū)域的父區(qū)域,染色體沒有父區(qū)域,用-代替。
ID是當(dāng)前區(qū)域的名字,其子區(qū)域的父區(qū)域列都使用這個名字。如果同時繪制多個物種,可在ID中包含物種的代號。
LABEL是當(dāng)前區(qū)域顯示的名字。
START END是當(dāng)前區(qū)域的范圍,必須是整個的區(qū)域。如果想顯示部分區(qū)域,可在后續(xù)配置中修改。
COLOR是當(dāng)前區(qū)域的顏色,CIRCOS為每個染色體有定義好的顏色,存儲于etc/colors.conf。除了預(yù)先定義了染色體的顏色,還定義了一些顏色變量可以直接使用。
#chr - ID LABEL START END COLOR chr - hs1 1 0 248956422 chr1 chr - hs2 2 0 242193529 chr2 chr - hs3 3 0 198295559 chr3 chr - hs4 4 0 190214555 chr4 chr - hs5 5 0 181538259 chr5 chr - hs6 6 0 170805979 chr6 chr - hs7 7 0 159345973 chr7 chr - hs8 8 0 145138636 chr8 chr - hs9 9 0 138394717 chr9etc目錄下是配置文件,前面引用到了3個。
image.conf內(nèi)容如下
<<include image.generic.conf>> <<include background.white.conf>>image.generic.conf內(nèi)容如下,定義了輸出的圖形的名字、格式、大小等,這些都可以在自定義配置文件,即前面提到的ehbio.conf中覆蓋。
dir = . #dir = conf(configdir) file = circos.png png = yes svg = yes# radius of inscribed circle in image radius = 1500p# by default angle=0 is at 3 o'clock position angle_offset = -90#angle_orientation = counterclockwiseauto_alpha_colors = yes auto_alpha_steps = 5background.white.conf只定義了背景是白色。
colors_fonts_patterns.conf引用了顏色、字體、預(yù)定義的圖形文件信息的配置
<colors> <<include etc/colors.conf>> </colors> <fonts> <<include etc/fonts.conf>> </fonts> <patterns> <<include etc/patterns.conf>> </patterns>colors.conf及其引用文件內(nèi)容摘錄如下,利用RGB組合設(shè)置了顏色變量、系列顏色和染色體的顏色。(染色體的名字全部使用小寫)
dpblue = 0,153,237 vdpblue = 0,136,220 vvdpblue = 0,120,204vvlpurple = purples-7-seq-1 vlpurple = purples-7-seq-2gpos100 = 0,0,0 gpos = 0,0,0 gpos75 = 130,130,130chr1 = 153,102,0 chr2 = 102,102,0 chr3 = 153,153,30patterns.conf定義特殊小圖形的信息
# pattern fills for PNG filesvline = tiles/vlines.png vline-sparse = tiles/vlines-sparse.pnghline = tiles/hlines.png hline-sparse = tiles/hlines-sparse.pngchecker = tiles/checkers.png checker-sparse = tiles/checkers-sparse.pngdot = tiles/dots.png dot-sparse = tiles/dots-sparse.png solid = tiles/solid.pnghousekeeping.conf必須在最上層自定義配置文件中(也就是ehbio.conf)中引用。這個文件名字起的很生物,持家配置,必須要,而且不建議修改。具體內(nèi)容就不列出了,感興趣的自己去看。
染色體信息展示和調(diào)整
把前面的配置文件再拓展一些,給染色體加上名字,并且按照染色深淺上色。
karyotype變量指定了繪制CIRCOS圖所必須的一個文件 (文件的內(nèi)容雖然通常是染色體的信息,但不局限于染色體信息,其它的區(qū)域信息、時間序列信息都可以使用)
文件內(nèi)容如下 (#后面是注釋,會被忽略)
前兩列是固定的,chr -。chr表示定義一條染色體;-表示指定這個區(qū)域的父區(qū)域,染色體沒有父區(qū)域,用-代替。
ID是當(dāng)前區(qū)域的名字,其子區(qū)域的父區(qū)域列都使用這個名字。如果同時繪制多個物種,可在ID中包含物種的代號。
LABEL是當(dāng)前區(qū)域顯示的名字。
START END是當(dāng)前區(qū)域的范圍,必須是整個的區(qū)域。如果想顯示部分區(qū)域,可在后續(xù)配置中修改。
COLOR是當(dāng)前區(qū)域的顏色,CIRCOS為每個染色體有定義好的顏色,存儲于etc/colors.conf。除了預(yù)先定義了染色體的顏色,還定義了一些顏色變量可以直接使用。
#chr - ID LABEL START END COLOR chr - hs1 1 0 248956422 chr1 chr - hs2 2 0 242193529 chr2 chr - hs3 3 0 198295559 chr3 chr - hs4 4 0 190214555 chr4 chr - hs5 5 0 181538259 chr5 chr - hs6 6 0 170805979 chr6 chr - hs7 7 0 159345973 chr7 chr - hs8 8 0 145138636 chr8 chr - hs9 9 0 138394717 chr9如果有cytogenetic band信息,則寫到文件末尾。band是固定的,DOMAIN指定從屬信息,對應(yīng)于上面染色體的ID信息。其它列與上面解釋相同。
#band DOAMIN ID LABEL START END COLOR band hs1 p36.33 p36.33 0 2300000 gneg band hs1 p36.32 p36.32 2300000 5400000 gpos25 band hs1 p36.31 p36.31 5400000 7200000 gneg band hs1 p36.23 p36.23 7200000 9200000 gpos25 band hs1 p36.22 p36.22 9200000 12700000 gneg band hs1 p36.21 p36.21 12700000 16200000 gpos50 # karyotype定義染色體的名字、ID、起始位置信息,是繪制圖的根本 karyotype = data/karyotype/karyotype.human.txt# 必須的部分,控制染色體信息顯示 # http://circos.ca/documentation/tutorials/reference/ideogram/ <ideogram># 定義顯示的染色體之間的間距,為圖形半徑的0.5% (r代表radius,半徑) <spacing> default = 0.005r </spacing># 染色體區(qū)域的繪制位置,默認(rèn)所有染色體都處于遠離圓心同樣距離的位置 # 這里設(shè)置的是圖形半徑的0.9倍的位置 # 也可以設(shè)置絕對像素值 radius = 0.9r # 染色體區(qū)域的寬度,可以是相對圖形半徑,也可以說絕對像素值 thickness = 20p# 染色體區(qū)域填充顏色 fill = yes# 染色體邊的顏色和寬度 stroke_thickness = 2 stroke_color = black# 顯示染色體標(biāo)簽名字 # 更多l(xiāng)abel的調(diào)整見 # http://circos.ca/documentation/tutorials/ideograms/labels/lesson show_label = yes label_font = default # ideogram外圈再加總半徑的0.05 label_radius = dims(ideogram,radius_outer) + 0.005r# 如果想把label標(biāo)記在圈里可以寫,外圈半徑+內(nèi)圈半徑除以2 # label_rdius = (dims(ideogram,radius_outer)+dims(ideogram,radius_inner))/2 label_size = 24 # label與圈平行 label_parallel = yes label_case = upper# 顯示karyotype中定義的細(xì)胞遺傳學(xué)條帶 # fill_bands=yes 表示使用預(yù)先定義的顏色 show_bands = yes fill_bands = yes band_transparency = 4</ideogram>################################################################ # The remaining content is standard and required. It is imported # from default files in the Circos distribution. # # These should be present in every Circos configuration file and # overridden as required. To see the content of these files, # look in etc/ in the Circos distribution.# 這些都是引用文件,暫時不去管什么意思,后面用到再逐個解釋。 # 但是繪圖時這些必須引用。下面會解釋下最關(guān)鍵的引用位置。 <image> # Included from Circos distribution. <<include etc/image.conf>> file* = circos_label_band.png </image># RGB/HSV color definitions, color lists, location of fonts, fill patterns. # Included from Circos distribution. <<include etc/colors_fonts_patterns.conf>># Debugging, I/O an dother system parameters # Included from Circos distribution. <<include etc/housekeeping.conf>>顯示染色體刻度信息,chromosome_units定義染色體一個單位的大小,縮寫為u。若chromosome_units=1000000, 則10u=10000000。
# karyotype定義染色體的名字、ID、起始位置信息,是繪制圖的根本 karyotype = data/karyotype/karyotype.human.txt# 必須的部分,控制染色體信息顯示 # 更多解釋見 # http://circos.ca/documentation/tutorials/reference/ideogram/ <ideogram># 定義顯示的染色體之間的間距,為圖形半徑的0.5% (r代表radius,半徑) <spacing> default = 0.005r </spacing># 染色體區(qū)域的繪制位置,默認(rèn)所有染色體都處于遠離圓心同樣距離的位置 # 這里設(shè)置的是圖形半徑的0.9倍的位置 # 也可以設(shè)置絕對像素值 radius = 0.9r# 染色體區(qū)域的寬度,可以是相對圖形半徑,也可以說絕對像素值 thickness = 20p# 染色體區(qū)域填充顏色 fill = yes# 染色體邊的顏色和寬度 stroke_thickness = 2 stroke_color = black# 顯示染色體標(biāo)簽名字 # 更多l(xiāng)abel的調(diào)整見 # http://circos.ca/documentation/tutorials/ideograms/labels/lesson show_label = yes label_font = default # ideogram外圈再加總半徑的0.05 label_radius = dims(ideogram,radius_outer) + 0.05r# 如果想把label標(biāo)記在圈里可以寫,外圈半徑+內(nèi)圈半徑除以2 # label_rdius = (dims(ideogram,radius_outer)+dims(ideogram,radius_inner))/2 label_size = 24 # label與圈平行 label_parallel = yes label_case = upper# 顯示karyotype中定義的細(xì)胞遺傳學(xué)條帶 # fill_bands=yes 表示使用預(yù)先定義的顏色 show_bands = yes fill_bands = yes band_transparency = 4 </ideogram>chromosomes_units = 1000000 show_ticks = yes show_tick_labels = yes<ticks> # ticks塊定義了全局水平的tick的屬性 # 更多解釋見http://circos.ca/documentation/tutorials/ticks_and_labels/basics/ # ticks出現(xiàn)的位置 radius = dims(ideogram,radius_outer) # The label multiplier is the constant used to multiply the tick value to obtain the tick label. For example, if the multiplier is 1e-6, then the tick mark at position 10, 000, 000 will have a label of 10. The multiplier is applied to the raw tick value, regardless of the value of chromosomes_unit. # multiplier是用于獲得ticks label的,當(dāng)前ticks對應(yīng)的染色體位置乘以multiplier就得到ticks label # 這個值的設(shè)置與chromosomes_units是沒有任何關(guān)系的 # 比如當(dāng)前位置是10,000,000, 乘以multiplier (1e-6)就是10 multiplier = 1e-6 # ticks顏色、粗細(xì)、大小 color = black thickness = 2p size = 15p # 默認(rèn)所有染色體都顯示, 放置在ticks塊中全局有效 chromosomes_display_default=yes # 不在任何染色體顯示, 放置在tick塊中單個tick有效 # 單詞拼錯無效 #chromosomes_display_default=no# 每個tick定義一種間隔,20u, 5u, 還可增加3u,4u等, 大的刻度會覆蓋小的刻度 # 20u的間隔,定義大的ticks,并顯示ticks_label <tick> # spacing定義多大間距一個tick spacing = 20u show_label = yes label_size = 20p # label的偏移量 label_offset = 10p # %d, %.nf format = %d </tick># 5u的間隔,定義小的ticks <tick> spacing = 5u color = grey size = 10p # 定義在哪些染色體顯示ticks,哪些區(qū)域不顯示 chromosomes=-hs1;-hs2:0-100;-hs3:100-) </tick># 30u的間隔,定義中等的ticks <tick> chromosomes_display_default=no spacing = 30u color = red size = 15p chromosomes=hs1 </tick></ticks>################################################################ # The remaining content is standard and required. It is imported # from default files in the Circos distribution. # # These should be present in every Circos configuration file and # overridden as required. To see the content of these files, # look in etc/ in the Circos distribution.# 這些都是引用文件,暫時不去管什么意思,后面用到再逐個解釋。 # 但是繪圖時這些必須引用。下面會解釋下最關(guān)鍵的引用位置。 <image> # Included from Circos distribution. <<include etc/image.conf>> file* = circos_label_band_tick.png </image># RGB/HSV color definitions, color lists, location of fonts, fill patterns. # Included from Circos distribution. <<include etc/colors_fonts_patterns.conf>># Debugging, I/O an dother system parameters # Included from Circos distribution. <<include etc/housekeeping.conf>>在CIRCOS中chromosome表示karyotype文件中定義的染色體的序列結(jié)構(gòu)信息。ideogram是chromosome信息的展示方式。一個染色體可以不展示,也有可能分成多段展示,可以選擇圖的位置,設(shè)置每個染色體的位置、相對大小。
# karyotype定義染色體的名字、ID、起始位置信息,是繪制圖的根本 karyotype = data/karyotype/karyotype.human.txt# 必須的部分,控制染色體信息顯示 # 更多解釋見 # http://circos.ca/documentation/tutorials/reference/ideogram/ <ideogram># 定義顯示的染色體之間的間距,為圖形半徑的0.5% (r代表radius,半徑) <spacing> default = 0.005r </spacing># 染色體區(qū)域的繪制位置,默認(rèn)所有染色體都處于遠離圓心同樣距離的位置 # 這里設(shè)置的是圖形半徑的0.9倍的位置 # 也可以設(shè)置絕對像素值 radius = 0.9r# 改變?nèi)旧w在circos環(huán)中內(nèi)半徑大小 # 染色體區(qū)域的寬度,可以是相對圖形半徑,也可以說絕對像素值 thickness = 20p# 染色體區(qū)域填充顏色 fill = yes# 染色體邊的顏色和寬度 stroke_thickness = 2 stroke_color = black# 顯示染色體標(biāo)簽名字 # 更多l(xiāng)abel的調(diào)整見 # http://circos.ca/documentation/tutorials/ideograms/labels/lesson show_label = yes label_font = default # ideogram外圈再加總半徑的0.05 label_radius = dims(ideogram,radius_outer) + 0.05r# 如果想把label標(biāo)記在圈里可以寫,外圈半徑+內(nèi)圈半徑除以2 # label_rdius = (dims(ideogram,radius_outer)+dims(ideogram,radius_inner))/2 label_size = 24 # label與圈平行 label_parallel = yes label_case = upper# 顯示karyotype中定義的細(xì)胞遺傳學(xué)條帶 # fill_bands=yes 表示使用預(yù)先定義的顏色 show_bands = yes fill_bands = yes band_transparency = 4 </ideogram># 染色體大小調(diào)整 chromosomes_scale = hs1=0.1r;hs14=0.06r;hs6=0.06r # 個別染色體位置調(diào)整 chromosomes_radius = hs14:0.8r;hs6:0.8r;hs1:0.7rchromosomes_units = 1000000 show_ticks = yes show_tick_labels = yes<ticks> # ticks塊定義了全局水平的tick的屬性 # 更多解釋見http://circos.ca/documentation/tutorials/ticks_and_labels/basics/ # ticks出現(xiàn)的位置 radius = dims(ideogram,radius_outer) # The label multiplier is the constant used to multiply the tick value to obtain the tick label. For example, if the multiplier is 1e-6, then the tick mark at position 10, 000, 000 will have a label of 10. The multiplier is applied to the raw tick value, regardless of the value of chromosomes_unit. # multiplier是用于獲得ticks label的,當(dāng)前ticks對應(yīng)的染色體位置乘以multiplier就得到ticks label # 這個值的設(shè)置與chromosomes_units是沒有任何關(guān)系的 # 比如當(dāng)前位置是10,000,000, 乘以multiplier (1e-6)就是10 multiplier = 1e-6 # ticks顏色、粗細(xì)、大小 color = black thickness = 2p size = 15p # 默認(rèn)所有染色體都顯示, 放置在ticks塊中有效 chromosomes_display_default=yes # 不在任何染色體顯示, 放置在ticks塊中有效 #chromosomes_display_default=no# 每個tick定義一種間隔,20u, 5u, 還可增加3u,4u等, 大的刻度會覆蓋小的刻度 # 20u的間隔,定義大的ticks,并顯示ticks_label <tick> # spacing定義多大間距一個tick spacing = 20u show_label = yes label_size = 20p # label的偏移量 label_offset = 10p # %d, %.nf format = %d chromosomes=-hs1;-hs14;-hs6 </tick># 5u的間隔,定義小的ticks <tick> spacing = 5u color = grey size = 10p # 定義在哪些染色體顯示ticks,哪些區(qū)域不顯示 chromosomes=-hs1;-hs14;-hs6;-hs2:0-100;-hs3:100-) </tick># 30u的間隔,定義中等的ticks <tick> chromosomes_display_default=no spacing = 30u color = red size = 15p chromosomes=hs1 </tick></ticks>################################################################ # The remaining content is standard and required. It is imported # from default files in the Circos distribution. # # These should be present in every Circos configuration file and # overridden as required. To see the content of these files, # look in etc/ in the Circos distribution.# 這些都是引用文件,暫時不去管什么意思,后面用到再逐個解釋。 # 但是繪圖時這些必須引用。下面會解釋下最關(guān)鍵的引用位置。 <image> # Included from Circos distribution. <<include etc/image.conf>> file* = circos_label_band_tick_chromove.png #畫圖起始的位置,相對于三點鐘方向 angle_offset* = 74 # 圖形大小 radius = 800p </image># RGB/HSV color definitions, color lists, location of fonts, fill patterns. # Included from Circos distribution. <<include etc/colors_fonts_patterns.conf>># Debugging, I/O an dother system parameters # Included from Circos distribution. <<include etc/housekeeping.conf>>CIRCOS錯誤信息
Dimension [$DIMS->{‘ideogram’}{‘default’}{' radius_outer'}] is not defined in expression [dims(ideogram, default, radius_outer) + 0.05r]
- radius_outer前面多了個空格
CONFIGURATION FILE ERROR; Circos could not find the configuration file [simple.confy]]
- 配置文件不存在,或名字、路徑寫錯了
Config::General: Block “” has no EndBlock statement (level: 2, chunk 4191)!
- 區(qū)塊標(biāo)簽不成對
設(shè)置的效果沒有顯示也沒報銷
- 確認(rèn)單詞拼寫是否有問題
- 確認(rèn)是否寫入了正確的語句塊內(nèi)
Circos::Error::fatal_error(‘configuration’, ‘multivalue’, ‘a(chǎn)ngle_offset’, ‘image’)
- 沒有強制覆蓋默認(rèn)值
CIRCOS增加熱圖、點圖、線圖和區(qū)塊屬性
CIRCOS圖在有了染色體信息界定繪圖區(qū)域后,就可以向里面添加離散數(shù)據(jù)如標(biāo)記特定的區(qū)域或連續(xù)數(shù)據(jù)如展示修飾的豐度等。
經(jīng)過前面部分對CIRCOS基本安裝,最簡單繪圖和調(diào)整各部分屬性的熟悉后,這些基本配置都可以寫入單獨的文件,供多次使用,就像下面主配置文件中的include所示。
而我們每次繪圖主要修改的部分就在主配置文件里面,更換下對應(yīng)圈的文件名、半徑和繪制屬性即可。
main circos configure (test.circos.conf)
<<include etc/colors_fonts_patterns.conf>># # 必須的部分,控制染色體信息顯示 # # 之前兩篇教程為了方便理解ideogram和ticks都是直接寫在主配置文件的 # # 但通常實際使用時會拆分成不同文件,方便管理,所以這里采用了引用方式 # # 具體解釋都見前面的文章 <<include ideogram.conf>> <<include ticks.conf>># 定義輸出 <image> <<include etc/image.conf>> file*=test.circos.png dir*=./ </image># karyotype定義染色體的名字、ID、起始位置信息,是繪制圖的根本 # 具體解釋看前面2篇文章 karyotype = test.chromsomes.circos_input.txt# `chromosome_units`定義染色體一個單位的大小,縮寫為`u`。若`chromosome_units=1000000`, 則`10u=10000000`。 # 后面會用到這個單位,尤其是ticks中 chromosomes_units =1000000 chromosomes_display_default = yes# 大標(biāo)簽highlights,復(fù)數(shù)定義里面有多個highlight <highlights># 高亮的區(qū)域放在 <highlight>標(biāo)簽中,配置簡單,給定文件名和內(nèi)外半徑就好 # 文件格式見下面解釋 <highlight> file=HL1.bed.circos_input.txt r0=0.914285714286r r1=0.991428571429r </highlight># 高亮的區(qū)域放在 <highlight>標(biāo)簽中,配置簡單,給定文件名和內(nèi)外半徑就好 # 文件格式見下面解釋 <highlight> file=HL2.bed.circos_input.txt r0=0.828571428571r r1=0.905714285714r </highlight># 高亮的區(qū)域放在 <highlight>標(biāo)簽中,配置簡單,給定文件名和內(nèi)外半徑就好 # 文件格式見下面解釋 <highlight> file=HL3.bed.circos_input.txt r0=0.742857142857r r1=0.82r </highlight></highlights># 定義繪制的線圖、點圖、熱圖、直方圖等,復(fù)數(shù)plots <plots># 全局屬性定義 color = spectral-7-div-rev stroke_thickness = 1 stroke_color = black scale_log_base = 0.5# 其中一個子圖,給定文件名,內(nèi)外半徑,和繪制類型 # 文件格式見下面解釋 <plot> file=Heatmap1.bed.circos_input.txt type=line r0=0.657142857143r r1=0.734285714286r </plot># 其中一個子圖,給定文件名,內(nèi)外半徑,和繪制類型 # 文件格式見下面解釋 <plot> file=Heatmap2.bed.circos_input.txt type=scatter r0=0.571428571429r r1=0.648571428571r </plot># 其中一個子圖,給定文件名,內(nèi)外半徑,和繪制類型 # 文件格式見下面解釋 <plot> file=Heatmap3.bed.circos_input.txt type=histogram r0=0.485714285714r r1=0.562857142857r </plot># 其中一個子圖,給定文件名,內(nèi)外半徑,和繪制類型 # 文件格式見下面解釋 <plot> file=Heatmap4.bed.circos_input.txt type=heatmap r0=0.4r r1=0.477142857143r </plot></plots><<include etc/housekeeping.conf>> max_points_per_track* = 2500000 data_out_of_range* = trim下面看下文件格式的要求
test.chromsomes.circos_input.txt
##chr - ID LABEL START END COLOR chr - chr1 hs1 0 248956422 chr1 chr - chr2 hs2 0 242193529 chr2 chr - chr3 hs3 0 198295559 chr3 chr - chr4 hs4 0 190214555 chr4 chr - chr5 hs5 0 181538259 chr5高亮文件的格式一致,選其中一個做例子 HL1.bed.circos_input.txt
#ParentID START END ATTRIBUTE #ParentID對應(yīng)于karyotype文件的ID(第3列) #ATTRIBUTE列顏色的獲取看前面兩篇的介紹以獲知有多少可用顏色 chr1 0 6422000 fill_color=vlyellow chr1 12447822 24895644 fill_color=vlpred chr1 136926042 149373864 fill_color=vlppurple chr1 236508618 248956422 fill_color=vlporange chr2 0 2421000 fill_color=vlpred chr2 36329031 48438708 fill_color=vlpgreen chr2 193754832 205864509 fill_color=vlpred chr2 133206447 145316124 fill_color=vlyellow chr3 59488668 69403446 fill_color=vlpred chr3 128892114 138806892 fill_color=vlpblue chr3 1800000 198295559 fill_color=vlpred chr4 0 2145550 fill_color=vlpgreen chr4 95107280 104618008 fill_color=vlpblue chr4 133150192 142660920 fill_color=vlppurple chr4 190000000 190214555 fill_color=vlpgreen chr5 0 1538259 fill_color=vlpblue chr5 27230739 36307652 fill_color=vvlpgreen chr5 72615304 81692217 fill_color=vvlyellow chr5 127076782 136153695 fill_color=vvlporange chr5 15382590 15392590 fill_color=vlpblue數(shù)值文件格式也一致,只是給定不同的type繪制不同屬性的圖,如線圖、熱圖等。
Heatmap1.bed.circos_input.txt
#ParentID START END Value #ParentID對應(yīng)于karyotype文件的ID (第3列) #Value列為我們想展示的值 chr1 0 12447822 1 chr1 12447822 24895644 2 chr1 211612974 224060796 18 chr1 224060796 236508618 19 chr1 236508618 248956422 20 chr2 0 12109677 1 chr2 12109677 24219354 2 chr2 24219354 36329031 3 chr2 36329031 48438708 4 chr2 48438708 60548385 5 chr2 205864509 217974186 18 chr2 217974186 230083863 19 chr2 230083863 242193529 20 chr3 0 9914778 1 chr3 9914778 19829556 2 chr3 19829556 29744334 3 chr3 29744334 39659112 4 chr3 39659112 49573890 5 chr4 0 9510728 1 chr4 9510728 19021456 2 chr4 19021456 28532184 3 chr4 28532184 38042912 4 chr4 133150192 142660920 15 chr4 171193104 180703832 19 chr4 180703832 190214555 20 chr5 0 9076913 1 chr5 9076913 18153826 2 chr5 18153826 27230739 3 chr5 154307521 163384434 18 chr5 163384434 172461347 19 chr5 172461347 181538259 20所有文件都準(zhǔn)備好之后,運行circos -conf test.circos.conf就可以獲得test.circos.svg和test.circos.png兩幅圖了。
如果有屬性不理解或還需修改屬性,請參考前兩篇及前兩篇提供的屬性修改文檔方便查找。
后臺回復(fù)circos,可獲取所有推文鏈接和本次的測試數(shù)據(jù),直接體驗出圖。
生信寶典,一起學(xué)生信
http://mp.weixin.qq.com/s/i71OMaUu6QtcY0pt1njHQA
生信寶典,生物信息學(xué)習(xí)系列教程,轉(zhuǎn)錄組,宏基因組,外顯子組,R作圖,Python學(xué)習(xí),Cytoscape視頻教程
http://mp.weixin.qq.com/s/d1KCETQZ88yaOLGwAtpWYg
生信寶典,最好的生物信息培訓(xùn)課程,培訓(xùn)課程資料
www.ehbio.com/Training
總結(jié)
以上是生活随笔為你收集整理的Record of circos usage的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 适用于ps的Raw格式图像插件:Adob
- 下一篇: 这款免费小工具,让你的Mac也能实现右键