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


Java Allele.NO_CALL属性代码示例

本文整理汇总了Java中htsjdk.variant.variantcontext.Allele.NO_CALL属性的典型用法代码示例。如果您正苦于以下问题:Java Allele.NO_CALL属性的具体用法?Java Allele.NO_CALL怎么用?Java Allele.NO_CALL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在htsjdk.variant.variantcontext.Allele的用法示例。


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

示例1: getMostLikelyAllele

/**
 * Given a map from alleles to likelihoods, find the allele with the largest likelihood.
 *
 * @param alleleMap - a map from alleles to likelihoods
 * @param onlyConsiderTheseAlleles if not null, we will only consider alleles in this set for being one of the best.
 *                                 this is useful for the case where you've selected a subset of the alleles that
 *                                 the reads have been computed for further analysis.  If null totally ignored
 * @return - a MostLikelyAllele object
 */
public static MostLikelyAllele getMostLikelyAllele( final Map<Allele,Double> alleleMap, final Set<Allele> onlyConsiderTheseAlleles ) {
    if ( alleleMap == null ) throw new IllegalArgumentException("The allele to likelihood map cannot be null");
    double maxLike = Double.NEGATIVE_INFINITY;
    double prevMaxLike = Double.NEGATIVE_INFINITY;
    Allele mostLikelyAllele = Allele.NO_CALL;
    Allele secondMostLikely = null;

    for (final Map.Entry<Allele,Double> el : alleleMap.entrySet()) {
        if ( onlyConsiderTheseAlleles != null && ! onlyConsiderTheseAlleles.contains(el.getKey()) )
            continue;

        if (el.getValue() > maxLike) {
            prevMaxLike = maxLike;
            maxLike = el.getValue();
            secondMostLikely = mostLikelyAllele;
            mostLikelyAllele = el.getKey();
        } else if( el.getValue() > prevMaxLike ) {
            secondMostLikely = el.getKey();
            prevMaxLike = el.getValue();
        }
    }

    return new MostLikelyAllele(mostLikelyAllele, secondMostLikely, maxLike, prevMaxLike);
}
 
开发者ID:PAA-NCIC,项目名称:SparkSeq,代码行数:33,代码来源:PerReadAlleleLikelihoodMap.java

示例2: getAlleleIfInformative

/**
 * Get the most likely allele if isInformative(log10ThresholdForInformative) is true, or NO_CALL otherwise
 *
 * @param log10ThresholdForInformative a log10 threshold to determine if the most likely allele was informative
 * @return a non-null allele
 */
public Allele getAlleleIfInformative(final double log10ThresholdForInformative) {
    return isInformative(log10ThresholdForInformative) ? getMostLikelyAllele() : Allele.NO_CALL;
}
 
开发者ID:PAA-NCIC,项目名称:SparkSeq,代码行数:9,代码来源:MostLikelyAllele.java


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