本文整理汇总了Java中htsjdk.variant.variantcontext.GenotypeType.UNAVAILABLE属性的典型用法代码示例。如果您正苦于以下问题:Java GenotypeType.UNAVAILABLE属性的具体用法?Java GenotypeType.UNAVAILABLE怎么用?Java GenotypeType.UNAVAILABLE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类htsjdk.variant.variantcontext.GenotypeType
的用法示例。
在下文中一共展示了GenotypeType.UNAVAILABLE属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: determineType
private GenotypeType determineType(final List<Allele> alleles) {
if ( alleles.isEmpty() )
return GenotypeType.UNAVAILABLE;
boolean sawNoCall = false, sawMultipleAlleles = false;
Allele observedAllele = null;
for ( final Allele allele : alleles ) {
if ( allele.isNoCall() )
sawNoCall = true;
else if ( observedAllele == null )
observedAllele = allele;
else if ( !allele.equals(observedAllele) )
sawMultipleAlleles = true;
}
if ( sawNoCall ) {
if ( observedAllele == null )
return GenotypeType.NO_CALL;
return GenotypeType.MIXED;
}
if ( observedAllele == null )
throw new IllegalStateException("BUG: there are no alleles present in this genotype but the alleles list is not null");
return sawMultipleAlleles ? GenotypeType.HET : observedAllele.isReference() ? GenotypeType.HOM_REF : GenotypeType.HOM_VAR;
}
示例2: initGenotypeTypeField
private void initGenotypeTypeField(VariantContext variant) {
String mutationString = null;
GenotypeType gtt = GenotypeType.NO_CALL;
String prefSampleName = VariantReviewPlugin.getPreferentialSampleName();
//If there is only one sample, or we find the preferential sample,
//use that data.
for (String sampleName : variant.getSampleNamesOrderedByName()) {
boolean isPref = sampleName.equalsIgnoreCase(prefSampleName);
if (isPref || mutationString == null) {
if(!variantContext.isBiallelic())
sampleVC = variantContext.subContextFromSamples(Collections.singleton(sampleName), true);
else
sampleVC = variantContext;
mutationString = ParsingUtils.join(",", ParsingUtils.sortList(sampleVC.getAlleles()));
Genotype genotype = sampleVC.getGenotype(sampleName);
gtt = genotype.getType();
if (isPref) break;
} else {
//If we have several samples with different mutations, don't know which
//to pick. Make that obvious to the user
if (gtt != sampleVC.getGenotype(sampleName).getType()) {
mutationString = "./.";
gtt = GenotypeType.UNAVAILABLE;
}
}
}
genotypeTypeField.setSelectedItem(gtt);
mutField.setText(mutationString);
mutField.setToolTipText(mutationString);
}