【比較基因組】共線性分析(JCVI)

比較基因組學(xué)中,共線性的分析的圖無疑是很漂亮的。

共線性分析可以很好地解釋進(jìn)化關(guān)系和多倍化事件。上一篇介紹了怎么利用MCScanX來做共線性分析,雖然后面有java的包來支持后續(xù)的畫圖和分析,總覺得不是很適合來調(diào)整圖片的美觀程度。今天主要測(cè)試的是Python版McScan(jcvi工具包),這個(gè)包很強(qiáng)大,是從MCScanx升級(jí)而來的基因組共線性分析軟件。

===安裝===

conda create -y -c bioconda -c conda-forge -n jcvi jcvi? ?//為了怕依賴包沖突,新建了一個(gè)jcvi的環(huán)境

source activate jcvi

pip install git+git://github.com/tanghaibao/jcvi.git

或者 pip install jcvi

然后,安裝額外的依賴環(huán)境:Kent tools,BEDTOOLS,EMBOSS,LAST,LaTex。

其中,BEDTOOLS, EMBOSS和LAST可以用conda來安裝。

conda install -y -n jcvi -c bioconda bedtools emboss last

pip install latex

Kent自己編譯一下

wget http://hgdownload.cse.ucsc.edu/admin/jksrc.zip

unzip?jksrc.zip

cd kent/src/lib

make

===測(cè)試數(shù)據(jù)===

下載擬南芥和水稻的數(shù)據(jù)

#A thaliana

wget ftp://ftp.ensemblgenomes.org/pub/plants/release-44/fasta/arabidopsis_thaliana/cdna/Arabidopsis_thaliana.TAIR10.cdna.all.fa.gz

wgetftp://ftp.ensemblgenomes.org/pub/plants/release-44/fasta/arabidopsis_thaliana/pep/Arabidopsis_thaliana.TAIR10.pep.all.fa.gz

wget ftp://ftp.ensemblgenomes.org/pub/plants/release-44/gff3/arabidopsis_thaliana/Arabidopsis_thaliana.TAIR10.44.gff3.gz

#O sativa

wgetftp://ftp.ensemblgenomes.org/pub/plants/release-44/fasta/oryza_sativa/cdna/Oryza_sativa.IRGSP-1.0.cdna.all.fa.gz

wgetftp://ftp.ensemblgenomes.org/pub/plants/release-44/fasta/oryza_sativa/pep/Oryza_sativa.IRGSP-1.0.pep.all.fa.gz

wgetftp://ftp.ensemblgenomes.org/pub/plants/release-44/gff3/oryza_sativa/Oryza_sativa.IRGSP-1.0.44.gff3.gz

# convert gff to bed

python -m jcvi.formats.gff bed --type=mRNA--key=transcript_id Arabidopsis_thaliana.TAIR10.44.gff3.gz > ath.bed

python -m jcvi.formats.gff bed --type=mRNA--key=transcript_id Oryza_sativa.IRGSP-1.0.44.gff3.gz > osa.bed

# deduplication

python -m jcvi.formats.bed uniq ath.bed

python -m jcvi.formats.bed uniq osa.bed

seqkit grep -f <(cut -f 4 ath.uniq.bed )Arabidopsis_thaliana.TAIR10.cdna.all.fa.gz | seqkit seq -i > ath.cds

seqkit grep -f <(cut -f 4 ath.uniq.bed )Arabidopsis_thaliana.TAIR10.pep.all.fa.gz | seqkit seq -i > ath.pep

seqkit grep -f <(cut -f 4 osa.uniq.bed)? Oryza_sativa.IRGSP-1.0.cdna.all.fa.gz| seqkit seq -i? > osa.cds

seqkit grep -f <(cut -f 4 osa.uniq.bed )Oryza_sativa.IRGSP-1.0.pep.all.fa.gz | seqkit seq -i? > osa.pep

mkdir -p cds && cd cds

ln -s ../ath.cds ath.cds

ln -s ../ath.uniq.bed ath.bed

ln -s ../osa.cds osa.cds

ln -s ../osa.uniq.bed osa.bed

# compara

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

生成的結(jié)果文件如下圖所示:

pdf里面的點(diǎn)陣信息如下圖所示,基本沒什么共線性。

換蛋白的試下:

python -m jcvi.compara.catalog ortholog --dbtype prot --no_strip_names ath osa

它生成的文件里除了PDF里面的點(diǎn)陣圖之外,還有:

?ath.osa.last: 基于LAST的比對(duì)結(jié)果

ath.osa.last.filtered: LAST的比對(duì)結(jié)果過濾串聯(lián)重復(fù)和低分比對(duì)

ath.osa.anchors: 高質(zhì)量的共線性區(qū)塊

ath.osa.lifted.anchors:增加了額外的錨點(diǎn),形成最終的共線性區(qū)塊

用水稻和擬南芥進(jìn)行了比較之后,發(fā)現(xiàn)后面基本上也沒啥可以分析了。所以我們換個(gè)和擬南芥一個(gè)種的例子來看,A.lyrata。

python -m jcvi.compara.catalog ortholog --no_strip_names ath aly

我們可以發(fā)現(xiàn),都作為Arabidopsis屬的兩個(gè)物種,他們之間存在很高的同源性,點(diǎn)陣圖也是非常好看的。

并且同源區(qū)比例是1:1。

看下別人paper中的效果(2011年的Nature Genetics上A.lyrata):

用JCVI的畫圖模塊實(shí)現(xiàn)這種效果,只不過還需要一些其它文件,創(chuàng)建如下三個(gè)文件?

seqids: 需要展現(xiàn)哪些序列

layout: 不同物種的在圖上的位置

.simple: 從.anchors文件創(chuàng)建的更簡(jiǎn)化格式

創(chuàng)建simple文件

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

創(chuàng)建seqid文件,非常簡(jiǎn)單,就是需要展示的scaffold或染色體的編號(hào)。

創(chuàng)建layout文件,用于設(shè)置繪制的一些選項(xiàng)。

最后運(yùn)行下面的命令,會(huì)得到一個(gè)karyotype.pdf

python -m jcvi.graphics.karyotype seqid.txt layout.txt

===測(cè)試多個(gè)物種的數(shù)據(jù)===

下載三個(gè)物種的數(shù)據(jù):

python -m jcvi.apps.fetch phytozome Vvinifera,Ppersica,Tcacao

python -m jcvi.formats.gff bed --type=mRNA --key=Name Vvinifera_145_Genoscope.12X.gene.gff3.gz -o grape.bed

python -m jcvi.formats.gff bed --type=mRNA --key=Name Ppersica_298_v2.1.gene.gff3.gz -o peach.bed

python -m jcvi.formats.gff bed --type=mRNA --key=Name Tcacao_523_v2.1.gene.gff3.gz -o cacao.bed

python -m jcvi.formats.fasta format Vvinifera_145_Genoscope.12X.cds.fa.gz grape.cds

python -m jcvi.formats.fasta format Ppersica_298_v2.1.cds.fa.gz peach.cds

python -m jcvi.formats.fasta format Tcacao_523_v2.1.cds.fa.gz cacao.cds

python -m jcvi.compara.catalog ortholog grape peach --cscore=.99 --no_strip_names

python -m jcvi.compara.catalog ortholog peach cacao --cscore=.99 --no_strip_names

python -m jcvi.compara.synteny screen--minspan=30 --simple grape.peach.anchors ?grape.peach.anchors.new

python -m jcvi.compara.synteny screen--minspan=30 --simple peach.cacao.anchors peach.cacao.anchors.new

python -m jcvi.graphics.karyotype seqids layout

我們?cè)趤砜磍ayout文件。第一列,二列,三列控制的是track的位置。rotation是方向,color是顏色,label是標(biāo)簽。va是vertical alignment。

所以修改配置,是可以控制每個(gè)track的位置的。

這樣就可以三角性狀顯示。

然后如果想highlight其中的某個(gè)line,可以修改anthor.simple文件:

前面加了r*(r是紅色,g是綠色等)。

其中還有一些參數(shù),例如--shadestyle=line(共線性區(qū)域是用曲線還是線),font是字體,--diverge是track色系的調(diào)整,等等。

總之,一個(gè)好看的圖要不斷的進(jìn)行調(diào)整。

本文使用 文章同步助手 同步

?著作權(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)容

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