use of htsjdk.tribble.index.linear.LinearIndex in project gatk by broadinstitute.
the class IndexFeatureFileIntegrationTest method testVCFIndex.
@Test
public void testVCFIndex() {
final File ORIG_FILE = getTestFile("test_variants_for_index.vcf");
final File outName = createTempFile("test_variants_for_index.vcf", ".idx");
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 LinearIndex);
Assert.assertEquals(index.getSequenceNames(), Arrays.asList("1", "2", "3", "4"));
checkIndex(index, Arrays.asList("1", "2", "3", "4"));
}
use of htsjdk.tribble.index.linear.LinearIndex in project gatk by broadinstitute.
the class IndexFeatureFileIntegrationTest method testGVCFIndex.
@Test
public void testGVCFIndex() {
final File ORIG_FILE = getTestFile("test_variants_for_index.g.vcf");
final File outName = createTempFile("test_variants_for_index.g.vcf.", ".idx");
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 LinearIndex);
Assert.assertEquals(index.getSequenceNames(), Arrays.asList("1"));
checkIndex(index, Arrays.asList("1"));
}
use of htsjdk.tribble.index.linear.LinearIndex in project gatk by broadinstitute.
the class IndexFeatureFileIntegrationTest method testBCFIndex.
@Test
public void testBCFIndex() {
final File ORIG_FILE = getTestFile("test_variants_for_index.bcf");
final File outName = createTempFile("test_variants_for_index.bcf.", ".idx");
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 LinearIndex);
Assert.assertEquals(index.getSequenceNames(), Arrays.asList("1"));
checkIndex(index, Arrays.asList("1"));
}
use of htsjdk.tribble.index.linear.LinearIndex in project gatk by broadinstitute.
the class IndexFeatureFileIntegrationTest method testGVCFTreatedAsVCFIndex.
@Test
public void testGVCFTreatedAsVCFIndex() {
// Here we're testing what happens when we have a GVCF that is treated by the tool as a
// regular VCF due to the lack of a .g.vcf extension
final File ORIG_FILE = getTestFile("test_variants_for_index.gvcf_treated_as_vcf.vcf");
final File outName = createTempFile("test_variants_for_index.gvcf_treated_as_vcf.vcf.", ".idx");
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 LinearIndex);
Assert.assertEquals(index.getSequenceNames(), Arrays.asList("1"));
checkIndex(index, Arrays.asList("1"));
}
use of htsjdk.tribble.index.linear.LinearIndex in project gatk by broadinstitute.
the class IndexFeatureFileIntegrationTest method testVCFIndex_inferredName.
@Test
public void testVCFIndex_inferredName() {
final File ORIG_FILE = getTestFile("test_variants_for_index.vcf");
final String[] args = { "--feature_file", ORIG_FILE.getAbsolutePath() };
final Object res = this.runCommandLine(args);
final File tribbleIndex = Tribble.indexFile(ORIG_FILE);
Assert.assertEquals(res, tribbleIndex.getAbsolutePath());
tribbleIndex.deleteOnExit();
final Index index = IndexFactory.loadIndex(res.toString());
Assert.assertTrue(index instanceof LinearIndex);
Assert.assertEquals(index.getSequenceNames(), Arrays.asList("1", "2", "3", "4"));
checkIndex(index, Arrays.asList("1", "2", "3", "4"));
}
Aggregations