利用phylip软件对SNP数据构建进化树
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、绘图 结果:
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了