use of org.broadinstitute.hellbender.tools.walkers.haplotypecaller.graphs.KBestHaplotype in project gatk-protected by broadinstitute.
the class ReadThreadingAssemblerUnitTest method testSingleIndelAsDoubleIndel3Reads.
@Test
public void testSingleIndelAsDoubleIndel3Reads() {
final TestAssembler assembler = new TestAssembler(25);
// The single indel spans two repetitive structures
final String ref = "GTTTTTCCTAGGCAAATGGTTTCTATAAAATTATGTGTGTGTGTCTCTCTCTGTGTGTGTGTGTGTGTGTGTGTGTATACCTAATCTCACACTCTTTTTTCTGG";
final String read1 = "GTTTTTCCTAGGCAAATGGTTTCTATAAAATTATGTGTGTGTGTCTCT----------GTGTGTGTGTGTGTGTGTATACCTAATCTCACACTCTTTTTTCTGG";
final String read2 = "GTTTTTCCTAGGCAAATGGTTTCTATAAAATTATGTGTGTGTGTCTCT----------GTGTGTGTGTGTGTGTGTATACCTAATCTCACACTCTTTTTTCTGG";
assembler.addSequence(ReadThreadingGraphUnitTest.getBytes(ref), true);
assembler.addSequence(ReadThreadingGraphUnitTest.getBytes(read1), false);
assembler.addSequence(ReadThreadingGraphUnitTest.getBytes(read2), false);
final SeqGraph graph = assembler.assemble();
final List<KBestHaplotype> paths = new KBestHaplotypeFinder(graph);
Assert.assertEquals(paths.size(), 2);
final byte[] refPath = paths.get(0).bases().length == ref.length() ? paths.get(0).bases() : paths.get(1).bases();
final byte[] altPath = paths.get(0).bases().length == ref.length() ? paths.get(1).bases() : paths.get(0).bases();
Assert.assertEquals(refPath, ReadThreadingGraphUnitTest.getBytes(ref));
Assert.assertEquals(altPath, ReadThreadingGraphUnitTest.getBytes(read1));
}
use of org.broadinstitute.hellbender.tools.walkers.haplotypecaller.graphs.KBestHaplotype in project gatk by broadinstitute.
the class ReadThreadingAssemblerUnitTest method assertSingleBubble.
private void assertSingleBubble(final TestAssembler assembler, final String one, final String two) {
final SeqGraph graph = assembler.assemble();
graph.simplifyGraph();
final List<KBestHaplotype> paths = new KBestHaplotypeFinder(graph);
Assert.assertEquals(paths.size(), 2);
final Set<String> expected = new HashSet<>(Arrays.asList(one, two));
for (final KBestHaplotype path : paths) {
final String seq = new String(path.bases());
Assert.assertTrue(expected.contains(seq));
expected.remove(seq);
}
}
use of org.broadinstitute.hellbender.tools.walkers.haplotypecaller.graphs.KBestHaplotype in project gatk by broadinstitute.
the class ReadThreadingAssemblerUnitTest method testSingleIndelAsDoubleIndel3Reads.
@Test
public void testSingleIndelAsDoubleIndel3Reads() {
final TestAssembler assembler = new TestAssembler(25);
// The single indel spans two repetitive structures
final String ref = "GTTTTTCCTAGGCAAATGGTTTCTATAAAATTATGTGTGTGTGTCTCTCTCTGTGTGTGTGTGTGTGTGTGTGTGTATACCTAATCTCACACTCTTTTTTCTGG";
final String read1 = "GTTTTTCCTAGGCAAATGGTTTCTATAAAATTATGTGTGTGTGTCTCT----------GTGTGTGTGTGTGTGTGTATACCTAATCTCACACTCTTTTTTCTGG";
final String read2 = "GTTTTTCCTAGGCAAATGGTTTCTATAAAATTATGTGTGTGTGTCTCT----------GTGTGTGTGTGTGTGTGTATACCTAATCTCACACTCTTTTTTCTGG";
assembler.addSequence(ReadThreadingGraphUnitTest.getBytes(ref), true);
assembler.addSequence(ReadThreadingGraphUnitTest.getBytes(read1), false);
assembler.addSequence(ReadThreadingGraphUnitTest.getBytes(read2), false);
final SeqGraph graph = assembler.assemble();
final List<KBestHaplotype> paths = new KBestHaplotypeFinder(graph);
Assert.assertEquals(paths.size(), 2);
final byte[] refPath = paths.get(0).bases().length == ref.length() ? paths.get(0).bases() : paths.get(1).bases();
final byte[] altPath = paths.get(0).bases().length == ref.length() ? paths.get(1).bases() : paths.get(0).bases();
Assert.assertEquals(refPath, ReadThreadingGraphUnitTest.getBytes(ref));
Assert.assertEquals(altPath, ReadThreadingGraphUnitTest.getBytes(read1));
}
Aggregations