温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

GATK中如何计算Inbreeding coefficient

发布时间:2021-12-08 17:48:08 来源:亿速云 阅读:157 作者:柒染 栏目:大数据

GATK中如何计算Inbreeding coefficient,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。

关于近交系数是什么的定义,除了英文资料,中文上也给出了很清晰的定义,这里引用一下:

近交系数(inbreeding coefficient)是指根据近亲交配的世代数,将基因的纯化程度用百分数来表示即为近交系数,也指个体由于近交而造成异质基因减少时,同质基因或纯合子所占的百分比也叫近交系数,普遍以F或f来表示。

GATK近交系数的计算程序在github上可以找到:AS_InbreedingCoeff.java

代码不短,但计算思路非常简单,很容易看懂,我这里主要展示一下这个计算的核心部分,并在代码中做些许注释,如下:

protected double calculateIC(final VariantContext vc, final Allele altAllele) {    
   final int AN = vc.getCalledChrCount();    
   final double altAF;    
   final double hetCount = heterozygosityUtils.getHetCount(vc, altAllele);    
   
   //shortcut to get a value closer to the non-alleleSpecific value for bialleleics    
   final double F;    

   if (vc.isBiallelic()) {        
       double refAC = heterozygosityUtils.getAlleleCount(vc, vc.getReference());        
       double altAC = heterozygosityUtils.getAlleleCount(vc, altAllele);        
       double refAF = refAC/(altAC+refAC);        altAF = 1 - refAF;
       
       // inbreeding coefficient        F = 1.0 - (hetCount / (2.0 * refAF * altAF * (double) heterozygosityUtils.getSampleCount()));
           } else {        
       //compare number of hets for this allele (and any other second allele) with the expectation based on AFs        //derive the altAF from the likelihoods to account for any accumulation of fractional counts from non-primary likelihoods,        //e.g. for a GQ10 variant, the probability of the call will be ~0.9 and the second best call will be ~0.1 so adding up
       //those 0.1s for het counts can dramatically change the AF compared with integer counts        altAF = heterozygosityUtils.getAlleleCount(vc, altAllele)/ (double) AN;        
       
       // 计算inbreeding coefficient
       // heterozygosityUtils.getSampleCount() 获取总样本数        F = 1.0 - (hetCount / (2.0 * (1 - altAF) * altAF * (double) heterozygosityUtils.getSampleCount()));    }    
   
   return F; }

通过利用哈迪温伯格定律来进行计算的: 1.0 - (hetCount / (2.0 (1 - altAF) altAF(double)N ,其中N是人数。这个值给出的是期望的杂合变异的个数。所以参数F(近交系数)说的就是”实际的hetCount”除以”期望的hetCount”再与1.0取差。当F值越接近0,就意味着实际的hetCount与理论的hetCount越接近。

关于GATK中如何计算Inbreeding coefficient问题的解答就分享到这里了,希望以上内容可以对大家有一定的帮助,如果你还有很多疑惑没有解开,可以关注亿速云行业资讯频道了解更多相关知识。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI