Search in sources :

Example 1 with BreakpointSummary

use of au.edu.wehi.idsv.BreakpointSummary in project gridss by PapenfussLab.

the class VariantCallingConfigurationTest method full_margin_should_apply_to_interchromosomal_events.

@Test
public void full_margin_should_apply_to_interchromosomal_events() {
    VariantCallingConfiguration config = new VariantCallingConfiguration(getDefaultConfig());
    config.breakendMargin = 100;
    assertEquals(new BreakpointSummary(0, FWD, 1000, 900, 1100, 1, FWD, 1000, 900, 1100), config.withMargin(new BreakpointSummary(0, FWD, 1000, 1, FWD, 1000)));
}
Also used : BreakpointSummary(au.edu.wehi.idsv.BreakpointSummary) Test(org.junit.Test)

Example 2 with BreakpointSummary

use of au.edu.wehi.idsv.BreakpointSummary in project gridss by PapenfussLab.

the class BreakpointHomologyTest method no_homology.

@Test
public void no_homology() {
    InMemoryReferenceSequenceFile ref = new InMemoryReferenceSequenceFile(new String[] { "0", "1" }, new byte[][] { B("CCCCCCCCCCCC"), B("TTTTTTTTTTTTTTTTTTTTTTTT") });
    // >
    // <
    BreakpointHomology bh = BreakpointHomology.calculate(ref, new BreakpointSummary(0, FWD, 6, 1, BWD, 7), "", 100, 10);
    assertEquals(0, bh.getLocalHomologyLength());
    assertEquals(0, bh.getRemoteHomologyLength());
}
Also used : InMemoryReferenceSequenceFile(au.edu.wehi.idsv.picard.InMemoryReferenceSequenceFile) BreakpointSummary(au.edu.wehi.idsv.BreakpointSummary) Test(org.junit.Test)

Example 3 with BreakpointSummary

use of au.edu.wehi.idsv.BreakpointSummary in project gridss by PapenfussLab.

the class BreakpointHomologyTest method should_report_homology_up_to_max_distance_away.

@Test
public void should_report_homology_up_to_max_distance_away() {
    InMemoryReferenceSequenceFile ref = new InMemoryReferenceSequenceFile(new String[] { "0", "1" }, new byte[][] { B("CCCAATGGGCCCTTTTTTTTTTTTTTTTTTT"), B("TTTAATGGGAAAGGGGGGGGGGGGGGGGGGG") });
    // >
    // <
    BreakpointHomology bh = BreakpointHomology.calculate(ref, new BreakpointSummary(0, FWD, 6, 1, BWD, 7), "", 1, 5);
    assertEquals(1, bh.getLocalHomologyLength());
    assertEquals(1, bh.getRemoteHomologyLength());
}
Also used : InMemoryReferenceSequenceFile(au.edu.wehi.idsv.picard.InMemoryReferenceSequenceFile) BreakpointSummary(au.edu.wehi.idsv.BreakpointSummary) Test(org.junit.Test)

Example 4 with BreakpointSummary

use of au.edu.wehi.idsv.BreakpointSummary in project gridss by PapenfussLab.

the class BreakpointHomologyTest method should_require_exact_remote_breakpoint.

@Test(expected = IllegalArgumentException.class)
public void should_require_exact_remote_breakpoint() {
    InMemoryReferenceSequenceFile ref = new InMemoryReferenceSequenceFile(new String[] { "0", "1" }, new byte[][] { B("CCCAATGGGCCC"), B("TTTAATGGGAAA") });
    // >
    // <
    BreakpointHomology.calculate(ref, new BreakpointSummary(0, FWD, 6, 6, 6, 1, BWD, 7, 7, 8), "", 100, 0);
}
Also used : InMemoryReferenceSequenceFile(au.edu.wehi.idsv.picard.InMemoryReferenceSequenceFile) BreakpointSummary(au.edu.wehi.idsv.BreakpointSummary) Test(org.junit.Test)

Example 5 with BreakpointSummary

use of au.edu.wehi.idsv.BreakpointSummary 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)

Aggregations

BreakpointSummary (au.edu.wehi.idsv.BreakpointSummary)25 Test (org.junit.Test)19 BreakendSummary (au.edu.wehi.idsv.BreakendSummary)10 InMemoryReferenceSequenceFile (au.edu.wehi.idsv.picard.InMemoryReferenceSequenceFile)7 MockDirectedBreakpoint (au.edu.wehi.idsv.MockDirectedBreakpoint)4 BreakendDirection (au.edu.wehi.idsv.BreakendDirection)2 IdsvVariantContext (au.edu.wehi.idsv.IdsvVariantContext)2 IdsvVariantContextBuilder (au.edu.wehi.idsv.IdsvVariantContextBuilder)2 MockDirectedEvidence (au.edu.wehi.idsv.MockDirectedEvidence)2 VariantContextDirectedBreakpoint (au.edu.wehi.idsv.VariantContextDirectedBreakpoint)2 ProcessingContext (au.edu.wehi.idsv.ProcessingContext)1 StructuralVariationCallBuilder (au.edu.wehi.idsv.StructuralVariationCallBuilder)1 VariantContextDirectedEvidence (au.edu.wehi.idsv.VariantContextDirectedEvidence)1 Node (au.edu.wehi.idsv.graph.MaximumCliqueIntervalGraph.Node)1 TwoBitBufferedReferenceSequenceFile (au.edu.wehi.idsv.picard.TwoBitBufferedReferenceSequenceFile)1 VcfFilter (au.edu.wehi.idsv.vcf.VcfFilter)1 VariantContext (htsjdk.variant.variantcontext.VariantContext)1 VariantContextWriter (htsjdk.variant.variantcontext.writer.VariantContextWriter)1 ArrayList (java.util.ArrayList)1 ExecutorService (java.util.concurrent.ExecutorService)1