• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TabixUtils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getChromosomeNames

import htsjdk.tribble.util.TabixUtils; //导入依赖的package包/类
@Override
public List<String> getChromosomeNames(){
	
	if(this.getTrackFormat().equals(TrackFormat.TDF)){

		ResourceLocator resourceLocator= new ResourceLocator(this.getWorkFilename());
		TDFReader reader= new TDFReader(resourceLocator);
		List<String> chroms= new ArrayList<String>(reader.getChromosomeNames());
		if(chroms.get(0).equals("All")){
			chroms.remove(0);
		}
		return chroms;
		// chroms.addAll();
	}
	if(this.getTrackFormat().equals(TrackFormat.BEDGRAPH)){
		TabixIndex tbi= (TabixIndex) IndexFactory.loadIndex(this.getWorkFilename() + TabixUtils.STANDARD_INDEX_EXTENSION);
		return tbi.getSequenceNames();
	}
	if(this.getTrackFormat().equals(TrackFormat.BIGWIG)){
		return this.bigWigReader.getChromosomeNames();
	}
	return null;
}
 
开发者ID:dariober,项目名称:ASCIIGenome,代码行数:24,代码来源:TrackWiggles.java


示例2: canCompressAndIndexHeaderlessVCF

import htsjdk.tribble.util.TabixUtils; //导入依赖的package包/类
@Test
public void canCompressAndIndexHeaderlessVCF() throws ClassNotFoundException, IOException, InvalidRecordException, SQLException{

	String infile= "test_data/noheader.vcf";
	File outfile= new File("test_data/noheader.vcf.gz");
	outfile.deleteOnExit();
	
	File expectedTbi= new File(outfile.getAbsolutePath() + TabixUtils.STANDARD_INDEX_EXTENSION); 
	expectedTbi.deleteOnExit();

	new MakeTabixIndex(infile, outfile, TabixFormat.VCF);
	
	assertTrue(outfile.exists());
	assertTrue(outfile.length() > 200);
	assertTrue(expectedTbi.exists());
	assertTrue(expectedTbi.length() > 100);

	TabixReader tbx = new TabixReader(outfile.getAbsolutePath());
	Iterator x = tbx.query("1", 1, 10000000);
	assertTrue(x.next().startsWith("1"));

}
 
开发者ID:dariober,项目名称:ASCIIGenome,代码行数:23,代码来源:MakeTabixFileTest.java


示例3: testRealFileSizeVCF

import htsjdk.tribble.util.TabixUtils; //导入依赖的package包/类
@Test
public void testRealFileSizeVCF() throws ClassNotFoundException, IOException, InvalidRecordException, SQLException{
	
	// See test_data/README.md for this file. This is fairly large and we want to check it is processed
	// in a reasonable amount of time.
	String infile= "test_data/ALL.wex.union_illumina_wcmc_bcm_bc_bi.20110521.snps.exome.sites.vcf";
	
	File outfile= new File("deleteme.vcf.gz");
	outfile.deleteOnExit();
	File expectedTbi= new File(outfile.getAbsolutePath() + TabixUtils.STANDARD_INDEX_EXTENSION); 
	expectedTbi.deleteOnExit();
	
	long t0= System.currentTimeMillis();
	new MakeTabixIndex(infile, outfile, TabixFormat.VCF);
	long t1= System.currentTimeMillis();
	
	assertTrue(outfile.exists());
	assertTrue(outfile.length() > 1000);
	assertTrue((t1 - t0) < 20000); // Should be << than 20 sec, ~2 sec

	// Check you can read ok
	this.vcfTester(outfile.getAbsolutePath());
}
 
开发者ID:dariober,项目名称:ASCIIGenome,代码行数:24,代码来源:MakeTabixFileTest.java


示例4: canCompressAndIndexVCF_CEU

import htsjdk.tribble.util.TabixUtils; //导入依赖的package包/类
@Test
public void canCompressAndIndexVCF_CEU() throws ClassNotFoundException, IOException, InvalidRecordException, SQLException{

	String infile= "test_data/CEU.exon.2010_06.genotypes.vcf";
	
	File outfile= new File("deleteme.vcf.gz");
	outfile.deleteOnExit();
	File expectedTbi= new File(outfile.getAbsolutePath() + TabixUtils.STANDARD_INDEX_EXTENSION); 
	expectedTbi.deleteOnExit();
	
	new MakeTabixIndex(infile, outfile, TabixFormat.VCF);

	assertTrue(outfile.exists());
	assertTrue(outfile.length() > 1000);
	
	// Check you can read ok
	this.vcfTester(outfile.getAbsolutePath());
}
 
开发者ID:dariober,项目名称:ASCIIGenome,代码行数:19,代码来源:MakeTabixFileTest.java


示例5: canHandleEmptyFile

import htsjdk.tribble.util.TabixUtils; //导入依赖的package包/类
@Test 
public void canHandleEmptyFile() throws ClassNotFoundException, IOException, InvalidRecordException, SQLException, InvalidGenomicCoordsException{
	String infile= "test_data/empty.bed";
	File outfile= new File("test_data/empty.tmp.bed.gz");
	outfile.deleteOnExit();
	File expectedTbi= new File(outfile.getAbsolutePath() + TabixUtils.STANDARD_INDEX_EXTENSION); 
	expectedTbi.deleteOnExit();
	
	new MakeTabixIndex(infile, outfile, TabixFormat.BED);

	assertTrue(outfile.exists());
	assertTrue(expectedTbi.exists());
	
	assertEquals(28, outfile.length()); // Checked with `bgzip empty.bed && ls -l empty.bed.gz`
	assertTrue(expectedTbi.length() > 0);

}
 
开发者ID:dariober,项目名称:ASCIIGenome,代码行数:18,代码来源:MakeTabixFileTest.java


示例6: canCompressAndIndexSortedFile

import htsjdk.tribble.util.TabixUtils; //导入依赖的package包/类
@Test
public void canCompressAndIndexSortedFile() throws IOException, InvalidRecordException, ClassNotFoundException, SQLException {
	
	String infile= "test_data/overlapped.bed";
	File outfile= new File("test_data/tmp.bed.gz");
	outfile.deleteOnExit();
	
	File expectedTbi= new File(outfile.getAbsolutePath() + TabixUtils.STANDARD_INDEX_EXTENSION); 
	expectedTbi.deleteOnExit();
	
	new MakeTabixIndex(infile, outfile, TabixFormat.BED);
	
	assertTrue(outfile.exists());
	assertTrue(outfile.length() > 80);
	assertTrue(expectedTbi.exists());
	assertTrue(expectedTbi.length() > 80);
	
	TabixReader tbx = new TabixReader(outfile.getAbsolutePath());
	Iterator x = tbx.query("chr1", 1, 1000000);
	assertTrue(x.next().startsWith("chr1"));
	
}
 
开发者ID:dariober,项目名称:ASCIIGenome,代码行数:23,代码来源:MakeTabixFileTest.java


示例7: canCompressAndIndexSortedGzipFile

import htsjdk.tribble.util.TabixUtils; //导入依赖的package包/类
@Test
public void canCompressAndIndexSortedGzipFile() throws IOException, InvalidRecordException, ClassNotFoundException, SQLException {
	
	String infile= "test_data/hg19_genes.gtf.gz";
	File outfile= new File("test_data/tmp2.bed.gz");
	outfile.deleteOnExit();
	
	File expectedTbi= new File(outfile.getAbsolutePath() + TabixUtils.STANDARD_INDEX_EXTENSION); 
	expectedTbi.deleteOnExit();
	
	new MakeTabixIndex(infile, outfile, TabixFormat.GFF);

	assertTrue(outfile.exists());
	assertTrue(outfile.length() > 7000000);
	assertTrue(expectedTbi.exists());
	assertTrue(expectedTbi.length() > 500000);
	
	TabixReader tbx = new TabixReader(outfile.getAbsolutePath());
	Iterator x = tbx.query("chr1", 1, 1000000);
	assertTrue(x.next().startsWith("chr1"));
	
}
 
开发者ID:dariober,项目名称:ASCIIGenome,代码行数:23,代码来源:MakeTabixFileTest.java


示例8: canCompressAndIndexUnsortedFile

import htsjdk.tribble.util.TabixUtils; //导入依赖的package包/类
@Test
public void canCompressAndIndexUnsortedFile() throws IOException, InvalidRecordException, ClassNotFoundException, SQLException {
	
	String infile= "test_data/refSeq.hg19.bed.gz";
	File outfile= new File("test_data/tmp3.bed.gz");
	outfile.deleteOnExit();
	
	File expectedTbi= new File(outfile.getAbsolutePath() + TabixUtils.STANDARD_INDEX_EXTENSION); 
	expectedTbi.deleteOnExit();
	
	new MakeTabixIndex(infile, outfile, TabixFormat.BED);
	
	assertTrue(outfile.exists());
	assertTrue(outfile.length() > 200000);
	assertTrue(expectedTbi.exists());
	assertTrue(expectedTbi.length() > 100000);
	
}
 
开发者ID:dariober,项目名称:ASCIIGenome,代码行数:19,代码来源:MakeTabixFileTest.java


示例9: canCompressAndIndexSortedURL

import htsjdk.tribble.util.TabixUtils; //导入依赖的package包/类
@Test
public void canCompressAndIndexSortedURL() throws IOException, InvalidRecordException, ClassNotFoundException, SQLException {
	
	String infile= "http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeMapability/wgEncodeDacMapabilityConsensusExcludable.bed.gz";
	File outfile= new File("test_data/tmp4.bed.gz");
	outfile.deleteOnExit();
	
	File expectedTbi= new File(outfile.getAbsolutePath() + TabixUtils.STANDARD_INDEX_EXTENSION); 
	expectedTbi.deleteOnExit();
	
	new MakeTabixIndex(infile, outfile, TabixFormat.BED);
	
	assertTrue(outfile.exists());
	assertTrue(outfile.length() > 1000);
	assertTrue(expectedTbi.exists());
	assertTrue(expectedTbi.length() > 1000);
	
}
 
开发者ID:dariober,项目名称:ASCIIGenome,代码行数:19,代码来源:MakeTabixFileTest.java


示例10: canCompressAndIndexUnsortedURL

import htsjdk.tribble.util.TabixUtils; //导入依赖的package包/类
@Test
public void canCompressAndIndexUnsortedURL() throws IOException, InvalidRecordException, ClassNotFoundException, SQLException {
	
	String infile= "http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeSydhTfbs/wgEncodeSydhTfbsGm12878P300bStdPk.narrowPeak.gz";
	File outfile= new File("test_data/tmp5.bed.gz");
	outfile.deleteOnExit();
	
	File expectedTbi= new File(outfile.getAbsolutePath() + TabixUtils.STANDARD_INDEX_EXTENSION); 
	expectedTbi.deleteOnExit();
	
	new MakeTabixIndex(infile, outfile, TabixFormat.BED);
	
	assertTrue(outfile.exists());
	assertTrue(outfile.length() > 1000);
	assertTrue(expectedTbi.exists());
	assertTrue(expectedTbi.length() > 1000);
	
}
 
开发者ID:dariober,项目名称:ASCIIGenome,代码行数:19,代码来源:MakeTabixFileTest.java


示例11: canCompressAndIndexVCF

import htsjdk.tribble.util.TabixUtils; //导入依赖的package包/类
@Test
public void canCompressAndIndexVCF() throws ClassNotFoundException, IOException, InvalidRecordException, SQLException{

	String infile= "test_data/CHD.exon.2010_03.sites.unsorted.vcf";
	File outfile= new File("test_data/tmp6.bed.gz");
	outfile.deleteOnExit();
	
	File expectedTbi= new File(outfile.getAbsolutePath() + TabixUtils.STANDARD_INDEX_EXTENSION); 
	expectedTbi.deleteOnExit();

	new MakeTabixIndex(infile, outfile, TabixFormat.VCF);
	
	assertTrue(outfile.exists());
	assertTrue(outfile.length() > 1000);
	assertTrue(expectedTbi.exists());
	assertTrue(expectedTbi.length() > 1000);

	TabixReader tbx = new TabixReader(outfile.getAbsolutePath());
	Iterator x = tbx.query("1", 20000000, 30000000);
	assertTrue(x.next().startsWith("1"));

	// Check you can read ok
	this.vcfTester(outfile.getAbsolutePath());
}
 
开发者ID:dariober,项目名称:ASCIIGenome,代码行数:25,代码来源:MakeTabixFileTest.java


示例12: blockCompressFileInPlace

import htsjdk.tribble.util.TabixUtils; //导入依赖的package包/类
@Test
public void blockCompressFileInPlace() throws IOException, ClassNotFoundException, InvalidRecordException, SQLException{
	// Test we can compress and index a file and overwrite the original file. 
	
	File testFile= new File("deleteme.bed.gz");
	testFile.deleteOnExit();
	Files.copy(new File("test_data/refSeq.hg19.bed.gz"), testFile);
	
	File expectedTbi= new File(testFile.getAbsolutePath() + TabixUtils.STANDARD_INDEX_EXTENSION); 
	expectedTbi.deleteOnExit();
	
	new MakeTabixIndex(testFile.getAbsolutePath(), testFile, TabixFormat.BED);
	
	assertTrue(testFile.exists());
	assertTrue(testFile.length() > 200000);
	assertTrue(expectedTbi.exists());
	assertTrue(expectedTbi.length() > 100000);

}
 
开发者ID:dariober,项目名称:ASCIIGenome,代码行数:20,代码来源:MakeTabixFileTest.java


示例13: loadTabixIndex

import htsjdk.tribble.util.TabixUtils; //导入依赖的package包/类
/**
 * Try to load the tabix index from disk, checking for out of date indexes and old versions
 * @return an Index, or null if we're unable to load
 */
public static Index loadTabixIndex(final File featureFile) {
    Utils.nonNull(featureFile);
    try {
        final String path = featureFile.getAbsolutePath();
        final boolean isTabix = new AbstractFeatureReader.ComponentMethods().isTabix(path, null);
        if (! isTabix){
            return null;
        }
        final String indexPath = ParsingUtils.appendToPath(path, TabixUtils.STANDARD_INDEX_EXTENSION);
        logger.debug("Loading tabix index from disk for file " + featureFile);
        final Index index = IndexFactory.loadIndex(indexPath);
        final File indexFile = new File(indexPath);
        checkIndexVersionAndModificationTime(featureFile, indexFile, index);
        return index;
    } catch (final IOException | RuntimeException e) {
        return null;
    }
}
 
开发者ID:broadinstitute,项目名称:gatk,代码行数:23,代码来源:IndexUtils.java


示例14: createTempFile

import htsjdk.tribble.util.TabixUtils; //导入依赖的package包/类
/**
 * Creates a temp file that will be deleted on exit
 *
 * This will also mark the corresponding Tribble/Tabix/BAM indices matching the temp file for deletion.
 * @param name Prefix of the file.
 * @param extension Extension to concat to the end of the file.
 * @return A file in the temporary directory starting with name, ending with extension, which will be deleted after the program exits.
 */
public static File createTempFile(String name, String extension) {
    try {

        if ( !extension.startsWith(".") ) {
            extension = "." + extension;
        }

        final File file = File.createTempFile(name, extension);
        file.deleteOnExit();

        // Mark corresponding indices for deletion on exit as well just in case an index is created for the temp file:
        new File(file.getAbsolutePath() + Tribble.STANDARD_INDEX_EXTENSION).deleteOnExit();
        new File(file.getAbsolutePath() + TabixUtils.STANDARD_INDEX_EXTENSION).deleteOnExit();
        new File(file.getAbsolutePath() + ".bai").deleteOnExit();
        new File(file.getAbsolutePath() + ".md5").deleteOnExit();
        new File(file.getAbsolutePath().replaceAll(extension + "$", ".bai")).deleteOnExit();

        return file;
    } catch (IOException ex) {
        throw new GATKException("Cannot create temp file: " + ex.getMessage(), ex);
    }
}
 
开发者ID:broadinstitute,项目名称:gatk,代码行数:31,代码来源:IOUtils.java


示例15: testVCFGZIndex_tabix

import htsjdk.tribble.util.TabixUtils; //导入依赖的package包/类
@Test
public void testVCFGZIndex_tabix() {
    final File ORIG_FILE = getTestFile("test_variants_for_index.vcf.blockgz.gz"); //made by bgzip
    final File outName = createTempFile("test_variants_for_index.blockgz.gz.", TabixUtils.STANDARD_INDEX_EXTENSION);

    final String[] args = {
            "--feature-file" ,  ORIG_FILE.getAbsolutePath(),
            "-O" ,  outName.getAbsolutePath()
    };
    final Object res = this.runCommandLine(args);
    Assert.assertEquals(res, outName.getAbsolutePath());

    final Index index = IndexFactory.loadIndex(res.toString());
    Assert.assertTrue(index instanceof TabixIndex);

    Assert.assertEquals(index.getSequenceNames(), Arrays.asList("1", "2", "3", "4"));
    checkIndex(index, Arrays.asList("1", "2", "3", "4"));
}
 
开发者ID:broadinstitute,项目名称:gatk,代码行数:19,代码来源:IndexFeatureFileIntegrationTest.java


示例16: testVCFGZIndex_inferredName

import htsjdk.tribble.util.TabixUtils; //导入依赖的package包/类
@Test
public void testVCFGZIndex_inferredName(){
    final File ORIG_FILE = getTestFile("test_variants_for_index.vcf.blockgz.gz"); //made by bgzip
    final String[] args = {
            "--feature-file" ,  ORIG_FILE.getAbsolutePath(),
    };
    final Object res = this.runCommandLine(args);
    final File tabixIndex = new File(ORIG_FILE.getAbsolutePath() + TabixUtils.STANDARD_INDEX_EXTENSION);
    Assert.assertEquals(res, tabixIndex.getAbsolutePath());
    tabixIndex.deleteOnExit();

    Assert.assertTrue(tabixIndex.exists(), tabixIndex + " does not exists");
    final Index index = IndexFactory.loadIndex(tabixIndex.toString());
    Assert.assertTrue(index instanceof TabixIndex);

    Assert.assertEquals(index.getSequenceNames(), Arrays.asList("1", "2", "3", "4"));
    checkIndex(index, Arrays.asList("1", "2", "3", "4"));
}
 
开发者ID:broadinstitute,项目名称:gatk,代码行数:19,代码来源:IndexFeatureFileIntegrationTest.java


示例17: setDbIndex

import htsjdk.tribble.util.TabixUtils; //导入依赖的package包/类
public void setDbIndex() {
	if(!SeekableStreamFactory.isFilePath(db)) {
		if(this.indexFormat == null) {
			throw new IllegalArgumentException("Please set up index format for remote file.");
		} else if(this.indexFormat == IndexFormat.TBI) {
			this.dbIndex = this.db + TabixUtils.STANDARD_INDEX_EXTENSION;
			if(!isExist(this.dbIndex))
				throw new IllegalArgumentException("Index file: " + this.dbIndex + " is not find.");
		} else {
			this.dbIndex = this.db + BinIndexWriter.PLUS_INDEX_EXTENSION;
			this.plusFile = this.db + BinIndexWriter.PLUS_EXTENSION;
			if(!isExist(this.dbIndex)) throw new IllegalArgumentException("Index file: " + this.dbIndex + " is not find.");
			if(!isExist(this.plusFile)) throw new IllegalArgumentException("Plus file: " + this.plusFile + " is not find.");
		}
	} else {
		if(this.indexFormat == IndexFormat.PLUS) {
			checkPlus();
		} else if(this.indexFormat == IndexFormat.TBI){
			checkTbi();
		} else {
			this.dbIndex = this.db + BinIndexWriter.PLUS_INDEX_EXTENSION;
			if(!isExist(this.dbIndex)) {
				this.dbIndex = this.db + TabixUtils.STANDARD_INDEX_EXTENSION;
				if(!isExist(this.dbIndex)) {
					throw new IllegalArgumentException("We support two types of index file. The first is the tabix index file, the second type needs plus file and plus index file both. Please put the index in the same folder with the database file!");
				} else {
					this.indexFormat = IndexFormat.TBI;
				}
			} else {
				this.plusFile = this.db + BinIndexWriter.PLUS_EXTENSION;
				if(!isExist(this.plusFile)) {
					throw new IllegalArgumentException("We cannot find plus file: "+ this.plusFile + ", you must put plus file and plus index file in the same folder!");
				} else {
					this.indexFormat = IndexFormat.PLUS;
				}
			}
		}
	}
	idx = IndexFactory.readIndex(dbIndex);
}
 
开发者ID:mulinlab,项目名称:vanno,代码行数:41,代码来源:DBRunConfigBean.java


示例18: getTempFilePath

import htsjdk.tribble.util.TabixUtils; //导入依赖的package包/类
/**
 * Get a temporary file path based on the prefix and extension provided.
 * This file (and possible indexes associated with it) will be scheduled for deletion on shutdown
 *
 * @param prefix a prefix for the file name
 *               for remote paths this should be a valid URI to root the temporary file in (ie. gcs://hellbender/staging/)
 *               there is no guarantee that this will be used as the root of the tmp file name, a local prefix may be placed in the tmp folder for example
 * @param extension and extension for the temporary file path, the resulting path will end in this
 * @return a path to use as a temporary file, on remote file systems which don't support an atomic tmp file reservation a path is chosen with a long randomized name
 *
 */
public static String getTempFilePath(String prefix, String extension){
    if (isCloudStorageUrl(prefix) || (isHadoopUrl(prefix))){
        final String path = randomRemotePath(prefix, "", extension);
        deleteOnExit(path);
        deleteOnExit(path + Tribble.STANDARD_INDEX_EXTENSION);
        deleteOnExit(path + TabixUtils.STANDARD_INDEX_EXTENSION);
        deleteOnExit(path + ".bai");
        deleteOnExit(path + ".md5");
        deleteOnExit(path.replaceAll(extension + "$", ".bai")); //if path ends with extension, replace it with .bai
        return path;
    } else {
    	try {
            final File file = File.createTempFile(prefix, extension);
            file.deleteOnExit();

            // Mark corresponding indices for deletion on exit as well just in case an index is created for the temp file:
            new File(file.getAbsolutePath() + Tribble.STANDARD_INDEX_EXTENSION).deleteOnExit();
            new File(file.getAbsolutePath() + TabixUtils.STANDARD_INDEX_EXTENSION).deleteOnExit();
            new File(file.getAbsolutePath() + ".bai").deleteOnExit();
            new File(file.getAbsolutePath() + ".md5").deleteOnExit();
            new File(file.getAbsolutePath().replaceAll(extension + "$", ".bai")).deleteOnExit();

            return file.getAbsolutePath();
        } catch (IOException ex) {
            throw new UserException("Cannot create temp file: " + ex.getMessage(), ex);
        }
    }
}
 
开发者ID:BGI-flexlab,项目名称:SOAPgaea,代码行数:40,代码来源:BucketUtils.java


示例19: initChunk

import htsjdk.tribble.util.TabixUtils; //导入依赖的package包/类
private VcfChunk initChunk(String chr, int chunkStart, int chunkEnd, boolean phased, List<String> header)
		throws IOException {
	overallChunks++;

	String chunkName = null;

	chunkName = FileUtil.path(chunksDir, "chunk_" + chr + "_" + chunkStart + "_" + chunkEnd + ".vcf.gz");

	// init chunk
	VcfChunk chunk = new VcfChunk();
	chunk.setChromosome(chr);
	chunk.setStart(chunkStart);
	chunk.setEnd(chunkEnd);
	chunk.setVcfFilename(chunkName);
	chunk.setIndexFilename(chunkName + TabixUtils.STANDARD_INDEX_EXTENSION);
	chunk.setPhased(phased);

	BGzipLineWriter writer = new BGzipLineWriter(chunk.getVcfFilename());
	for (String headerLine : header) {
		writer.write(headerLine);
	}

	chunk.vcfChunkWriter = writer;

	return chunk;

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


示例20: testTabixIndexCreationChr20

import htsjdk.tribble.util.TabixUtils; //导入依赖的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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TupleTag类代码示例发布时间:2022-05-23
下一篇:
Java DriveClient类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap