位点频谱(site frequency sperum)是使用遗传数据进行群体历史研究的基础数据,easySFS.py
将可以将划分好群体的snp.vcf
文件转换为SFS
,该脚本输出可适用于fastsimcoal2和
∂
a
∂
i
\partial a\partial i
∂a∂i两个进行群体历史研究的主流方法。
1 获取投影值
easySFS.py
以投影的方式构建数据矩阵,在构建SFS时,我们需要给参数-proj
提供投影参数值,因此我们需要先使用--preview
功能获得(投影值,独立位点)列表,从而选取合适的投影值。
python easySFS.py -i example_files\sims.vcf -p example_files\sims_pops.txt --preview
输出如下:
Processing 3 populations - ['pop1', 'pop2', 'pop3']
Sampling one snp per locus (CHROM)
Running preview mode. We will print out the results for # of segregating sites
for multiple values of projecting down for each population. The dadi
manual recommends maximizing the # of seg sites for projections, but also
a balance must be struck between # of seg sites and sample size.
For each population you should choose the value of the projection that looks
best and then rerun easySFS with the `--proj` flag.
pop1
(2, 110) (3, 165) (4, 204) (5, 234) (6, 258) (7, 274) (8, 288)
pop2
(2, 117) (3, 175) (4, 218) (5, 252) (6, 280) (7, 302) (8, 319)
pop3
(2, 107) (3, 161) (4, 200) (5, 232) (6, 259) (7, 277) (8, 294)
“……recommends maximizing the # of seg sites for projections……”,一般情况下,选择对应独立位点数最多的投影值,即--proj 8,8,8
。
1 计算SFS
python easySFS.py -i example_files\sims.vcf -p example_files\sims_pops.txt --proj 8,8,8
输出文件包含两大类:
∂
a
∂
i
\partial a\partial i
∂a∂i:
pop1-8.sfs
、pop2-8.sfs
、pop3-8.sfs
:1-
d
d
d 的SFS,samples_size = 8;
pop1-pop2.sfs
、pop1-pop2-pop3.sfs
、……:2-
d
d
d、3-
d
d
d的SFS。
fastsimcoal2:
pop1_MAFpop0.obs
、……:1-
d
d
d 的SFS;
sims_jointMAFpop1_0.obs
、sims_MSFS.obs
、……: 2-
d
d
d、3-
d
d
d的SFS。