ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

GWAS分析 一般线性模型GLM中meta、se、T、p值的计算

2022-07-27 01:32:34  阅读:168  来源: 互联网

标签:541 GWAS GLM PC1 gwas meta test home plink


 

001、plink

root@PC1:/home/test# ls
gwas_test.map  gwas_test.ped
root@PC1:/home/test# plink --file gwas_test --assoc 1> /dev/null
root@PC1:/home/test# ls
gwas_test.map  gwas_test.ped  plink.log  plink.qassoc
root@PC1:/home/test# head plink.qassoc
 CHR        SNP         BP    NMISS       BETA         SE         R2        T            P
   1       snp1       2802      541     -8.911      8.344   0.002111   -1.068        0.286
   1       snp2       2823      541      7.754      10.04   0.001104    0.772       0.4405
   1       snp3       4512      541      9.264      9.814    0.00165   0.9439       0.3456
   1       snp4      16529      541     -18.49      10.81   0.005401   -1.711      0.08769
   1       snp5      16578      541      5.661       9.93  0.0006026   0.5701       0.5689
   1       snp6      16579      541     -5.577      5.657     0.0018  -0.9858       0.3247
   1       snp7      16635      541      2.985      8.717  0.0002176   0.3425       0.7321
   1       snp8      20879      541      9.053       7.29   0.002853    1.242       0.2148
   1       snp9      20908      541      9.278      6.695    0.00355    1.386       0.1664

 

 

002、R计算

root@PC1:/home/test# ls
gwas_test.map  gwas_test.ped
root@PC1:/home/test# plink --file gwas_test --recode A 1> /dev/null
root@PC1:/home/test# ls
gwas_test.map  gwas_test.ped  plink.log  plink.raw
root@PC1:/home/test# cut -d " " -f 1,3-5 --complement plink.raw > num.raw
root@PC1:/home/test# ls
gwas_test.map  gwas_test.ped  num.raw  plink.log  plink.raw

 

library(data.table)
dat <- fread("num.raw", data.table = F)
dat[1:3,1:8]

result <- data.frame()
for (i in 3:12) {
  reg = lm(PHENOTYPE ~  1 + dat[,i], data=dat)
  result <- rbind(result, summary(reg)$coefficients[2,])
}
names(result) <- c("beta","se","t","p")
result

 

标签:541,GWAS,GLM,PC1,gwas,meta,test,home,plink
来源: https://www.cnblogs.com/liujiaxin2018/p/16523231.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有