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


Java BCF2Codec类代码示例

本文整理汇总了Java中htsjdk.variant.bcf2.BCF2Codec的典型用法代码示例。如果您正苦于以下问题:Java BCF2Codec类的具体用法?Java BCF2Codec怎么用?Java BCF2Codec使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: verifyFileType

import htsjdk.variant.bcf2.BCF2Codec; //导入依赖的package包/类
private void verifyFileType(
        final File resultVCFFile,
        final String outputExtension) {
    final FeatureCodec<? extends Feature, ?> featureCodec = FeatureManager.getCodecForFile(resultVCFFile);

    if (outputExtension.equals(".vcf") ||
        outputExtension.equals(".vcf.bgz") ||
        outputExtension.equals(".vcf.gz") ||
        outputExtension.equals(".tmp"))
    {
        Assert.assertEquals(featureCodec.getClass(), VCFCodec.class,
                "Wrong codec selected for file " + resultVCFFile.getAbsolutePath());
    }
    else if (outputExtension.equals(".bcf")) {
        Assert.assertEquals(featureCodec.getClass(), BCF2Codec.class,
                "Wrong codec selected for file " + resultVCFFile.getAbsolutePath());
    }
    else {
        throw new IllegalArgumentException("Unknown file extension in createVCFWriter test validation");
    }
}
 
开发者ID:broadinstitute,项目名称:gatk,代码行数:22,代码来源:GATKVariantContextUtilsUnitTest.java

示例2: getGenomicsDBFeatureReader

import htsjdk.variant.bcf2.BCF2Codec; //导入依赖的package包/类
private static GenomicsDBFeatureReader<VariantContext, PositionalBufferedStream> getGenomicsDBFeatureReader(final String workspace, final String reference, boolean produceGTField) throws IOException {
    if (produceGTField) {
        return new GenomicsDBFeatureReader<>(
                "",
                getQueryJsonForGenomicsDB(new File(workspace, GenomicsDBConstants.DEFAULT_VIDMAP_FILE_NAME).getAbsolutePath(),
                        new File(workspace, GenomicsDBConstants.DEFAULT_CALLSETMAP_FILE_NAME).getAbsolutePath(),
                        workspace,
                        reference,
                        produceGTField),
                new BCF2Codec());
    } else {
        return new GenomicsDBFeatureReader<>(
                new File(workspace, GenomicsDBConstants.DEFAULT_VIDMAP_FILE_NAME).getAbsolutePath(),
                new File(workspace, GenomicsDBConstants.DEFAULT_CALLSETMAP_FILE_NAME).getAbsolutePath(),
                workspace,
                GenomicsDBConstants.DEFAULT_ARRAY_NAME,
                reference,
                new File(workspace, GenomicsDBConstants.DEFAULT_VCFHEADER_FILE_NAME).getAbsolutePath(),
                new BCF2Codec());
    }
}
 
开发者ID:broadinstitute,项目名称:gatk,代码行数:22,代码来源:GenomicsDBImportIntegrationTest.java

示例3: getDetectCorrectFileFormatTestData

import htsjdk.variant.bcf2.BCF2Codec; //导入依赖的package包/类
@DataProvider(name = "DetectCorrectFileFormatTestData")
public Object[][] getDetectCorrectFileFormatTestData() {
    return new Object[][] {
            { new File(FEATURE_MANAGER_TEST_DIRECTORY + "minimal_vcf4_file.vcf"), VCFCodec.class },
            { new File(FEATURE_MANAGER_TEST_DIRECTORY + "minimal_vcf3_file.vcf"), VCF3Codec.class },
            { new File(FEATURE_MANAGER_TEST_DIRECTORY + "minimal_bcf_file.bcf"), BCF2Codec.class },
            { new File(FEATURE_MANAGER_TEST_DIRECTORY + "minimal_bed_file.bed"), BEDCodec.class},
            { new File(FEATURE_MANAGER_TEST_DIRECTORY + "minimal_table_file.table"), TableCodec.class}
    };
}
 
开发者ID:broadinstitute,项目名称:gatk,代码行数:11,代码来源:FeatureManagerUnitTest.java

示例4: getCodec

import htsjdk.variant.bcf2.BCF2Codec; //导入依赖的package包/类
/**
 * Return a tribble codec to decode the supplied file, or null if not found.
 *
 * @param locator the ResourceLocator (file or URL) to the feature file
 */
public static FeatureCodec getCodec(ResourceLocator locator, Genome genome) {

    String path = locator.getPath();
    String fn = locator.getTypeString().toLowerCase();

    if (fn.endsWith(".vcf3")) {
        return new VCFWrapperCodec(new VCF3Codec(), genome);
    }
    if (fn.endsWith(".vcf4")) {
        return new VCFWrapperCodec(new VCFCodec(), genome);
    } else if (fn.endsWith(".vcf")) {
        return new VCFWrapperCodec(getVCFCodec(locator), genome);
    } else if (fn.endsWith(".bcf")) {
        return new BCF2WrapperCodec(new BCF2Codec(), genome);
    } else if (fn.endsWith(".bed")) {
        final IGVBEDCodec codec = new IGVBEDCodec(genome);
        if (fn.endsWith("junctions.bed")) {
            codec.setFeatureType(FeatureType.SPLICE_JUNCTION);
        }
        return codec;
    } else if (fn.endsWith(".gappedpeak")) {
        return new IGVBEDCodec(genome, FeatureType.GAPPED_PEAK);
    }else if (fn.endsWith(".dgv")) {
        return new DGVCodec(genome);
    } else if (fn.contains("refflat")) {
        return new UCSCGeneTableCodec(UCSCGeneTableCodec.Type.REFFLAT, genome);
    } else if (fn.contains("genepred") || fn.contains("ensgene") || fn.contains("refgene")) {
        return new UCSCGeneTableCodec(UCSCGeneTableCodec.Type.GENEPRED, genome);
    } else if (fn.contains("ucscgene")) {
        return new UCSCGeneTableCodec(UCSCGeneTableCodec.Type.UCSCGENE, genome);
    } else if (fn.endsWith(".rmask") || (fn.endsWith(".repmask"))) {
        return new REPMaskCodec(genome);
    } else if (fn.endsWith(".gff3") || fn.endsWith(".gvf")) {
        return new GFFCodec(GFFCodec.Version.GFF3, genome);
    } else if (fn.endsWith(".gff") || fn.endsWith(".gtf")) {
        return new GFFCodec(genome);
        //} else if (fn.endsWith(".sam")) {
        //return new SAMCodec();
    } else if (fn.endsWith(".psl") || fn.endsWith(".pslx")) {
        return new PSLCodec(genome);
    } else if (MUTCodec.isMutationAnnotationFile(locator)) {
        return new MUTCodec(path, genome);
    } else if (fn.endsWith(".narrowpeak") || fn.endsWith(".broadpeak") ) {
        return new EncodePeakCodec(genome);
    } else if (fn.endsWith(".peak")) {
        return new PeakCodec(genome);
    } else if (fn.endsWith(".snp")) {
        return new UCSCSnpCodec(genome);
    } else if (fn.endsWith(".eqtl")) {
        return new EQTLCodec(genome);
    } else if (fn.endsWith("fpkm_tracking")) {
        return new FPKMTrackingCodec(path);
        //} else if (fn.endsWith("gene_exp.diff") || fn.endsWith("cds_exp.diff")) {
        //    return new ExpDiffCodec(path);
    } else {
        return null;
    }

}
 
开发者ID:hyounesy,项目名称:ALEA,代码行数:65,代码来源:CodecFactory.java


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