Search in sources :

Example 11 with InMemoryReferenceSequenceFile

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

the class BreakpointHomologyTest method should_require_exact_local_breakpoint.

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

Example 12 with InMemoryReferenceSequenceFile

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

the class BreakpointHomologyTest method should_not_exceed_contig_bounds.

@Test
public void should_not_exceed_contig_bounds() {
    InMemoryReferenceSequenceFile underlying = new InMemoryReferenceSequenceFile(new String[] { "0", "1" }, new byte[][] { B("CCCCCCCCCCC"), B("AAAAAAAAAAA") });
    // BreakpointHomology bh0 = BreakpointHomology.calculate(ref, new BreakpointSummary(0, FWD, 1, 1, BWD, 20), "", 50, 50);
    TwoBitBufferedReferenceSequenceFile ref = new TwoBitBufferedReferenceSequenceFile(underlying);
    for (int b1pos = 1; b1pos <= ref.getSequenceDictionary().getSequences().get(0).getSequenceLength(); b1pos++) {
        for (int b2pos = 1; b2pos <= ref.getSequenceDictionary().getSequences().get(0).getSequenceLength(); b2pos++) {
            for (BreakendDirection b1dir : BreakendDirection.values()) {
                for (BreakendDirection b2dir : BreakendDirection.values()) {
                    for (int maxBreakendLength = 1; maxBreakendLength < ref.getSequenceDictionary().getSequences().get(0).getSequenceLength() + 2; maxBreakendLength++) {
                        for (int margin = 0; margin < ref.getSequenceDictionary().getSequences().get(0).getSequenceLength() + 2; margin++) {
                            BreakpointHomology bh = BreakpointHomology.calculate(ref, new BreakpointSummary(0, b1dir, b1pos, 1, b2dir, b2pos), "", maxBreakendLength, margin);
                            assertEquals(0, bh.getLocalHomologyLength());
                            assertEquals(0, bh.getRemoteHomologyLength());
                        }
                    }
                }
            }
        }
    }
}
Also used : TwoBitBufferedReferenceSequenceFile(au.edu.wehi.idsv.picard.TwoBitBufferedReferenceSequenceFile) InMemoryReferenceSequenceFile(au.edu.wehi.idsv.picard.InMemoryReferenceSequenceFile) BreakendDirection(au.edu.wehi.idsv.BreakendDirection) BreakpointSummary(au.edu.wehi.idsv.BreakpointSummary) Test(org.junit.Test)

Example 13 with InMemoryReferenceSequenceFile

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

the class BreakpointHomologyTest method should_incorporate_inserted_sequence.

@Test
public void should_incorporate_inserted_sequence() {
    InMemoryReferenceSequenceFile ref = new InMemoryReferenceSequenceFile(new String[] { "0", "1" }, new byte[][] { B("CCCAAAATTTGGGAAAAAATTTTTTTTTTTTTTTTTTT"), B("TTTAAAATTTGGGAAAAAAGGGGGGGGGGGGGGGGGGG") });
    // CCCAAAATTT GGGAAAAAATTTTTTTTTTT TTTTTTTT"),
    // TTTAAAATTT GGGAAAAAAGGGGGGGGGGG GGGGGGGG"
    // MMMMMMMMMMMMMMMMMMMSSSSSSSSSSSS fwd
    // SSSMMMMMMMMMMMMMMMMMMMMMMMMMMMM bwd
    // 1234567890 1234567890
    // >G
    // <
    // 
    BreakpointHomology bh = BreakpointHomology.calculate(ref, new BreakpointSummary(0, FWD, 10, 1, BWD, 11), "c", 20, 10);
    assertEquals(7, bh.getLocalHomologyLength());
    assertEquals(9, bh.getRemoteHomologyLength());
}
Also used : InMemoryReferenceSequenceFile(au.edu.wehi.idsv.picard.InMemoryReferenceSequenceFile) BreakpointSummary(au.edu.wehi.idsv.BreakpointSummary) Test(org.junit.Test)

Aggregations

InMemoryReferenceSequenceFile (au.edu.wehi.idsv.picard.InMemoryReferenceSequenceFile)13 Test (org.junit.Test)11 BreakpointSummary (au.edu.wehi.idsv.BreakpointSummary)7 SAMFileHeader (htsjdk.samtools.SAMFileHeader)5 SAMRecord (htsjdk.samtools.SAMRecord)5 BreakendDirection (au.edu.wehi.idsv.BreakendDirection)1 TwoBitBufferedReferenceSequenceFile (au.edu.wehi.idsv.picard.TwoBitBufferedReferenceSequenceFile)1 Header (htsjdk.samtools.metrics.Header)1 Ignore (org.junit.Ignore)1