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


Java Allele.isNonReference方法代码示例

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


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

示例1: getEventLength

import htsjdk.variant.variantcontext.Allele; //导入方法依赖的package包/类
public static int getEventLength(List<Allele> alleleList) {
    Allele refAllele = alleleList.get(0);
    Allele altAllele = alleleList.get(1);
    // look for alt allele that has biggest length distance to ref allele
    int maxLenDiff = 0;
    for (Allele a : alleleList) {
        if (a.isNonReference()) {
            int lenDiff = Math.abs(a.getBaseString().length() - refAllele.getBaseString().length());
            if (lenDiff > maxLenDiff) {
                maxLenDiff = lenDiff;
                altAllele = a;
            }
        }
    }

    return altAllele.getBaseString().length() - refAllele.getBaseString().length();

}
 
开发者ID:PAA-NCIC,项目名称:SparkSeq,代码行数:19,代码来源:IndelGenotypeLikelihoodsCalculationModel.java

示例2: getVariationTypeForSimpleInDels

import htsjdk.variant.variantcontext.Allele; //导入方法依赖的package包/类
@NotNull private static VariationType getVariationTypeForSimpleInDels(VariantContext context,
        Genotype genotype) {
    Allele firstAllele = genotype.getAllele(0);
    Allele secondAllele = genotype.getAllele(1);
    VariationType type;
    if (firstAllele.isNonReference() && secondAllele.isNonReference()) {
        // if both are alt
        if (firstAllele.length() > context.getReference().length()
                && secondAllele.length() > context.getReference().length()) {
            type = VariationType.INS;
        } else if (firstAllele.length() < context.getReference().length() &&
                secondAllele.length() < context.getReference().length()) {
            type = VariationType.DEL;
        } else {
            type = VariationType.MIXED;
        }
    } else {
        // if both are ref
        type = VariationType.MIXED;
    }
    return type;
}
 
开发者ID:react-dev26,项目名称:NGB-master,代码行数:23,代码来源:VcfFileReader.java

示例3: toString

import htsjdk.variant.variantcontext.Allele; //导入方法依赖的package包/类
@Override
public String toString() {
    final List<String> byAllele = new LinkedList<String>();
    for ( final Allele a : getAllelesUsedInGenotyping() )
        if ( a.isNonReference() ) byAllele.add(String.format("%s => MLE %d / posterior %.2f", a, getAlleleCountAtMLE(a), getLog10PosteriorOfAFEq0ForAllele(a)));
    return String.format("AFCalc%n\t\tlog10PosteriorOfAFGT0=%.2f%n\t\t%s", getLog10LikelihoodOfAFGT0(), Utils.join("\n\t\t", byAllele));
}
 
开发者ID:PAA-NCIC,项目名称:SparkSeq,代码行数:8,代码来源:AFCalculationResult.java

示例4: anyPolymorphic

import htsjdk.variant.variantcontext.Allele; //导入方法依赖的package包/类
/**
 * Are any of the alleles polymorphic w.r.t. #isPolymorphic?
 *
 * @param log10minPNonRef the confidence threshold, in log10 space
 * @return true if any are poly, false otherwise
 */
public boolean anyPolymorphic(final double log10minPNonRef) {
    for ( final Allele a : getAllelesUsedInGenotyping() )
        if ( a.isNonReference() && isPolymorphic(a, log10minPNonRef) )
            return true;
    return false;
}
 
开发者ID:PAA-NCIC,项目名称:SparkSeq,代码行数:13,代码来源:AFCalculationResult.java

示例5: getInitialAlleleList

import htsjdk.variant.variantcontext.Allele; //导入方法依赖的package包/类
public static List<Allele> getInitialAlleleList(final RefMetaDataTracker tracker,
                                                final ReferenceContext ref,
                                                final Map<String, AlignmentContext> contexts,
                                                final AlignmentContextUtils.ReadOrientation contextType,
                                                final UnifiedArgumentCollection UAC,
                                                final boolean ignoreSNPAllelesWhenGenotypingIndels) {

    List<Allele> alleles = new ArrayList<Allele>();
    if (UAC.genotypingOutputMode == GenotypingOutputMode.GENOTYPE_GIVEN_ALLELES) {
        VariantContext vc = null;
        for (final VariantContext vc_input : tracker.getValues(UAC.alleles, ref.getLocus())) {
            if (vc_input != null &&
                    allowableTypes.contains(vc_input.getType()) &&
                    ref.getLocus().getStart() == vc_input.getStart()) {
                vc = vc_input;
                break;
            }
        }
        // ignore places where we don't have a variant
        if (vc == null)
            return alleles;

        if (ignoreSNPAllelesWhenGenotypingIndels) {
            // if there's an allele that has same length as the reference (i.e. a SNP or MNP), ignore it and don't genotype it
            for (Allele a : vc.getAlleles())
                if (a.isNonReference() && a.getBases().length == vc.getReference().getBases().length)
                    continue;
                else
                    alleles.add(a);

        } else {
            alleles.addAll(vc.getAlleles());
        }

    } else {
        alleles = computeConsensusAlleles(ref, contexts, contextType, UAC);
    }
    return alleles;
}
 
开发者ID:PAA-NCIC,项目名称:SparkSeq,代码行数:40,代码来源:IndelGenotypeLikelihoodsCalculationModel.java


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