这里有一份群体的学习课程,这篇推送主要基于这个作为参考,
群体课程
Fst值
以下例子来自于:Fst值
Fst值
在群体里面Fst是衡量种群分化程度,取值从0到1,为0则认为两个种群间是随机交配的,基因型完全相似;为1则表示是完全隔离的,完全不相似

1计算各等位基因的频率
对于某一个基因的等位基因(位点)来说,分别统计各物种AA,Aa和aa的数量,然后计算各等位基因的频率

分别计算p1和q1的基因频率
2利用哈温平衡二项式预测基因型频率期望

然后可以利用期望和实际做对比
3计算每个亚群实际观察到的杂合度

4计算每个亚群实际杂合度的期望
根据公式:


5计算每个亚群的近交系数
利用卡方测验的思想,我们有:


6在全基因组范围计算基因频率

7计算三种杂合性指数

8计算Fst值
接下来就直接计算相应的值即可

Fst值如图所求
计算Fst值的软件
一般首推vcftools,我们根据两个亚种的vcf文件进行比较:
##对每一个SNP变异位点进行计算
vcftools --vcf test.vcf --weir-fst-pop 1_population.txt --weir-fst-pop 2_population.txt --out p_1_2—single
##按照区域来计算
vcftools --vcf test.vcf --weir-fst-pop 1_population.txt --weir-fst-pop 2_population.txt --out p_1_2_bin --fst-window-size 500000 --fst-window-step 50000
# test.vcf是SNP calling 过滤后生成的vcf 文件;
# p_1_2_3 生成结果的prefix
# 1_population.txt是一个文件包含同一个群体中所有个体,一般每行一个个体。个体名字要和vcf的名字对应。
# 2_population.txt 包含了群体二中所有个体。
#计算的窗口是500kb,而步长是50kb (根据你的需其可以作出调整)。我们也可以只计算每个点的Fst,去掉参数(--fst-window-size 500000 --fst-window-step 50000)即可。
代码参考:Fst的计算原理与实战
如果是按区间计算的,那么它以你定义的滑动窗口为单位,计算这个窗口内的平均Fst值
输出结果为:

那么此时的Fst值(最后一列)代表一个窗口内的平均Fst值
参考:
http://wap.sciencenet.cn/blog-1094241-1104923.html?mobile=1
网友评论