跟著Nature Genetics學(xué)數(shù)據(jù)分析~SNP數(shù)據(jù)計(jì)算距離矩陣然后構(gòu)建NJ樹

最近在看論文 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

按照軟件主頁的幫助文檔 下載安裝,沒有遇到問題

image.png
使用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

image.png

這個(gè)軟件的主頁還很貼心寫了如何利用距離矩陣構(gòu)建NJ樹的方法

為了省事就直接使用在線程序了

http://www.atgc-montpellier.fr/fastme/

image.png

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

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

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

image.png

簡單比較了一下,結(jié)果好像還差的挺多的

今天的內(nèi)容就先到這里了
歡迎大家關(guān)注我的公眾號
小明的數(shù)據(jù)分析筆記本

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

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

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