1、下載、安裝 phylip軟件
官網: http://evolution.genetics.washington.edu/phylip.html
wget http://evolution.gs.washington.edu/phylip/download/phylip-3.697.tar.gz
tar -xzvf phylip-3.697.tar.gz
cd phylip-3.697/
cd src/
make -f Makefile.unx install
安裝成功的標志。
可執行程序在exe路徑下:
2、下載測試數據 ,提取一小部分進行測試:
鏈接:https://pan.baidu.com/s/1VxgJK5asCEjukOeA1V5rlg 提取碼:e69n
head -n 5 test.ped | cat - <(tail -n 5 test.ped) > a && mv a test.ped
3、參考 下面文章進行 構建進化樹 https://zhuanlan.zhihu.com/p/85978856
樣本ID必須是10個字符,這點很重要!!!使用如下命令修改:
##把間隔符改為tab plink --file test --recode tabx --sheep --out test;rm -f *.log *.nosex ##把個體ID調整為10個字符 awk '{print $2 "xxx000000000"}' test.ped |cut -b 1-10|paste - test.ped |awk '{OFS = "\t"}{print $2,$1,$0}'| cut -f 3-5 --complement > a && mv a test.ped ##轉化為vcf格式: plink --file test --sheep --recode vcf-iid --out test;rm -f *.log *.nosex
4、下載 vcf2phylip.py腳本,用於將vcf文件轉化為phylip軟件需要的格式:
下載地址:https://github.com/edgardomortiz/vcf2phylip/releases
wget https://github.com/edgardomortiz/vcf2phylip/archive/v2.0.zip unzip v2.0.zip cd vcf2phylip-2.0/
5、使用 vcf2phylip.py 將test.vcf轉化為phylip軟件需要的格式:
python /home/liujiaxin/software/vcf2phylip-2.0/vcf2phylip.py -i test.vcf
6、准備配置文件 ,參照 https://zhuanlan.zhihu.com/p/85978856:
a、seqboot.par , test.min4.phy是上一步vcf轉化格式生成的文件。 注意 test.min4.phy 后面不要加注釋,否則報錯!!!!
b、dnadist.par 注意:第一行不要加注釋!!!!!
c、neighbor.par 注意:第一行不要加注釋!!!!!
d、consense.par 注意:第一行不要加注釋!!!!!
看下 當前目錄:
7、運行以下程序:
/home/liujiaxin/software/phylip-3.697/exe/seqboot < ./seqboot.par && mv ./outfile ./seqboot.out /home/liujiaxin/software/phylip-3.697/exe/dnadist < ./dnadist.par && mv ./outfile ./dnadist.out /home/liujiaxin/software/phylip-3.697/exe/neighbor < ./neighbor.par && mv ./outfile ./nei.out && mv ./outtree ./nei.tree /home/liujiaxin/software/phylip-3.697/exe/consense < ./consense.par && mv ./outfile ./cons.out && mv ./outtree ./constree
8、看下當前目錄,constree為構建進化樹的文件
9、利用 itol繪圖、美化,官網:https://itol.embl.de/
10、繪圖 結果: