Search in sources :

Example 1 with BreakendSummary

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()));
}
Also used : ProcessingContext(au.edu.wehi.idsv.ProcessingContext) AssemblyEvidenceSource(au.edu.wehi.idsv.AssemblyEvidenceSource) DirectedEvidence(au.edu.wehi.idsv.DirectedEvidence) ArrayList(java.util.ArrayList) BreakendSummary(au.edu.wehi.idsv.BreakendSummary) SequentialIdGenerator(au.edu.wehi.idsv.SequentialIdGenerator) SingleReadEvidence(au.edu.wehi.idsv.SingleReadEvidence) Test(org.junit.Test)

Example 2 with BreakendSummary

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()));
}
Also used : ProcessingContext(au.edu.wehi.idsv.ProcessingContext) AssemblyEvidenceSource(au.edu.wehi.idsv.AssemblyEvidenceSource) DirectedEvidence(au.edu.wehi.idsv.DirectedEvidence) ArrayList(java.util.ArrayList) BreakendSummary(au.edu.wehi.idsv.BreakendSummary) SequentialIdGenerator(au.edu.wehi.idsv.SequentialIdGenerator) SingleReadEvidence(au.edu.wehi.idsv.SingleReadEvidence) Test(org.junit.Test)

Example 3 with BreakendSummary

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));
}
Also used : BreakendSummary(au.edu.wehi.idsv.BreakendSummary) BreakpointSummary(au.edu.wehi.idsv.BreakpointSummary) Test(org.junit.Test)

Example 4 with BreakendSummary

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));
}
Also used : BreakendSummary(au.edu.wehi.idsv.BreakendSummary) BreakpointSummary(au.edu.wehi.idsv.BreakpointSummary) Test(org.junit.Test)

Example 5 with BreakendSummary

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));
}
Also used : BreakendSummary(au.edu.wehi.idsv.BreakendSummary) BreakpointSummary(au.edu.wehi.idsv.BreakpointSummary) Test(org.junit.Test)

Aggregations

BreakendSummary (au.edu.wehi.idsv.BreakendSummary)19 Test (org.junit.Test)13 BreakpointSummary (au.edu.wehi.idsv.BreakpointSummary)10 MockDirectedEvidence (au.edu.wehi.idsv.MockDirectedEvidence)5 MockDirectedBreakpoint (au.edu.wehi.idsv.MockDirectedBreakpoint)4 ArrayList (java.util.ArrayList)4 AssemblyEvidenceSource (au.edu.wehi.idsv.AssemblyEvidenceSource)3 BreakendDirection (au.edu.wehi.idsv.BreakendDirection)3 DirectedEvidence (au.edu.wehi.idsv.DirectedEvidence)3 ProcessingContext (au.edu.wehi.idsv.ProcessingContext)2 SequentialIdGenerator (au.edu.wehi.idsv.SequentialIdGenerator)2 SingleReadEvidence (au.edu.wehi.idsv.SingleReadEvidence)2 Node (au.edu.wehi.idsv.graph.MaximumCliqueIntervalGraph.Node)2 AssemblyFactory (au.edu.wehi.idsv.AssemblyFactory)1 AssemblyIdGenerator (au.edu.wehi.idsv.AssemblyIdGenerator)1 Defaults (au.edu.wehi.idsv.Defaults)1 IdsvVariantContext (au.edu.wehi.idsv.IdsvVariantContext)1 IdsvVariantContextBuilder (au.edu.wehi.idsv.IdsvVariantContextBuilder)1 SanityCheckFailureException (au.edu.wehi.idsv.SanityCheckFailureException)1 VariantContextDirectedEvidence (au.edu.wehi.idsv.VariantContextDirectedEvidence)1