Phylogenomic-Tutorial-SpeciesTree-with-SNP

[TOC]

Preparation

Softwares:

  • PAUP: 利用SVDQuatets的包计算SNP-based phylogeny
  • bcftools
  • vcftools
  • Figtree

Datasets: 数据来源于Lake Tanganyika cichlid fishes大类群中的各个species,每个species两个体,总共28个samples,来自于14个物种;以Oreochromis niloticus为参考基因组,作GATK call SNP;数据已进行过滤,只保留chr5上的snp。

SNP过滤

  • 对14物种的28个体的SNP数据进行过滤,对于SVDQuartets来说需要排除可能的杂交物种,因其对multi-species-coalescent model的推断可能会有问题。此部分较基础,略读。
1
2
3
4
5
6
7
8
9
10
11
## bcftools 相关;见相关教程。http://www.htslib.org/doc/bcftools.html
bcftools view -s ^LJC9,LJD1 -O z -o NC_031969.f5.sub2.vcf.gz NC_031969.f5.sub1.vcf.gz

## 查看有多少SNP 树
bcftools view -H NC_031969.f5.sub2.vcf.gz | wc -l

## no alternative alleles, proportion of missing data is greater than 20%, only bi-allelic SNPs 
bcftools view -e 'AC==0 || AC==AN || F_MISSING > 0.2' -m2 -M2 -O z -o NC_031969.f5.sub3.vcf.gz NC_031969.f5.sub2.vcf.gz

## 利用vcftools对一段距离内只保留1个snp
vcftools --gzvcf NC_031969.f5.sub3.vcf.gz --thin 100 --recode --out NC_031969.f5.sub4

利用SVDQuartets计算物种树

  • SVDQuartets是利用 multi-species-coalescent模型根据SNP数据计算物种树拓扑结构的工具。计算较为迅速。但缺点是只能生成拓扑结构,支长信息不能展示。
1
2
## 转换vcf为nexus格式,注意很多杂合nucl会以兼并nucl形式。
ruby convert_vcf_to_nexus.rb NC_031969.f5.sub4.vcf NC_031969.f5.sub4.nex
  • 利用PAUP软件打开nexus文件,DATA中选定外类群,Analysis中SVDQuartets计算SVDQ值,数据量较大情况,可随机挑选一定数量作计算。Ambiguities选Distribute便会计算兼并的碱基。


结果会显示出拓扑结构。

  • 指定样本个体来源的物种,按照物种级别去构建物种树。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 按照物种划分样本taxpartitions.txt
BEGIN SETS;
TAXPARTITION SPECIES =
astbur: 1-2,
altfas: 3-4,
telvit: 5-6,
neobri: 7-8,
neochi: 9-10,
neocra: 11-12,
neogra: 13-14,
neohel: 15-16,
neomar: 17-18,
neooli: 19-20,
neopul: 21-22,
neosav: 23-24,
neowal: 25-26;
END;
## 合并保存为新的指定物种的nexus文件
cat NC_031969.f5.sub4.nex taxpartitions.txt > NC_031969.f5.sub4.parts.nex
  • 在同样的SVDQuartets里设置TAXA species,Bootstrap值;threads值。

    结果会显示:

再通过Trees 的”Save Trees to File…” in PAUP*’s “Trees” more settings里的As internal node labels。即可保存为带有支持率的newick树文件,可为Figtree所用。

Reference

https://github.com/mmatschiner/tutorials/blob/master/species_tree_inference_with_snp_data/README.md

文章目录
  1. 1. Preparation
  2. 2. SNP过滤
  3. 3. 利用SVDQuartets计算物种树
  4. 4. Reference
|