使用hiblup计算基因频率和基因型频率

发布时间 2023-05-28 16:20:46作者: 小鲨鱼2018

 

001、测试数据

(base) [root@PC1 test]# ls           ## 测试数据, plink格式
outcome.map  outcome.ped
(base) [root@PC1 test]# cat outcome.map
1       snp1    0       55910
1       snp2    0       85204
1       snp3    0       122948
1       snp4    0       203750
1       snp5    0       312707
(base) [root@PC1 test]# cat outcome.ped
DOR     1       0       0       0       -9      T T     C C     A A     G G     A G
DOR     2       0       0       0       -9      T T     G C     G G     G G     G G
DOR     3       0       0       0       -9      G G     C C     G G     G G     G G
DOR     4       0       0       0       -9      G G     C C     G G     G G     G G
DOR     5       0       0       0       -9      G G     C C     G G     G G     G G
DOR     6       0       0       0       -9      G G     C C     G G     G G     G G
(base) [root@PC1 test]# plink --file outcome --make-bed --out outcome &> /dev/null
(base) [root@PC1 test]# ls                 ## 使用--make-bed转化为二进制
outcome.bed  outcome.fam  outcome.map    outcome.ped
outcome.bim  outcome.log  outcome.nosex

 

002、使用hiblup计算基因频率

(base) [root@PC1 test]# ls
outcome.bed  outcome.fam  outcome.map    outcome.ped
outcome.bim  outcome.log  outcome.nosex
(base) [root@PC1 test]# hiblup --bfile outcome --allele-freq --out test &> /dev/null
(base) [root@PC1 test]# ls                    ## 计算基因频率
outcome.bed  outcome.fam  outcome.map    outcome.ped  test.log
outcome.bim  outcome.log  outcome.nosex  test.afreq
(base) [root@PC1 test]# cat test.afreq       ## 计算结果
SNP     a1      a2      freq_a1
snp1    T       G       0.333333
snp2    G       C       0.0833333
snp3    A       G       0.166667
snp4    0       G       0
snp5    A       G       0.0833333
(base) [root@PC1 test]# cat outcome.ped
DOR     1       0       0       0       -9      T T     C C     A A     G G     A G
DOR     2       0       0       0       -9      T T     G C     G G     G G     G G
DOR     3       0       0       0       -9      G G     C C     G G     G G     G G
DOR     4       0       0       0       -9      G G     C C     G G     G G     G G
DOR     5       0       0       0       -9      G G     C C     G G     G G     G G
DOR     6       0       0       0       -9      G G     C C     G G     G G     G G

 

003、使用hiblup计算基因型频率

(base) [root@PC1 test]# ls
outcome.bed  outcome.fam  outcome.map    outcome.ped
outcome.bim  outcome.log  outcome.nosex
(base) [root@PC1 test]# hiblup --bfile outcome --geno-freq --out test &> /dev/null
(base) [root@PC1 test]# ls                      ## 计算基因型频率
outcome.bed  outcome.fam  outcome.map    outcome.ped  test.log
outcome.bim  outcome.log  outcome.nosex  test.gfreq
(base) [root@PC1 test]# cat test.gfreq          ## 计算结果
SNP     a1      a2      freq_a1a1       freq_a2a2
snp1    T       G       0.333333        0.666667
snp2    G       C       0       0.833333
snp3    A       G       0.166667        0.833333
snp4    0       G       0       1
snp5    A       G       0       0.833333
(base) [root@PC1 test]# cat outcome.ped
DOR     1       0       0       0       -9      T T     C C     A A     G G     A G
DOR     2       0       0       0       -9      T T     G C     G G     G G     G G
DOR     3       0       0       0       -9      G G     C C     G G     G G     G G
DOR     4       0       0       0       -9      G G     C C     G G     G G     G G
DOR     5       0       0       0       -9      G G     C C     G G     G G     G G
DOR     6       0       0       0       -9      G G     C C     G G     G G     G G

参考:https://mp.weixin.qq.com/s/YUyL1Bq0fDKojGHSLf0MkQ