use of com.github.lindenb.jvarkit.tools.trap.TrapIndexer in project jvarkit by lindenb.
the class TestNg01 method testVcfTrap.
@Test
public void testVcfTrap() throws IOException {
final File dbFile = new File(TEST_RESULTS_DIR, "chr1.TraPv2.txt");
PrintWriter pw = new PrintWriter(dbFile);
pw.println("906010\tA\tG\tENSG00000186092\t0.029");
pw.println("906010\tA\tG\tENSG00000186092\t1");
pw.println("906010\tA\tG\tENSG00000186094\t0");
pw.println("906010\tA\tG\tENSG00000186095\t0.0");
pw.println("906011\tT\tC\tENSG00000186093\t0.99");
pw.flush();
pw.close();
final File indexFile = new File(TEST_RESULTS_DIR, "chr1.TraPv2.dat");
Assert.assertEquals(0, new TrapIndexer().instanceMain(new String[] { "-o", indexFile.getPath(), dbFile.getPath() }));
final File manifestFile = new File(TEST_RESULTS_DIR, "jeter.manifest");
pw = new PrintWriter(manifestFile);
pw.println("1\t" + indexFile.getPath());
pw.flush();
pw.close();
final File outvcf = new File(TEST_RESULTS_DIR, "jeter.vcf");
Assert.assertEquals(0, new VcfTrap().instanceMain(new String[] { "-o", outvcf.getPath(), "-A", "TRAP", "-m", manifestFile.getPath(), "src/test/resources/gnomad.genomes.r2.0.1.sites.1.vcf.gz" }));
Assert.assertTrue(streamVcf(outvcf).anyMatch(V -> V.hasAttribute("TRAP")));
Assert.assertTrue(manifestFile.delete());
Assert.assertTrue(indexFile.delete());
Assert.assertTrue(dbFile.delete());
Assert.assertTrue(outvcf.delete());
}
Aggregations