Phylophlan(二)種間進(jìn)化分析

導(dǎo)讀

上一篇:Phylophlan (一) 下載和安裝。使用Phylophlan自帶的測(cè)試數(shù)據(jù),32個(gè)細(xì)菌的蛋白序列數(shù)據(jù),存放在~nsegata-phylophlan/input/example_corynebacteria/文件夾中。使用蛋白數(shù)據(jù)分析這32個(gè)細(xì)菌在進(jìn)化樹(shù)上的位置關(guān)系。

一、輸入文件

cd ./input/example_corynebacteria/
ls -alh
# 查看文件,如下:

    -rw-r--r-- 1 cheng WST  993973 5月  31  2017 C_accolens_ATCC49725.faa
    -rw-r--r-- 1 cheng WST  960388 5月  31  2017 C_accolens_ATCC49726.faa
    -rw-r--r-- 1 cheng WST 1155110 5月  31  2017 C_ammoniagenes_DSM20306.faa
    -rw-r--r-- 1 cheng WST  950635 5月  31  2017 C_amycolatum_SK46.faa
    -rw-r--r-- 1 cheng WST 1122345 5月  31  2017 C_aurimucosum_ATCC700975.faa
    -rw-r--r-- 1 cheng WST 1004718 5月  31  2017 C_diphtheriae_NCTC13129.faa
    -rw-r--r-- 1 cheng WST 1269305 5月  31  2017 C_efficiens_YS314A.faa
    -rw-r--r-- 1 cheng WST 1297573 5月  31  2017 C_efficiens_YS314B.faa
    -rw-r--r-- 1 cheng WST  953468 5月  31  2017 C_genitalium_ATCC33030.faa
    -rw-r--r-- 1 cheng WST 1122917 5月  31  2017 C_glucuronolyticum_ATCC51866.faa
    -rw-r--r-- 1 cheng WST 1096676 5月  31  2017 C_glucuronolyticum_ATCC51867.faa
    -rw-r--r-- 1 cheng WST 1325630 5月  31  2017 C_glutamicum_ATCC13032B.faa
    -rw-r--r-- 1 cheng WST 1300615 5月  31  2017 C_glutamicum_ATCC13032K.faa
    -rw-r--r-- 1 cheng WST 1303860 5月  31  2017 C_glutamicum_R.faa
    -rw-r--r-- 1 cheng WST  985711 5月  31  2017 C_jeikeium_ATCC43734.faa
    -rw-r--r-- 1 cheng WST  945146 5月  31  2017 C_jeikeium_K411.faa
    -rw-r--r-- 1 cheng WST  941388 5月  31  2017 C_kroppenstedtii_DSM44385.faa
    -rw-r--r-- 1 cheng WST  988619 5月  31  2017 C_lipophiloflavum_DSM44291.faa
    -rw-r--r-- 1 cheng WST 1107897 5月  31  2017 C_matruchotii_ATCC14266.faa
    -rw-r--r-- 1 cheng WST 1256303 5月  31  2017 C_matruchotii_ATCC33806.faa
    -rw-r--r-- 1 cheng WST 1096831 5月  31  2017 C_pseudogenitalium_ATCC33035.faa
    -rw-r--r-- 1 cheng WST  879436 5月  31  2017 C_pseudotuberculosis_1002.faa
    -rw-r--r-- 1 cheng WST  882239 5月  31  2017 C_pseudotuberculosis_C231.faa
    -rw-r--r-- 1 cheng WST  894331 5月  31  2017 C_pseudotuberculosis_FRC41.faa
    -rw-r--r-- 1 cheng WST  880930 5月  31  2017 C_pseudotuberculosis_I19.faa
    -rw-r--r-- 1 cheng WST  969612 5月  31  2017 C_resistens_DSM45100.faa
    -rw-r--r-- 1 cheng WST 1124033 5月  31  2017 C_striatum_ATCC6940.faa
    -rw-r--r-- 1 cheng WST  975616 5月  31  2017 C_tuberculostearicum_SK141.faa
    -rw-r--r-- 1 cheng WST  928565 5月  31  2017 C_urealyticum_DSM7109.faa
    -rw-r--r-- 1 cheng WST 1288346 5月  31  2017 C_variabile_DSM44702.faa
    -rw-r--r-- 1 cheng WST 2447456 5月  31  2017 Streptomyces_outgroup1.faa
    -rw-r--r-- 1 cheng WST 3077788 5月  31  2017 Streptomyces_outgroup2.faa

cd ../../
# 回到phylophlan.py主程序路徑

time phylophlan.py -u example_corynebacteria --nproc 16
# de novo系統(tǒng)發(fā)生/進(jìn)化分析
# -u:使用用戶提供的基因組數(shù)據(jù)構(gòu)建系統(tǒng)發(fā)生樹(shù)(進(jìn)化樹(shù))

cd ./output/example_corynebacteria
ls -alh
# 得到兩種格式的樹(shù)文件,如下:

    -rw-rw-r-- 1 cheng WST  1437 10月  8 20:19 example_corynebacteria.tree.nwk
    -rw-rw-r-- 1 cheng WST 10746 10月  8 20:19 example_corynebacteria.tree.reroot.xml

二、ggtree畫(huà)進(jìn)化樹(shù)

在linux系統(tǒng)中進(jìn)入R,以example_corynebacteria為R工作環(huán)境。

cd ./output/example_corynebacteria
R

開(kāi)始使用R進(jìn)行繪圖。
繪圖代碼參考原文:PhyloPhlAn

dir() # 查看工作目錄
[1] "example_corynebacteria.tree.nwk"       
[2] "example_corynebacteria.tree.reroot.xml"

library(ggplot2) # 加載ggplot2
library(ggtree) # 加載ggtree
tree=read.tree("example_corynebacteria.tree.nwk") # 讀取nwk文件
data=fortify(tree)

tregraph=ggtree(tree, layout="rectangular", size=0.8, col="deepskyblue3") +
  # 樹(shù)體:樹(shù)文件、樹(shù)形、粗細(xì)、顏色
  geom_tiplab(size=3, color="purple4", hjust=-0.05) +
  # 枝名:大小、顏色、高度
  geom_tippoint(size=1.5, color="deepskyblue3") +
  # 端點(diǎn):大小、顏色
  geom_nodepoint(color="orange", alpha=1/4, size=2) +
  # 末節(jié)點(diǎn):顏色、透明度、大小
  theme_tree2() +
  # x軸標(biāo)尺
  xlim(NA, max(data$x)*1.3)
  # x軸寬度
  
pdf("tregraph.pdf")
tregraph
dev.off()

打開(kāi)tregraph.pdf查看結(jié)果,如下:

圖片.png

\color{green}{????原創(chuàng)文章,碼字不易,轉(zhuǎn)載請(qǐng)注明出處????}

最后編輯于
?著作權(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)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

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

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