• plink软件计算位点杂合度和样本杂合度


    杂合度计算分为两种:位点杂合度和样本杂合度

    1、计算位点杂合度,测试数据如下:

    [root@centos79 test]# ls
    outcome.map  outcome.ped
    [root@centos79 test]# cat outcome.map   ## 8个snp位点
    1       snp1    0       55910
    1       snp2    0       85204
    1       snp3    0       122948
    1       snp4    0       203750
    1       snp5    0       312707
    1       snp6    0       356863
    1       snp7    0       400518
    1       snp8    0       487423
    [root@centos79 test]# cat outcome.ped    ## 8个样本
    DOR     1       0       0       0       -9      G G     C C     G G     G G     G A     A A     G G     G C
    DOR     2       0       0       0       -9      G G     G C     G G     G G     G G     A A     A G     C C
    DOR     3       0       0       0       -9      G G     C C     G G     G G     G G     A A     A G     G C
    DOR     4       0       0       0       -9      G G     C C     G G     G G     G G     A A     G G     G G
    DOR     5       0       0       0       -9      G G     C C     G G     G G     G G     A A     A G     G C
    DOR     6       0       0       0       -9      G G     C C     G G     G G     G G     A A     A A     C C
    DOR     7       0       0       0       -9      G G     C C     G G     A G     A A     A A     G G     C C
    DOR     9       0       0       0       -9      G G     C C     G G     A G     A A     A A     G G     C C

    2、--hardy计算位点杂合度

    [root@centos79 test]# plink --file outcome --hardy --out sitehet &> /dev/zero
    [root@centos79 test]# ls
    outcome.map  outcome.ped  sitehet.hwe  sitehet.log  sitehet.nosex   ## 结果文件
    [root@centos79 test]# cat sitehet.hwe
     CHR  SNP     TEST   A1   A2                 GENO   O(HET)   E(HET)            P   ## o(HET)为观测杂合度百分率,利于第一个位点0,全部是G
       1 snp1  ALL(NP)    0    G                0/0/8        0        0            1
       1 snp2  ALL(NP)    G    C                0/1/7    0.125   0.1172            1
       1 snp3  ALL(NP)    0    G                0/0/8        0        0            1
       1 snp4  ALL(NP)    A    G                0/2/6     0.25   0.2188            1
       1 snp5  ALL(NP)    A    G                2/1/5    0.125   0.4297      0.07692
       1 snp6  ALL(NP)    0    A                0/0/8        0        0            1
       1 snp7  ALL(NP)    A    G                1/3/4    0.375   0.4297            1
       1 snp8  ALL(NP)    G    C                1/3/4    0.375   0.4297            1
    [root@centos79 test]# cat outcome.ped
    DOR     1       0       0       0       -9      G G     C C     G G     G G     G A     A A     G G     G C
    DOR     2       0       0       0       -9      G G     G C     G G     G G     G G     A A     A G     C C
    DOR     3       0       0       0       -9      G G     C C     G G     G G     G G     A A     A G     G C
    DOR     4       0       0       0       -9      G G     C C     G G     G G     G G     A A     G G     G G
    DOR     5       0       0       0       -9      G G     C C     G G     G G     G G     A A     A G     G C
    DOR     6       0       0       0       -9      G G     C C     G G     G G     G G     A A     A A     C C
    DOR     7       0       0       0       -9      G G     C C     G G     A G     A A     A A     G G     C C
    DOR     9       0       0       0       -9      G G     C C     G G     A G     A A     A A     G G     C C

    2、--het 计算样本杂合度

    首先要剔除没有多态的位点:

    [root@centos79 test]# ls
    outcome.map  outcome.ped
    [root@centos79 test]# plink --file outcome --maf 0.0000001 --recode tab --out test &> /dev/null   ## 利用plink的--maf参数剔除没有多态的位点
    [root@centos79 test]# ls
    outcome.map  outcome.ped  test.log  test.map  test.nosex  test.ped
    [root@centos79 test]# cat test.ped   ## 剩余5个位点
    DOR     1       0       0       0       -9      C C     G G     A G     G G     G C
    DOR     2       0       0       0       -9      G C     G G     G G     A G     C C
    DOR     3       0       0       0       -9      C C     G G     G G     A G     G C
    DOR     4       0       0       0       -9      C C     G G     G G     G G     G G
    DOR     5       0       0       0       -9      C C     G G     G G     A G     G C
    DOR     6       0       0       0       -9      C C     G G     G G     A A     C C
    DOR     7       0       0       0       -9      C C     A G     A A     G G     C C
    DOR     9       0       0       0       -9      C C     A G     A A     G G     C C
    [root@centos79 test]# plink --file test --het --out indhet &> /dev/null   ## 计算样本杂合度
    [root@centos79 test]# ls   
    indhet.het  indhet.log  indhet.nosex  outcome.map  outcome.ped  test.log  test.map  test.nosex  test.ped
    [root@centos79 test]# cat indhet.het
     FID  IID       O(HOM)       E(HOM)        N(NM)            F     ## 0(HOM)为观测的纯合子数目,N是总的位点数杂合度为 (O-N)/N
     DOR    1            3        3.375            5      -0.2308     ## 比如第一个样本三个纯合子,那么杂合子5-3=2;杂合度 (5-3)/ 5 = 0.4
     DOR    2            3        3.375            5      -0.2308
     DOR    3            3        3.375            5      -0.2308
     DOR    4            5        3.375            5            1
     DOR    5            3        3.375            5      -0.2308
     DOR    6            5        3.375            5            1
     DOR    7            4        3.375            5       0.3846
     DOR    9            4        3.375            5       0.3846

  • 相关阅读:
    2017.11.10 MPLAB IPE + ICD-3+ PIC32MM
    How to Have a Healthy Relationship --shanbei 为单身节写
    New Concept English three (35)
    PyQt(Python+Qt)学习随笔:Qt Designer中主窗口对象的dockOptions属性
    PyQt(Python+Qt)学习随笔:Qt Designer中主窗口对象unifiedTitleAndToolBarOnMac属性
    PyQt(Python+Qt)学习随笔:Qt Designer中主窗口对象dockNestingEnabled属性
    PyQt(Python+Qt)学习随笔:Qt Designer中主窗口对象的tabShape属性
    PyQt(Python+Qt)学习随笔:Qt Designer中主窗口对象documentMode属性
    PyQt(Python+Qt)学习随笔:Qt Designer中主窗口对象的toolButtonStyle属性
    PyQt(Python+Qt)学习随笔:Qt Designer中主窗口对象的animated属性
  • 原文地址:https://www.cnblogs.com/liujiaxin2018/p/14985749.html
Copyright © 2020-2023  润新知