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


Java VCFFileReader.query方法代码示例

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


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

示例1: processVCF

import htsjdk.variant.vcf.VCFFileReader; //导入方法依赖的package包/类
@NotNull
Collection<EligibilityReport> processVCF(final String patient, final String sample, final EligibilityReport.ReportType type,
        final VCFFileReader reader) {

    final List<EligibilityReport> results = Lists.newArrayList();

    for (final HmfGenomeRegion region : querySet.values()) {
        final CloseableIterator<VariantContext> query =
                reader.query(region.chromosome(), (int) region.geneStart(), (int) region.geneEnd());
        while (query.hasNext()) {
            final VariantContext variant = query.next();
            results.addAll(processVariant(variant, patient, sample, type));
        }
        query.close();
    }

    return results;
}
 
开发者ID:hartwigmedical,项目名称:hmftools,代码行数:19,代码来源:BachelorEligibility.java

示例2: testTabixIndexCreationChr20

import htsjdk.variant.vcf.VCFFileReader; //导入方法依赖的package包/类
public void testTabixIndexCreationChr20() throws IOException {

		String configFolder = "test-data/configs/hapmap-chr1";
		// input folder contains no vcf or vcf.gz files
		String inputFolder = "test-data/data/chr20-phased";

		// create workflow context
		WorkflowTestContext context = buildContext(inputFolder, "hapmap2", "eagle");

		// create step instance
		InputValidation inputValidation = new InputValidationMock(configFolder);

		// run and test
		boolean result = run(context, inputValidation);

		// check if step is failed
		assertEquals(true, result);
		assertTrue(context.hasInMemory("[OK] 1 valid VCF file(s) found."));

		
		// test tabix index and count snps
		String vcfFilename = inputFolder + "/chr20.R50.merged.1.330k.recode.small.vcf.gz";
		VCFFileReader vcfReader = new VCFFileReader(new File(vcfFilename),
				new File(vcfFilename + TabixUtils.STANDARD_INDEX_EXTENSION), true);
		CloseableIterator<VariantContext> snps = vcfReader.query("20", 1, 1000000000);
		int count = 0;
		while (snps.hasNext()) {
			snps.next();
			count++;
		}
		snps.close();
		vcfReader.close();
		
		//check snps
		assertEquals(7824, count);

	}
 
开发者ID:genepi,项目名称:imputationserver,代码行数:38,代码来源:InputValidationTest.java

示例3: testTabixIndexCreationChr1

import htsjdk.variant.vcf.VCFFileReader; //导入方法依赖的package包/类
public void testTabixIndexCreationChr1() throws IOException {

		String configFolder = "test-data/configs/hapmap-chr1";
		// input folder contains no vcf or vcf.gz files
		String inputFolder = "test-data/data/single";

		// create workflow context
		WorkflowTestContext context = buildContext(inputFolder, "hapmap2", "eagle");

		// create step instance
		InputValidation inputValidation = new InputValidationMock(configFolder);

		// run and test
		boolean result = run(context, inputValidation);

		// check if step is failed
		assertEquals(true, result);
		assertTrue(context.hasInMemory("[OK] 1 valid VCF file(s) found."));

		
		// test tabix index and count snps
		String vcfFilename = inputFolder + "/minimac_test.50.vcf.gz";
		VCFFileReader vcfReader = new VCFFileReader(new File(vcfFilename),
				new File(vcfFilename + TabixUtils.STANDARD_INDEX_EXTENSION), true);
		CloseableIterator<VariantContext> snps = vcfReader.query("1", 1, 1000000000);
		int count = 0;
		while (snps.hasNext()) {
			snps.next();
			count++;
		}
		snps.close();
		vcfReader.close();
		
		//check snps
		assertEquals(905, count);

	}
 
开发者ID:genepi,项目名称:imputationserver,代码行数:38,代码来源:InputValidationTest.java

示例4: countEntries

import htsjdk.variant.vcf.VCFFileReader; //导入方法依赖的package包/类
@Test
public void countEntries() throws Exception {
    VCFFileReader vcfFileReader =
        new VCFFileReader(new File("src/test/resources/" + filename), false);
    Iterator<VariantContext> variantIterator;
    if (interval == null) {
        variantIterator = vcfFileReader.iterator();
    } else {
        variantIterator = vcfFileReader.query(interval.getContig(),
            interval.getStart(), interval.getEnd());
    }
    int expectedCount = Iterators.size(variantIterator);

    int counter = 0;
    for (RecordReader<LongWritable, VariantContextWritable> reader : readers) {
        while (reader.nextKeyValue()) {
            writable = reader.getCurrentValue();
            assertNotNull(writable);
            VariantContext vc = writable.get();
            assertNotNull(vc);
            String value = vc.toString();
            assertNotNull(value);
            counter++;
        }
    }
    assertEquals(expectedCount, counter);
}
 
开发者ID:HadoopGenomics,项目名称:Hadoop-BAM,代码行数:28,代码来源:TestVCFInputFormat.java

示例5: loadVCFs

import htsjdk.variant.vcf.VCFFileReader; //导入方法依赖的package包/类
protected void loadVCFs() {
for(final String vcfFile: IOUtils.unrollFiles(variants)) {
	final VCFFileReader vcfFileReader = new VCFFileReader(new File(vcfFile),true);
	final CloseableIterator<VariantContext> r=vcfFileReader.query(this.interval.getContig(), this.interval.getStart(), this.interval.getEnd());
	while(r.hasNext())
		{
		this.highlightPositions.add(r.next().getStart());
		}
	r.close();
	vcfFileReader.close();
	}
}
 
开发者ID:lindenb,项目名称:jvarkit,代码行数:13,代码来源:AbstractBam2Raster.java

示例6: handleSpaceInVCFInfoAndInvalidKey

import htsjdk.variant.vcf.VCFFileReader; //导入方法依赖的package包/类
@Test
public void handleSpaceInVCFInfoAndInvalidKey(){
	// This reading would fail on the original htsjdk-1.141 
	VCFFileReader reader = new VCFFileReader(new File("test_data/malformed.vcf.gz"));
	reader.query("chr1", 1, 16000000);
}
 
开发者ID:dariober,项目名称:ASCIIGenome,代码行数:7,代码来源:IntervalFeatureTest.java


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