Search in sources :

Example 16 with DirectedEvidence

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

the class NonReferenceContigAssemblerTest method should_removeMisassembledPartialContigsDuringAssembly.

@Test
public void should_removeMisassembledPartialContigsDuringAssembly() {
    ProcessingContext pc = getContext();
    pc.getAssemblyParameters().removeMisassembledPartialContigsDuringAssembly = false;
    MockSAMEvidenceSource ses = new MockSAMEvidenceSource(getContext(), 50, 100);
    pc.getAssemblyParameters().k = 4;
    pc.getAssemblyParameters().maxExpectedBreakendLengthMultiple = 1.5f;
    List<DirectedEvidence> e = new ArrayList<>();
    for (int i = 1; i < 1000; i++) {
        e.add(NRRP(ses, OEA(0, i, "10M", true)));
    }
    List<SAMRecord> output = go(pc, false, e.toArray(new DirectedEvidence[0]));
    assertEquals(1, output.size());
    SAMRecord r = output.get(0);
    int sclenFull = SAMRecordUtil.getStartClipLength(r) + SAMRecordUtil.getEndClipLength(r);
    pc.getAssemblyParameters().removeMisassembledPartialContigsDuringAssembly = true;
    output = go(pc, false, e.toArray(new DirectedEvidence[0]));
    assertEquals(1, output.size());
    r = output.get(0);
    int sclenTruncated = SAMRecordUtil.getStartClipLength(r) + SAMRecordUtil.getEndClipLength(r);
    Assert.assertNotEquals(sclenFull, sclenTruncated);
}
Also used : ProcessingContext(au.edu.wehi.idsv.ProcessingContext) DirectedEvidence(au.edu.wehi.idsv.DirectedEvidence) SAMRecord(htsjdk.samtools.SAMRecord) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 17 with DirectedEvidence

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

the class PathNodeIteratorTest method should_handle_repeated_kmers.

@Test
public void should_handle_repeated_kmers() {
    SoftClipEvidence sce = SCE(FWD, withSequence("TTTTTTTTTTTTTTTT", Read(0, 5, "6M10S")));
    DirectedEvidence rp = NRRP(SES(10, 200), withSequence("CCCCCCCCCC", DP(0, 25, "10M", true, 1, 1, "10M", false)));
    List<KmerPathNode> result = asCheckedKPN(4, 100, sce, rp);
    assertCompleteGraph(result, 4);
    // SC: ref repeat; nonref repeat
    // RP: single width starting kmer <-> repeat cycle <-> single width ending kmer
    assertEquals(5, result.size());
}
Also used : SoftClipEvidence(au.edu.wehi.idsv.SoftClipEvidence) DirectedEvidence(au.edu.wehi.idsv.DirectedEvidence) Test(org.junit.Test)

Example 18 with DirectedEvidence

use of au.edu.wehi.idsv.DirectedEvidence 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 19 with DirectedEvidence

use of au.edu.wehi.idsv.DirectedEvidence 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 20 with DirectedEvidence

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

Aggregations

DirectedEvidence (au.edu.wehi.idsv.DirectedEvidence)22 ArrayList (java.util.ArrayList)18 Test (org.junit.Test)18 ProcessingContext (au.edu.wehi.idsv.ProcessingContext)14 SAMRecord (htsjdk.samtools.SAMRecord)14 AssemblyEvidenceSource (au.edu.wehi.idsv.AssemblyEvidenceSource)9 SequentialIdGenerator (au.edu.wehi.idsv.SequentialIdGenerator)8 File (java.io.File)6 Lists (com.google.common.collect.Lists)5 List (java.util.List)5 Collectors (java.util.stream.Collectors)5 NonReferenceReadPair (au.edu.wehi.idsv.NonReferenceReadPair)4 SAMEvidenceSource (au.edu.wehi.idsv.SAMEvidenceSource)4 SoftClipEvidence (au.edu.wehi.idsv.SoftClipEvidence)4 IOException (java.io.IOException)4 Assert.assertEquals (org.junit.Assert.assertEquals)4 Assert.assertTrue (org.junit.Assert.assertTrue)4 BreakendSummary (au.edu.wehi.idsv.BreakendSummary)3 IntermediateFilesTest (au.edu.wehi.idsv.IntermediateFilesTest)3 SingleReadEvidence (au.edu.wehi.idsv.SingleReadEvidence)3