当前位置: 首页>>代码示例>>Java>>正文


Java HardyWeinbergCalculation类代码示例

本文整理汇总了Java中htsjdk.tribble.util.popgen.HardyWeinbergCalculation的典型用法代码示例。如果您正苦于以下问题:Java HardyWeinbergCalculation类的具体用法?Java HardyWeinbergCalculation怎么用?Java HardyWeinbergCalculation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


HardyWeinbergCalculation类属于htsjdk.tribble.util.popgen包,在下文中一共展示了HardyWeinbergCalculation类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: computeHardyWeinbergPvalue

import htsjdk.tribble.util.popgen.HardyWeinbergCalculation; //导入依赖的package包/类
public static double computeHardyWeinbergPvalue(VariantContext vc) {
    if ( vc.getCalledChrCount() == 0 )
        return 0.0;
    return HardyWeinbergCalculation.hwCalculate(vc.getHomRefCount(), vc.getHetCount(), vc.getHomVarCount());
}
 
开发者ID:PAA-NCIC,项目名称:SparkSeq,代码行数:6,代码来源:GATKVariantContextUtils.java

示例2: annotate

import htsjdk.tribble.util.popgen.HardyWeinbergCalculation; //导入依赖的package包/类
public Map<String, Object> annotate(final VariantDataTracker tracker,
                                    final ChromosomeInformationShare ref,
                                    final Mpileup mpileup,
                                    final VariantContext vc,
                                    final Map<String, PerReadAlleleLikelihoodMap> stratifiedPerReadAlleleLikelihoodMap) {

    final GenotypesContext genotypes = vc.getGenotypes();
    if ( genotypes == null || genotypes.size() < MIN_SAMPLES )
        return null;

    int refCount = 0;
    int hetCount = 0;
    int homCount = 0;
    for ( final Genotype g : genotypes ) {
        if ( g.isNoCall() )
            continue;

        // TODO - fix me:
        // Right now we just ignore genotypes that are not confident, but this throws off
        //  our HW ratios.  More analysis is needed to determine the right thing to do when
        //  the genotyper cannot decide whether a given sample is het or hom var.
        if ( g.getLog10PError() > MIN_LOG10_PERROR )
            continue;

        if ( g.isHomRef() )
            refCount++;
        else if ( g.isHet() )
            hetCount++;
        else
            homCount++;
    }

    if ( refCount + hetCount + homCount == 0)
        return null;

    double pvalue = HardyWeinbergCalculation.hwCalculate(refCount, hetCount, homCount);
    //System.out.println(refCount + " " + hetCount + " " + homCount + " " + pvalue);
    Map<String, Object> map = new HashMap<String, Object>();
    map.put(getKeyNames().get(0), String.format("%.1f", QualityUtils.phredScaleErrorRate(pvalue)));
    return map;
}
 
开发者ID:BGI-flexlab,项目名称:SOAPgaea,代码行数:42,代码来源:HardyWeinberg.java

示例3: computeHardyWeinbergPvalue

import htsjdk.tribble.util.popgen.HardyWeinbergCalculation; //导入依赖的package包/类
public static double computeHardyWeinbergPvalue(VariantContext vc) {
	if (vc.getCalledChrCount() == 0)
		return 0.0;
	return HardyWeinbergCalculation.hwCalculate(vc.getHomRefCount(), vc.getHetCount(), vc.getHomVarCount());
}
 
开发者ID:BGI-flexlab,项目名称:SOAPgaea,代码行数:6,代码来源:GaeaGvcfVariantContextUtils.java


注:本文中的htsjdk.tribble.util.popgen.HardyWeinbergCalculation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。