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


Java GenotypeType.UNAVAILABLE属性代码示例

本文整理汇总了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;
}
 
开发者ID:BGI-flexlab,项目名称:SOAPgaea,代码行数:27,代码来源:VariantBasicStatistic.java

示例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);
}
 
开发者ID:hyounesy,项目名称:ALEA,代码行数:33,代码来源:VariantReviewDialog.java


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