Search in sources :

Example 41 with ProcessingContext

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

the class NonReferenceContigAssemblerTest method should_call_multiple_nonoverlapping_contigs.

@Test
public void should_call_multiple_nonoverlapping_contigs() {
    ProcessingContext pc = getContext();
    pc.getAssemblyParameters().k = 4;
    SoftClipEvidence sce = SCE(FWD, withSequence("ACGTGGTCGACC", Read(0, 5, "6M6S")));
    DiscordantReadPair e = (DiscordantReadPair) NRRP(SES(100, 200), withSequence("GACCTCTACT", DP(0, 25, "10M", true, 1, 1, "10M", false)));
    List<SAMRecord> output = go(pc, true, sce, e);
    assertEquals(2, output.size());
    assertEquals("ACGTGGTCGACC", S(output.get(0).getReadBases()));
    assertEquals("NN" + "GACCTCTACT", S(output.get(1).getReadBases()));
}
Also used : ProcessingContext(au.edu.wehi.idsv.ProcessingContext) SoftClipEvidence(au.edu.wehi.idsv.SoftClipEvidence) SAMRecord(htsjdk.samtools.SAMRecord) DiscordantReadPair(au.edu.wehi.idsv.DiscordantReadPair) Test(org.junit.Test)

Example 42 with ProcessingContext

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

the class PositionalAssemblerTest method should_set_assembly_direction.

@Test
public void should_set_assembly_direction() {
    ProcessingContext pc = getContext();
    pc.getAssemblyParameters().k = 4;
    pc.getAssemblyParameters().maxExpectedBreakendLengthMultiple = 10;
    List<DirectedEvidence> e = new ArrayList<>();
    // ACGTACGTACGTACGTACGT
    // 12345678901234567890
    // MMMM----MMMM
    // MMMM>>>>
    e.add(SCE(FWD, withSequence("ACGTCCGGACGG", Read(1, 1, "4M8S"))[0]));
    e.add(SCE(FWD, withSequence("ACGGTTGT", Read(1, 9, "4M4S"))[0]));
    e.sort(DirectedEvidenceOrder.ByStartEnd);
    ArrayList<SAMRecord> output = Lists.newArrayList(new PositionalAssembler(pc, AES(pc), new SequentialIdGenerator("asm"), e.iterator(), BreakendDirection.Forward));
    for (SAMRecord r : output) {
        assertEquals(BreakendDirection.Forward, new AssemblyAttributes(r).getAssemblyDirection());
    }
}
Also used : ProcessingContext(au.edu.wehi.idsv.ProcessingContext) DirectedEvidence(au.edu.wehi.idsv.DirectedEvidence) SAMRecord(htsjdk.samtools.SAMRecord) ArrayList(java.util.ArrayList) SequentialIdGenerator(au.edu.wehi.idsv.SequentialIdGenerator) AssemblyAttributes(au.edu.wehi.idsv.AssemblyAttributes) Test(org.junit.Test)

Example 43 with ProcessingContext

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

the class PositionalAssemblerTest method anchor_should_not_overrun_contig_start.

@Test
public void anchor_should_not_overrun_contig_start() {
    ProcessingContext pc = getContext();
    AssemblyEvidenceSource aes = AES(pc);
    pc.getAssemblyParameters().k = 4;
    List<DirectedEvidence> input = new ArrayList<DirectedEvidence>();
    input.add(SCE(FWD, withSequence("CGTAACCGGTTC", Read(0, 1, "1M2I4M5S"))));
    ArrayList<SAMRecord> r = Lists.newArrayList(new PositionalAssembler(pc, aes, new SequentialIdGenerator("asm"), input.iterator()));
    assertEquals(1, r.size());
    assertEquals(1, r.get(0).getAlignmentStart());
}
Also used : ProcessingContext(au.edu.wehi.idsv.ProcessingContext) AssemblyEvidenceSource(au.edu.wehi.idsv.AssemblyEvidenceSource) DirectedEvidence(au.edu.wehi.idsv.DirectedEvidence) SAMRecord(htsjdk.samtools.SAMRecord) ArrayList(java.util.ArrayList) SequentialIdGenerator(au.edu.wehi.idsv.SequentialIdGenerator) Test(org.junit.Test)

Example 44 with ProcessingContext

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

the class PositionalAssemblerTest method anchor_should_not_overrun_contig_end.

@Test
public void anchor_should_not_overrun_contig_end() {
    ProcessingContext pc = getContext();
    AssemblyEvidenceSource aes = AES(pc);
    pc.getAssemblyParameters().k = 4;
    List<DirectedEvidence> input = new ArrayList<DirectedEvidence>();
    input.add(SCE(BWD, withSequence("CGTAACCGGTTC", Read(0, 9996, "5S4M2I1M"))));
    ArrayList<SAMRecord> r = Lists.newArrayList(new PositionalAssembler(pc, aes, new SequentialIdGenerator("asm"), input.iterator()));
    assertEquals(1, r.size());
    assertEquals(10000, r.get(0).getAlignmentEnd());
}
Also used : ProcessingContext(au.edu.wehi.idsv.ProcessingContext) AssemblyEvidenceSource(au.edu.wehi.idsv.AssemblyEvidenceSource) DirectedEvidence(au.edu.wehi.idsv.DirectedEvidence) SAMRecord(htsjdk.samtools.SAMRecord) ArrayList(java.util.ArrayList) SequentialIdGenerator(au.edu.wehi.idsv.SequentialIdGenerator) Test(org.junit.Test)

Example 45 with ProcessingContext

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

the class PositionalAssemblerTest method should_assemble_each_read_alignment_only_once.

@Test
public void should_assemble_each_read_alignment_only_once() {
    ProcessingContext pc = getContext();
    AssemblyEvidenceSource aes = AES(pc);
    pc.getAssemblyParameters().k = 4;
    String seq = "AACCGGTTAA";
    List<DirectedEvidence> input = new ArrayList<DirectedEvidence>();
    input.add(SCE(FWD, withSequence(seq, Read(0, 10, "5M5S"))[0]));
    input.add(SCE(FWD, withSequence(seq, Read(0, 10, "5M5S"))[0]));
    input.add(SCE(FWD, withSequence(seq, Read(0, 10, "5M5S"))[0]));
    input.add(IE(withSequence(seq, Read(0, 10, "5M100D5M"))[0]));
    input.add(IE(withSequence(seq, Read(0, 10, "5M100D5M"))[0]));
    input.add(IE(withSequence(seq, Read(0, 10, "5M100D5M"))[0]));
    input.sort(DirectedEvidenceOrder.ByStartEnd);
    ArrayList<SAMRecord> r = Lists.newArrayList(new PositionalAssembler(pc, aes, new SequentialIdGenerator("asm"), input.iterator()));
    assertEquals(2, ((int[]) r.get(0).getAttribute("sc"))[0]);
}
Also used : ProcessingContext(au.edu.wehi.idsv.ProcessingContext) AssemblyEvidenceSource(au.edu.wehi.idsv.AssemblyEvidenceSource) DirectedEvidence(au.edu.wehi.idsv.DirectedEvidence) SAMRecord(htsjdk.samtools.SAMRecord) ArrayList(java.util.ArrayList) SequentialIdGenerator(au.edu.wehi.idsv.SequentialIdGenerator) Test(org.junit.Test)

Aggregations

ProcessingContext (au.edu.wehi.idsv.ProcessingContext)46 Test (org.junit.Test)39 SAMRecord (htsjdk.samtools.SAMRecord)30 AssemblyEvidenceSource (au.edu.wehi.idsv.AssemblyEvidenceSource)15 DirectedEvidence (au.edu.wehi.idsv.DirectedEvidence)14 ArrayList (java.util.ArrayList)14 SoftClipEvidence (au.edu.wehi.idsv.SoftClipEvidence)13 SAMEvidenceSource (au.edu.wehi.idsv.SAMEvidenceSource)10 DiscordantReadPair (au.edu.wehi.idsv.DiscordantReadPair)8 SequentialIdGenerator (au.edu.wehi.idsv.SequentialIdGenerator)8 VariantContextDirectedBreakpoint (au.edu.wehi.idsv.VariantContextDirectedBreakpoint)7 File (java.io.File)7 IntermediateFilesTest (au.edu.wehi.idsv.IntermediateFilesTest)6 VariantCaller (au.edu.wehi.idsv.VariantCaller)5 AutoClosingIterator (au.edu.wehi.idsv.util.AutoClosingIterator)5 AssemblyAttributes (au.edu.wehi.idsv.AssemblyAttributes)3 NonReferenceReadPair (au.edu.wehi.idsv.NonReferenceReadPair)3 BreakendSummary (au.edu.wehi.idsv.BreakendSummary)2 DirectedBreakpoint (au.edu.wehi.idsv.DirectedBreakpoint)2 SingleReadEvidence (au.edu.wehi.idsv.SingleReadEvidence)2