本文整理汇总了Java中htsjdk.tribble.index.tabix.TabixFormat.BED属性的典型用法代码示例。如果您正苦于以下问题:Java TabixFormat.BED属性的具体用法?Java TabixFormat.BED怎么用?Java TabixFormat.BED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类htsjdk.tribble.index.tabix.TabixFormat
的用法示例。
在下文中一共展示了TabixFormat.BED属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: trackFormatToTabixFormat
public static TabixFormat trackFormatToTabixFormat(TrackFormat fmt){
TabixFormat tbx= null;
if(fmt.equals(TrackFormat.BAM)){
tbx= TabixFormat.SAM;
} else if (fmt.equals(TrackFormat.BED) || fmt.equals(TrackFormat.BEDGRAPH)){
tbx= TabixFormat.BED;
} else if (fmt.equals(TrackFormat.GFF) || fmt.equals(TrackFormat.GTF)){
tbx= TabixFormat.GFF;
} else if (fmt.equals(TrackFormat.VCF)){
tbx= TabixFormat.VCF;
} else {
throw new RuntimeException();
}
return tbx;
}
示例2: canHandleEmptyFile
@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);
}
示例3: canCompressAndIndexSortedFile
@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"));
}
示例4: canCompressAndIndexUnsortedFile
@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);
}
示例5: canCompressAndIndexSortedURL
@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);
}
示例6: canCompressAndIndexUnsortedURL
@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);
}
示例7: blockCompressFileInPlace
@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);
}
示例8: main
public static void main(String[] args) {
String path = "/Users/mulin/Desktop/dbNSFP3.0a.ANN.bgz";
// String path = "/Users/mulin/Desktop/AF.ANN.bgz";
// String path = "/Users/mulin/Desktop/clinvar.20160215.sv.ANN.bgz";
CollectionFileWriter write = new CollectionFileWriter(path , TabixFormat.BED);
write.makeIndex();
}
示例9: tabixBedgraphToTmpFile
private String tabixBedgraphToTmpFile(String inBdg) throws IOException, ClassNotFoundException, InvalidRecordException, SQLException{
File tmp = Utils.createTempFile(".asciigenome." + new File(inBdg).getName() + ".", ".bedGraph.gz");
File tmpTbi= new File(tmp.getAbsolutePath() + TabixUtils.STANDARD_INDEX_EXTENSION);
tmp.deleteOnExit();
tmpTbi.deleteOnExit();
new MakeTabixIndex(inBdg, tmp, TabixFormat.BED);
return tmp.getAbsolutePath();
}
示例10: handlingInvalidFile
public void handlingInvalidFile() throws ClassNotFoundException, IOException, InvalidRecordException, SQLException{
String infile= "test_data/chr7.fa";
File outfile= new File("deleteme.gtf.gz");
outfile.deleteOnExit();
File expectedTbi= new File(outfile.getAbsolutePath() + TabixUtils.STANDARD_INDEX_EXTENSION);
expectedTbi.deleteOnExit();
new MakeTabixIndex(infile, outfile, TabixFormat.BED);
}
示例11: canProcessBedgraphWithTrackLine
@Test
public void canProcessBedgraphWithTrackLine() throws ClassNotFoundException, IOException, InvalidRecordException, SQLException{
String testFile= "test_data/test2.bedGraph";
String outfile= testFile + ".tmp.bedGraph.gz";
File expectedTbi= new File(outfile + TabixUtils.STANDARD_INDEX_EXTENSION);
new File(outfile).deleteOnExit();
expectedTbi.deleteOnExit();
new MakeTabixIndex(testFile, new File(outfile), TabixFormat.BED);
assertTrue(expectedTbi.exists());
assertTrue(expectedTbi.length() > 50);
}