Search in sources :

Example 36 with ProcessingContext

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

the class NonReferenceContigAssemblerTest method should_handle_ambigious_bases.

@Test
public void should_handle_ambigious_bases() {
    ProcessingContext pc = getContext();
    pc.getAssemblyParameters().k = 4;
    pc.getAssemblyParameters().includePairAnchors = false;
    List<SAMRecord> output = go(pc, true, NRRP(SES(1, 100), withSequence("AATAAGAGT", DP(1, 100, "9M", false, 1, 1, "9M", true))), NRRP(SES(1, 100), withSequence("AATGNGAGTC", DP(1, 101, "10M", false, 1, 1, "10M", true))));
    assertEquals(1, output.size());
    assertEquals("AATAAGAGTC" + "NN", S(output.get(0).getReadBases()));
}
Also used : ProcessingContext(au.edu.wehi.idsv.ProcessingContext) SAMRecord(htsjdk.samtools.SAMRecord) Test(org.junit.Test)

Example 37 with ProcessingContext

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

the class NonReferenceContigAssemblerTest method anchor_should_be_trimmed_at_max_length.

@Test
public void anchor_should_be_trimmed_at_max_length() {
    ProcessingContext pc = getContext();
    pc.getAssemblyParameters().k = 3;
    List<SAMRecord> output = go(pc, true, SCE(FWD, withSequence("AAAAAAAAAT", Read(0, 1, "9M1S"))), SCE(FWD, withSequence("AAAAAAAAAT", Read(0, 2, "9M1S"))), SCE(FWD, withSequence("AAAAAAAAAT", Read(0, 3, "9M1S"))), SCE(FWD, withSequence("AAAAAAAAAT", Read(0, 4, "9M1S"))), SCE(FWD, withSequence("AAAAAAAAAT", Read(0, 5, "9M1S"))), SCE(FWD, withSequence("AAAAAAAAAT", Read(0, 6, "9M1S"))), SCE(FWD, withSequence("AAAAAAAAAT", Read(0, 7, "9M1S"))), SCE(FWD, withSequence("AAAAAAAAAT", Read(0, 8, "9M1S"))), SCE(FWD, withSequence("AAAAAAAAAT", Read(0, 9, "9M1S"))), SCE(FWD, withSequence("AAAAAAAAAT", Read(0, 10, "9M1S"))), SCE(FWD, withSequence("AAAAAAAAAT", Read(0, 11, "9M1S"))), SCE(FWD, withSequence("AAAAAAAAAT", Read(0, 12, "9M1S"))), SCE(FWD, withSequence("AAAAAAAAAT", Read(0, 13, "9M1S"))), SCE(FWD, withSequence("AAAAAAAAAT", Read(0, 14, "9M1S"))), SCE(FWD, withSequence("AATTTTTTTTT", Read(0, 18, "2M9S"))));
    assertEquals("AAAAAAAAAAATTTTTTTTT", S(output.get(0).getReadBases()));
}
Also used : ProcessingContext(au.edu.wehi.idsv.ProcessingContext) SAMRecord(htsjdk.samtools.SAMRecord) Test(org.junit.Test)

Example 38 with ProcessingContext

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

the class NonReferenceContigAssemblerTest method should_assembly_UM_into_anchor.

@Test
public void should_assembly_UM_into_anchor() {
    ProcessingContext pc = getContext();
    pc.getAssemblyParameters().k = 4;
    pc.getAssemblyParameters().includePairAnchors = true;
    pc.getAssemblyParameters().pairAnchorMismatchIgnoreEndBases = 0;
    SAMRecord[] rp = OEA(0, 100, "10M", true);
    rp[0].setReadBases(B(S(RANDOM).substring(0, 10)));
    rp[1].setReadBases(B(S(RANDOM).substring(2, 12)));
    rp[1].setReadNegativeStrandFlag(true);
    NonReferenceReadPair nrrp = NRRP(SES(1, 100), rp);
    List<SAMRecord> output = go(pc, false, nrrp);
    assertEquals(S(RANDOM).substring(0, 12), S(output.get(0).getReadBases()));
    assertEquals(0, (int) output.get(0).getReferenceIndex());
    assertEquals(100, output.get(0).getAlignmentStart());
    assertEquals("10M2S", output.get(0).getCigarString());
}
Also used : NonReferenceReadPair(au.edu.wehi.idsv.NonReferenceReadPair) ProcessingContext(au.edu.wehi.idsv.ProcessingContext) SAMRecord(htsjdk.samtools.SAMRecord) Test(org.junit.Test)

Example 39 with ProcessingContext

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

the class NonReferenceContigAssemblerTest method should_truncate_anchored_polyA_expansion_fwd.

@Test
public void should_truncate_anchored_polyA_expansion_fwd() {
    ProcessingContext pc = getContext();
    pc.getAssemblyParameters().k = 4;
    SoftClipEvidence sce = SCE(FWD, withSequence("GTACAAAA", Read(0, 10, "4M4S")));
    DiscordantReadPair dp = (DiscordantReadPair) NRRP(SES(11, 100), withSequence("CAAAAT", DP(0, 1, "6M", true, 1, 1, "6M", false)));
    List<SAMRecord> output = go(pc, true, sce, dp);
    assertEquals(1, output.size());
    assertEquals("GTACAAAA", S(output.get(0).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 40 with ProcessingContext

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

the class NonReferenceContigAssemblerTest method should_call_simple_bwd_RP.

@Test
public void should_call_simple_bwd_RP() {
    ProcessingContext pc = getContext();
    pc.getAssemblyParameters().k = 4;
    MockSAMEvidenceSource ses = SES(100, 200);
    DiscordantReadPair e = (DiscordantReadPair) NRRP(ses, withSequence("ACGTGGTCGACC", DP(0, 450, "12M", false, 1, 1, "12M", true)));
    List<SAMRecord> output = go(pc, true, e);
    assertEquals(1, output.size());
    SoftClipEvidence ass = SoftClipEvidence.create(AES(ses), BWD, output.get(0));
    assertEquals(e.getBreakendSummary().localBreakend(), ass.getBreakendSummary());
    assertEquals("ACGTGGTCGACC", S(ass.getBreakendSequence()));
    assertEquals("", S(ass.getAnchorSequence()));
}
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)

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