其實(shí)MCScan畫圖也可以很好看

最近發(fā)現(xiàn)了python版的MCScan,是個(gè)大寶藏。由于走了不少?gòu)澛?,終于畫出美圖,趕緊記錄下來

github地址 https://github.com/tanghaibao/jcvi/wiki/MCscan-(Python-version)

1、軟件安裝

需要安裝LASTAL和jcvi python包

sudo apt install last-align
pip install jcvi

2、輸入數(shù)據(jù)

輸入數(shù)據(jù)只有兩類cds和bed文件
可以自動(dòng)從phytozome,這點(diǎn)十分方便

$ python -m jcvi.apps.fetch phytozome
...
         Acoerulea               Alyrata             Athaliana
       Bdistachyon                 Brapa           Cclementina
           Cpapaya          Creinhardtii              Crubella
          Csativus             Csinensis Csubellipsoidea_C-169
          Egrandis                Fvesca                  Gmax
        Graimondii        Lusitatissimum            Mdomestica
        Mesculenta             Mguttatus     Mpusilla_CCMP1545
   Mpusilla_RCC299           Mtruncatula          Olucimarinus
           Osativa               Ppatens              Ppersica
      Ptrichocarpa             Pvirgatum             Pvulgaris
         Rcommunis              Sbicolor              Sitalica
     Slycopersicum       Smoellendorffii            Stuberosum
            Tcacao            Thalophila              Vcarteri
         Vvinifera                 Zmays         early_release

以水稻和擬南芥為例

$ python -m jcvi.apps.fetch phytozome Osativa,Athaliana
$ ls
Athaliana_167_cds.fa.gz  Athaliana_167_gene.gff3.gz Osativa_204_cds.fa.gz  Osativa_204_gene.gff3.gz

其中g(shù)ff3文件不需要解壓 一鍵轉(zhuǎn)換成bed格式

python -m jcvi.formats.gff bed --type=mRNA --key=Name Osativa_204_gene.gff3.gz -o osa.bed

cds解壓后需要去掉|分隔符 b并要修改id 以基因而不是轉(zhuǎn)錄本命名

$ gunzip Athaliana_167_cds.fa.gz
$ mv Athaliana_167_cds.fa ath.cds
$ sed 's/\.*$//g' -i ath.cds  #也可以這么做 python -m jcvi.formats.fasta format --sep="|" Athaliana_167_cds.fa.gz  ath.cds
$ sed 's/\.//g' -i ath.cds 

如果是其他物種或者自己組裝的基因組數(shù)據(jù),記得基因id需要遵循在染色體上的位置從大到小排序的命名原則,否則軟件會(huì)在gff3轉(zhuǎn)bed的時(shí)候自動(dòng)命名,務(wù)必要和cds里的id對(duì)應(yīng)。

3、Pairwise synteny 分析

$ python -m jcvi.compara.catalog ortholog osa ath

分析過程很快,結(jié)果包括.anchors文件,點(diǎn)陣圖,如果遇到報(bào)錯(cuò),多半是要安裝python包,更新Latex。結(jié)果文件的含義“The .last file is raw LAST output, .last.filtered is filtered LAST output, .anchors is the seed synteny blocks (high quality), .lifted.anchors recruits additional anchors to form the final synteny blocks.”

$ ls osa.ath.*
osa.ath.lifted.anchors  osa.ath.anchors  osa.ath.last.filtered  osa.ath.last

4、可視化

重頭戲來了

a 共線性圖

首先生成.simple文件

python -m jcvi.compara.synteny screen --minspan=30 --simple osa.ath.anchors osa.ath.anchors.new

再編輯兩個(gè)配置文件seqids和layout

$ vi seqids #設(shè)置需要展示等染色體號(hào) 
Chr1,Chr2,Chr3,Chr4,Chr5,Chr6,Chr7,Chr8,Chr9,Chr10,Chr11,Chr12 #osa
Chr1,Chr2,Chr3,Chr4,Chr5,Chr6,Chr7,Chr8,Chr9,Chr10,Chr11,Chr12 #ath

$ vi layout #設(shè)置顏色、長(zhǎng)寬等
# y, xstart, xend, rotation, color, label, va,  bed
 .6,     .1,    .8,       0,      , Osa, top, osa.bed
 .4,     .1,    .8,       0,      , Ath, top, ath.bed
# edges
e, 0, 1, osa.ath.anchors.simple

接下來就是見證奇跡的時(shí)刻


還有許多高能操作,大家可以試試
真好看

突出顯示

$ vi XXX.XXXanchors.simple 
g*GSVIVT01012028001 GSVIVT01000604001   ppa011886m  ppa008534m  392 +
GSVIVT01010441001   GSVIVT01000970001   ppa022891m  ppa001358m  115 -
GSVIVT01000555001   GSVIVT01003228001   ppa002809m  ppa010569m  359 +
...
$ python -m jcvi.graphics.karyotype seqids layout
突出顯示.png
$ vi layout
# y, xstart, xend, rotation, color, label, va,  bed
 .7,     .1,    .8,      15,      , Grape, top, grape.bed
 .5,     .1,    .8,       0,      , Peach, top, peach.bed
 .3,     .1,    .8,     -15,      , Cacao, bottom, cacao.bed
# edges
e, 0, 1, grape.peach.anchors.simple
e, 1, 2, peach.cacao.anchors.simple

$ vi seqids
chr1,chr2,chr3,chr4,chr5,chr6,chr7,chr8,chr9,chr10,chr11,chr12,chr13,chr14,chr15,chr16,chr17,chr18,chr19
scaffold_1,scaffold_2,scaffold_3,scaffold_4,scaffold_5,scaffold_6,scaffold_7,scaffold_8
scaffold_1,scaffold_2,scaffold_3,scaffold_4,scaffold_5,scaffold_6,scaffold_7,scaffold_8,scaffold_9,scaffold_10r

$ python -m jcvi.graphics.karyotype seqids layout
扇形.png
局部展示.png
多物種單個(gè)block展示.png

b dotplot

親測(cè)點(diǎn)陣圖是自動(dòng)出來的,當(dāng)然也可以用命令行

$ python -m jcvi.graphics.dotplot osa.ath.anchors
還是很漂亮的

可以看到水稻和擬南芥基因組的syntenic很差,github示例里葡萄和桃子的syntenic regions不錯(cuò),可以推斷出一些染色體genome triplication事件

查看synteny depth分布

python -m jcvi.compara.synteny depth --histogram osa.ath.anchors
osa.ath.depth.pdf

anyway,先介紹到這里啦

更多請(qǐng)參考
基因組共線性工具M(jìn)CScanX使用說明
基因組間共線性分析想學(xué)嗎?
無限個(gè)!物種共線性分析結(jié)果可視化

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 基因組組裝完成后,或者是完成了草圖,就不可避免遇到一個(gè)問題,需要對(duì)基因組序列進(jìn)行注釋。注釋之前首先得構(gòu)建基因模型,...
    xuzhougeng閱讀 52,929評(píng)論 14 185
  • 這個(gè)故事仿佛已經(jīng)過去很久,仿佛仍然還在繼續(xù)。就像你若相信這世間的美好,就能夠看見彩虹;你若信仰心有靈犀的感情,那么...
    心中的藍(lán)蓮花閱讀 800評(píng)論 0 0
  • 2017,親愛的媽咪59歲。最近一次與她出境旅行在2014年,三年前的巴厘島假期一直讓她念念不忘。 我尋思著今年也...
    穎穎潛行閱讀 473評(píng)論 1 3
  • 一、我的障礙 1、人際關(guān)系中的障礙 我很難走近權(quán)威,害怕與強(qiáng)人接觸,在他們身上會(huì)照見我的不堪和失敗。 我很難接受與...
    上善若水澤萬物閱讀 761評(píng)論 0 1

友情鏈接更多精彩內(nèi)容