當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。