use of au.edu.wehi.idsv.BreakendSummary in project gridss by PapenfussLab.
the class PositionalAssemblerTest method should_assemble_simple_forward_soft_clips.
@Test
public void should_assemble_simple_forward_soft_clips() {
ProcessingContext pc = getContext();
pc.getAssemblyParameters().anchorLength = 1;
AssemblyEvidenceSource aes = AES(pc);
pc.getAssemblyParameters().k = 4;
List<DirectedEvidence> input = new ArrayList<DirectedEvidence>();
// 12345678901234567890
// ACGTTGGTTA
// MMMMMSSSSS
// GCAACGTTGGTTAA
// MMMMMMMMSSSSSS
input.add(SCE(FWD, withSequence("ACGTTGGTTA", Read(0, 10, "5M5S"))[0]));
input.add(SCE(FWD, withSequence("TTTTTGCAACGTTGGTTAA", Read(0, 2, "13M6S"))[0]));
input.sort(DirectedEvidenceOrder.ByStartEnd);
List<SingleReadEvidence> r = asAssemblyEvidence(aes, Lists.newArrayList(new PositionalAssembler(pc, aes, new SequentialIdGenerator("asm"), input.iterator())));
assertEquals(1, r.size());
assertEquals(new BreakendSummary(0, FWD, 14), r.get(0).getBreakendSummary());
// anchor length to match breakend length
assertEquals("AACGTT", S(r.get(0).getAnchorSequence()));
assertEquals("GGTTAA", S(r.get(0).getBreakendSequence()));
assertEquals("AACGTTGGTTAA", S(r.get(0).getSAMRecord().getReadBases()));
}
use of au.edu.wehi.idsv.BreakendSummary in project gridss by PapenfussLab.
the class PositionalAssemblerTest method rp_anchor_should_set_non_reference_bases_as_anchoring.
@Test
public void rp_anchor_should_set_non_reference_bases_as_anchoring() {
ProcessingContext pc = getContext();
pc.getAssemblyParameters().anchorLength = 1;
AssemblyEvidenceSource aes = AES(pc);
pc.getAssemblyParameters().k = 4;
List<DirectedEvidence> input = new ArrayList<DirectedEvidence>();
// 12345678901234567890
// ACGTTGGTTA
// MMMMMSSSSS
// GCAACGTTGGTTAA
// MMMMMMMMSSSSSS
// TTTTTGCAACGTTGGTTAA
input.add(SCE(FWD, withSequence("ACGTTGGTTA", Read(0, 10, "5M5S"))[0]));
input.add(SCE(FWD, withSequence("TTTTTGCAACGTTGGTTAA", Read(0, 2, "13M6S"))[0]));
input.add(NRRP(withSequence("TTTTTGCAACGTTGGTTAA", DP(0, 2, "13M6S", true, 1, 1, "19M", false))));
input.sort(DirectedEvidenceOrder.ByStartEnd);
List<SingleReadEvidence> r = asAssemblyEvidence(aes, Lists.newArrayList(new PositionalAssembler(pc, aes, new SequentialIdGenerator("asm"), input.iterator())));
assertEquals(2, r.size());
// race condition w.r.t which assembly returns first
assertEquals(new BreakendSummary(0, FWD, 14), r.get(0).getBreakendSummary());
// anchor length to match breakend length
assertEquals("AACGTT", S(r.get(0).getAnchorSequence()));
assertEquals("GGTTAA", S(r.get(0).getBreakendSequence()));
assertEquals("AACGTTGGTTAA", S(r.get(0).getSAMRecord().getReadBases()));
}
use of au.edu.wehi.idsv.BreakendSummary in project gridss by PapenfussLab.
the class TruthAnnotatorTest method match_should_allow_novel_base_insertions_to_match_reference.
/*
* If the bases we insert match the reference bases adjacent to the breakend, then we'll allow
* matches to those additional reference bases
*/
@Test
public void match_should_allow_novel_base_insertions_to_match_reference() {
// forward
assertTrue(TruthAnnotator.matches(new BreakpointSummary(new BreakendSummary(0, FWD, 1), new BreakendSummary(0, BWD, 10)), new BreakendSummary(0, FWD, 1), 4, 4));
assertTrue(TruthAnnotator.matches(new BreakpointSummary(new BreakendSummary(0, FWD, 1), new BreakendSummary(0, BWD, 10)), new BreakendSummary(0, FWD, 2), 4, 3));
assertTrue(TruthAnnotator.matches(new BreakpointSummary(new BreakendSummary(0, FWD, 1), new BreakendSummary(0, BWD, 10)), new BreakendSummary(0, FWD, 3), 4, 2));
assertTrue(TruthAnnotator.matches(new BreakpointSummary(new BreakendSummary(0, FWD, 1), new BreakendSummary(0, BWD, 10)), new BreakendSummary(0, FWD, 4), 4, 1));
assertTrue(TruthAnnotator.matches(new BreakpointSummary(new BreakendSummary(0, FWD, 1), new BreakendSummary(0, BWD, 10)), new BreakendSummary(0, FWD, 5), 4, 0));
// backward
assertTrue(TruthAnnotator.matches(new BreakpointSummary(new BreakendSummary(0, FWD, 1), new BreakendSummary(0, BWD, 10)), new BreakendSummary(0, BWD, 10), 4, 4));
assertTrue(TruthAnnotator.matches(new BreakpointSummary(new BreakendSummary(0, FWD, 1), new BreakendSummary(0, BWD, 10)), new BreakendSummary(0, BWD, 9), 4, 3));
assertTrue(TruthAnnotator.matches(new BreakpointSummary(new BreakendSummary(0, FWD, 1), new BreakendSummary(0, BWD, 10)), new BreakendSummary(0, BWD, 8), 4, 2));
assertTrue(TruthAnnotator.matches(new BreakpointSummary(new BreakendSummary(0, FWD, 1), new BreakendSummary(0, BWD, 10)), new BreakendSummary(0, BWD, 7), 4, 1));
assertTrue(TruthAnnotator.matches(new BreakpointSummary(new BreakendSummary(0, FWD, 1), new BreakendSummary(0, BWD, 10)), new BreakendSummary(0, BWD, 6), 4, 0));
assertTrue(TruthAnnotator.matches(new BreakpointSummary(new BreakendSummary(0, BWD, 2), new BreakendSummary(0, FWD, 10)), new BreakendSummary(0, BWD, 1), 4, 3));
assertTrue(TruthAnnotator.matches(new BreakpointSummary(new BreakendSummary(0, BWD, 2), new BreakendSummary(0, FWD, 10)), new BreakendSummary(0, FWD, 11), 4, 3));
// breakpoint should allow margin on either side
assertTrue(TruthAnnotator.matches(new BreakpointSummary(new BreakendSummary(0, FWD, 1), new BreakendSummary(0, BWD, 10)), new BreakpointSummary(new BreakendSummary(0, FWD, 1), new BreakendSummary(0, BWD, 10)), 4, 4));
assertTrue(TruthAnnotator.matches(new BreakpointSummary(new BreakendSummary(0, FWD, 1), new BreakendSummary(0, BWD, 10)), new BreakpointSummary(new BreakendSummary(0, FWD, 2), new BreakendSummary(0, BWD, 10)), 4, 3));
assertTrue(TruthAnnotator.matches(new BreakpointSummary(new BreakendSummary(0, FWD, 1), new BreakendSummary(0, BWD, 10)), new BreakpointSummary(new BreakendSummary(0, FWD, 1), new BreakendSummary(0, BWD, 9)), 4, 3));
assertTrue(TruthAnnotator.matches(new BreakpointSummary(new BreakendSummary(0, FWD, 1), new BreakendSummary(0, BWD, 10)), new BreakpointSummary(new BreakendSummary(0, FWD, 1), new BreakendSummary(0, BWD, 6)), 4, 0));
assertTrue(TruthAnnotator.matches(new BreakpointSummary(new BreakendSummary(0, FWD, 1), new BreakendSummary(0, BWD, 10)), new BreakpointSummary(new BreakendSummary(0, FWD, 2), new BreakendSummary(0, BWD, 7)), 4, 0));
assertTrue(TruthAnnotator.matches(new BreakpointSummary(new BreakendSummary(0, FWD, 1), new BreakendSummary(0, BWD, 10)), new BreakpointSummary(new BreakendSummary(0, FWD, 3), new BreakendSummary(0, BWD, 8)), 4, 0));
assertTrue(TruthAnnotator.matches(new BreakpointSummary(new BreakendSummary(0, FWD, 1), new BreakendSummary(0, BWD, 10)), new BreakpointSummary(new BreakendSummary(0, FWD, 4), new BreakendSummary(0, BWD, 9)), 4, 0));
assertTrue(TruthAnnotator.matches(new BreakpointSummary(new BreakendSummary(0, FWD, 1), new BreakendSummary(0, BWD, 10)), new BreakpointSummary(new BreakendSummary(0, FWD, 5), new BreakendSummary(0, BWD, 10)), 4, 0));
}
use of au.edu.wehi.idsv.BreakendSummary in project gridss by PapenfussLab.
the class TruthAnnotatorTest method match_allow_any_interval_overlap.
@Test
public void match_allow_any_interval_overlap() {
assertTrue(TruthAnnotator.matches(new BreakpointSummary(new BreakendSummary(0, FWD, 1, 1, 10), new BreakendSummary(0, BWD, 50, 50, 60)), new BreakpointSummary(new BreakendSummary(0, FWD, 5), new BreakendSummary(0, BWD, 70, 40, 70)), 0, 0));
assertTrue(TruthAnnotator.matches(new BreakpointSummary(new BreakendSummary(0, FWD, 10), new BreakendSummary(0, BWD, 60, 50, 60)), new BreakpointSummary(new BreakendSummary(0, FWD, 10, 10, 11), new BreakendSummary(0, BWD, 40, 40, 50)), 0, 0));
}
use of au.edu.wehi.idsv.BreakendSummary in project gridss by PapenfussLab.
the class TruthAnnotatorTest method match_should_limit_breakend_reference_homology_matching_to_16bp.
@Test
public void match_should_limit_breakend_reference_homology_matching_to_16bp() {
assertTrue(TruthAnnotator.matches(new BreakpointSummary(new BreakendSummary(0, FWD, 1), new BreakendSummary(0, BWD, 1000)), new BreakendSummary(0, FWD, 17), 17, 1));
assertFalse(TruthAnnotator.matches(new BreakpointSummary(new BreakendSummary(0, FWD, 1), new BreakendSummary(0, BWD, 1000)), new BreakendSummary(0, FWD, 18), 17, 0));
}
Aggregations