最近在看論文 Phased diploid genome assemblies and pan-genomes provide insights into the genetic history of apple domestication(高水平論文看起來還真是吃力!)看懂一點(diǎn)記一點(diǎn)吧。今天的筆記記錄的是SNP數(shù)據(jù)計(jì)算距離矩陣,然后用距離矩陣構(gòu)建進(jìn)化樹的過程。論文原文的方法部分寫到:
A neighbor-joining phylogeny was constructed based on the P distance matrix calculated by VCF2Dis
這篇論文提供了vcf格式的SNP數(shù)據(jù)下載鏈接
Genome assemblies and annotated genes, nonreference genome sequences and annotated genes of the apple pan-genomes, and SNPs and SVs called from the genome resequencing data are also freely available at http://bioinfo.bti.cornell.edu/apple_genome.
那接下來我們就可以試一下了
首先是下載數(shù)據(jù)
wget ftp://bioinfo.bti.cornell.edu/pub/Apple_genome/variome/SNP.vcf.gz
這個(gè)數(shù)據(jù)集稍微有點(diǎn)大
接下來是計(jì)算距離矩陣
用到的工具是 VCF2Dis
工具對應(yīng)的github主頁
https://github.com/BGI-shenzhen/VCF2Dis
按照軟件主頁的幫助文檔 下載安裝,沒有遇到問題

使用VCF2Dis這個(gè)軟件計(jì)算距離矩陣
軟件用起來也很簡單,直接指定vcf格式的文件,壓縮文件也可以
./VCF2Dis-1.43/bin/VCF2Dis -InPut SNP.vcf.gz -OutPut p_dis.mat
運(yùn)行過程順利,沒有遇到報(bào)錯(cuò)
得到距離矩陣文件 p_dis.mat

這個(gè)軟件的主頁還很貼心寫了如何利用距離矩陣構(gòu)建NJ樹的方法
為了省事就直接使用在線程序了
http://www.atgc-montpellier.fr/fastme/

很快就得到了結(jié)果

最后是用ggtree展示進(jìn)化樹
library(ggtree)
library(treeio)
tree<-read.newick("p_dis_mat_fastme-tree.nwk")
ggtree(tree,layout = "ape")+
geom_tiplab(size=2)

已經(jīng)很接近論文里的結(jié)果了,接下來應(yīng)該好好想想如何美化了

簡單比較了一下,結(jié)果好像還差的挺多的
今天的內(nèi)容就先到這里了
歡迎大家關(guān)注我的公眾號
小明的數(shù)據(jù)分析筆記本