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