本文整理汇总了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());
}
示例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;
}
示例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());
}