打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
笔记 | GWAS 操作流程2-6:去掉亲缘关系近的个体

这是使用plink学习GWAS中质控的最后一篇,后面是使用GLM和MLM模型进行建模,以及对结果的整理和可视化。

这里,我们要对一些亲子关系的个体,进行一下过滤,计算类似IBS的结果。

「注意:」

这里讲亲子关系的个体移除,不是必须要的,比如我们分析的群体里面有亲子关系的个体,想要进行分析,不需要做这一步的筛选。

1. 计算pihat > 0.2的组合

plink --bfile HapMap_3_r3_10 --genome --min 0.2 --out pihat_min0.2

说明文档:

--genome invokes an IBS/IBD computation, and then writes a report with the following fields to plink.genome:

FID1Family ID for first sample
IID1Individual ID for first sample
FID2Family ID for second sample
IID2Individual ID for second sample
RTRelationship type inferred from .fam/.ped file
EZIBD sharing expected value, based on just .fam/.ped relationship
Z0P(IBD=0)
Z1P(IBD=1)
Z2P(IBD=2)
PI_HATProportion IBD, i.e. P(IBD=2) + 0.5*P(IBD=1)
PHEPairwise phenotypic code (1, 0, -1 = AA, AU, and UU pairs, respectively)
DSTIBS distance, i.e. (IBS2 + 0.5*IBS1) / (IBS0 + IBS1 + IBS2)
PPCIBS binomial test
RATIOHETHET : IBS0 SNP ratio (expected value 2)

2. 提取Z1大于0.9的个体

awk '{if($8>0.9) print $0}' pihat_min0.2.genome > zoom_pihat.genome

过滤出91个组合:

3. 作图

R代码

pdf("relatedness.pdf")
relatedness = read.table("pihat_min0.2.genome", header=T)
par(pch=16, cex=1)
with(relatedness,plot(Z0,Z1, xlim=c(0,1), ylim=c(0,1), type="n"))
with(subset(relatedness,RT=="PO") , points(Z0,Z1,col=4))
with(subset(relatedness,RT=="UN") , points(Z0,Z1,col=3))
legend(1,1, xjust=1, yjust=1, legend=levels(relatedness$RT), pch=16, col=c(4,3))

pdf("zoom_relatedness.pdf")
relatedness_zoom = read.table("zoom_pihat.genome", header=T)
par(pch=16, cex=1)
with(relatedness_zoom,plot(Z0,Z1, xlim=c(0,0.02), ylim=c(0.98,1), type="n"))
with(subset(relatedness_zoom,RT=="PO") , points(Z0,Z1,col=4))
with(subset(relatedness_zoom,RT=="UN") , points(Z0,Z1,col=3))
legend(0.02,1, xjust=1, yjust=1, legend=levels(relatedness$RT), pch=16, col=c(4,3))

pdf("hist_relatedness.pdf")
relatedness = read.table("pihat_min0.2.genome", header=T)
hist(relatedness[,10],main="Histogram relatedness", xlab= "Pihat")
dev.off()

这里的PO为:亲子关系 这里的UN为:非亲缘关系

4. 删除亲子关系的个体

plink --bfile HapMap_3_r3_10 --filter-founders --make-bed --out HapMap_3_r3_11

日志:

PLINK v1.90b6.5 64-bit (13 Sep 2018) www.cog-genomics.org/plink/1.9/
(C) 2005-2018 Shaun Purcell, Christopher Chang GNU General Public License v3
Logging to HapMap_3_r3_11.log.
Options in effect:
--bfile HapMap_3_r3_10
--filter-founders
--make-bed
--out HapMap_3_r3_11

515185 MB RAM detected; reserving 257592 MB for main workspace.
1073743 variants loaded from .bim file.
161 people (77 males, 84 females) loaded from .fam.
110 phenotype values loaded from .fam.
51 people removed due to founder status (--filter-founders).
Using 1 thread (no multithreaded calculations invoked).
Before main variant filters, 110 founders and 0 nonfounders present.
Calculating allele frequencies... done.
Total genotyping rate in remaining samples is 0.998016.
1073743 variants and 110 people pass filters and QC.
Among remaining phenotypes, 55 are cases and 55 are controls.
--make-bed to HapMap_3_r3_11.bed + HapMap_3_r3_11.bim + HapMap_3_r3_11.fam ...
done.

可以看出,51个个体被移除。

5. 结果文件

HapMap_3_r3_11.bed HapMap_3_r3_11.bim HapMap_3_r3_11.fam HapMap_3_r3_11.log

6. 注意

这里讲亲子关系的个体移除,不是必须要的,比如我们分析的群体里面有亲子关系的个体,想要进行分析,不需要做这一步的筛选。

相关系列:

笔记 | GWAS 操作流程1:下载数据

笔记 | GWAS 操作流程2-1:缺失质控

笔记 | GWAS 操作流程2-2:性别质控

笔记 | GWAS 操作流程2-3:MAF过滤

笔记 | GWAS 操作流程2-4:哈温平衡检验

笔记 | GWAS 操作流程2-5:杂合率检验

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
笔记 | GWAS 操作流程2-1:缺失质控
#软件工具#解密GWAS的利器--Plink 使用解析
公共数据挖掘|已有GWAS数据的下载及挖掘(一)
基因型填充前的质控条件简介
plink格式文件的介绍及相关转换
写给人类基因组计划完成十五周年:从一个人的基因组计划到精准医疗
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服