利用phylip软件对SNP数据构建进化树

自古美人都是妖i 提交于 2020-08-17 12:40:54

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、绘图 结果:

      

 

 

     

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!