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


Java Genotype.getType方法代码示例

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


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

示例1: determineOrganismType

import htsjdk.variant.variantcontext.Genotype; //导入方法依赖的package包/类
private void determineOrganismType(VariantGA4GH ghEntity, GenotypeData genotypeData,
        int altIndex, List<Allele> alleleList, Genotype genotype) {
    final OrganismType organismType;
    int[] genotypeArray = null;
    switch (genotype.getType()) {
        case HOM_VAR:
            organismType = OrganismType.HOMOZYGOUS;
            genotypeArray = new int[]{altIndex, altIndex};
            break;
        case MIXED:
        case HET:
            genotypeArray = new int[2];
            organismType = determineHeterozygousGenotypeGA4GH(ghEntity, alleleList, genotypeArray);
            break;
        case UNAVAILABLE:
        case NO_CALL:
            organismType = OrganismType.NOT_SPECIFIED;
            break;
        case HOM_REF:
            organismType = OrganismType.NO_VARIATION;
            genotypeArray = new int[]{0, 0};
            break;
        default:
            organismType = OrganismType.NOT_SPECIFIED;
    }
    genotypeData.setOrganismType(organismType);
    genotypeData.setGenotype(genotypeArray);
}
 
开发者ID:react-dev26,项目名称:NGB-master,代码行数:29,代码来源:VcfGa4ghReader.java

示例2: getGenotypeData

import htsjdk.variant.variantcontext.Genotype; //导入方法依赖的package包/类
@NotNull private GenotypeData getGenotypeData(VariantContext context, Genotype genotype) {
    GenotypeData genotypeData;
    if (genotype == null) {
        genotypeData = new GenotypeData();
        genotypeData.setOrganismType(OrganismType.NOT_SPECIFIED);
    } else {
        int[] genotypeArray = null;
        OrganismType organismType;

        switch (genotype.getType()) {
            case HOM_VAR:
                organismType = OrganismType.HOMOZYGOUS;
                int altIndex = context.getAlternateAlleles().indexOf(genotype.getAllele(0)) + 1;
                genotypeArray = new int[]{altIndex, altIndex};
                break;
            case MIXED:
            case HET:
                genotypeArray = new int[2];
                organismType = determineHeterozygousGenotype(context, genotype, genotypeArray);
                break;
            case UNAVAILABLE:
            case NO_CALL:
                organismType = OrganismType.NOT_SPECIFIED;
                break;
            case HOM_REF:
                organismType = OrganismType.NO_VARIATION;
                genotypeArray = new int[]{0, 0};
                break;
            default:
                organismType = OrganismType.NOT_SPECIFIED;
        }

        genotypeData = new GenotypeData(organismType, genotypeArray, genotype.getGenotypeString());
    }
    return genotypeData;
}
 
开发者ID:react-dev26,项目名称:NGB-master,代码行数:37,代码来源:VcfFileReader.java

示例3: initGenotypeTypeField

import htsjdk.variant.variantcontext.Genotype; //导入方法依赖的package包/类
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,代码行数:34,代码来源:VariantReviewDialog.java


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