use of au.edu.wehi.idsv.ProcessingContext in project gridss by PapenfussLab.
the class NonReferenceContigAssemblerTest method should_call_simple_fwd_RP.
@Test
public void should_call_simple_fwd_RP() {
ProcessingContext pc = getContext();
pc.getAssemblyParameters().k = 4;
SAMEvidenceSource ses = SES(100, 200);
DiscordantReadPair e = (DiscordantReadPair) NRRP(ses, withSequence("ACGTGGTCGACC", DP(0, 50, "12M", true, 1, 1, "12M", false)));
List<SAMRecord> output = go(pc, true, e);
assertEquals(1, output.size());
SoftClipEvidence ass = SoftClipEvidence.create(AES(ses), FWD, output.get(0));
assertEquals(e.getBreakendSummary().localBreakend(), ass.getBreakendSummary());
assertEquals("ACGTGGTCGACC", S(ass.getBreakendSequence()));
assertEquals("", S(ass.getAnchorSequence()));
}
use of au.edu.wehi.idsv.ProcessingContext in project gridss by PapenfussLab.
the class NonReferenceContigAssemblerTest method should_call_suboptimal_contigs_if_graph_size_limit_exceeded.
@Test
public void should_call_suboptimal_contigs_if_graph_size_limit_exceeded() {
ProcessingContext pc = getContext();
MockSAMEvidenceSource ses = SES(10, 10);
pc.getAssemblyParameters().k = 4;
pc.getAssemblyParameters().maxExpectedBreakendLengthMultiple = 1;
pc.getAssemblyParameters().positional.retainWidthMultiple = 1;
pc.getAssemblyParameters().positional.flushWidthMultiple = 2;
List<DirectedEvidence> e = new ArrayList<>();
for (int i = 0; i < 100; i++) {
for (int j = 0; j < i + 1; j++) {
e.add(SCE(FWD, ses, withReadName(String.format("%d-%d", i, j), withSequence("AACCGGTT", Read(0, i, "4M4S")))[0]));
}
}
List<SAMRecord> output = go(pc, false, e.toArray(new DirectedEvidence[0]));
assertEquals(100, output.size());
// unbounded execution would call high->low thus call the last contig first
// bounded execution will force the early calls to be made first
List<Integer> startPos = output.stream().map(x -> x.getAlignmentStart()).collect(Collectors.toList());
assertFalse(Ordering.natural().reverse().isOrdered(startPos));
}
use of au.edu.wehi.idsv.ProcessingContext in project gridss by PapenfussLab.
the class NonReferenceContigAssemblerTest method should_not_remove_misassembled_partial_paths_when_could_be_collapsed_with_adjacent_read.
@Test
public void should_not_remove_misassembled_partial_paths_when_could_be_collapsed_with_adjacent_read() {
ProcessingContext pc = getContext();
MockSAMEvidenceSource ses = SES(10, 10);
pc.getAssemblyParameters().k = 2;
pc.getAssemblyParameters().maxExpectedBreakendLengthMultiple = 5;
pc.getAssemblyParameters().removeMisassembledPartialContigsDuringAssembly = true;
pc.getAssemblyParameters().positional.flushWidthMultiple = 100000;
pc.getAssemblyParameters().positional.maxPathLengthMultiple = 4;
List<DirectedEvidence> e = new ArrayList<>();
for (int i = 1; i < 1000; i += 1) {
SAMRecord[] rp = OEA(0, i, "2M", true);
rp[0].setReadBases(B("GG"));
// expect reverse comp of read sequence
rp[1].setReadBases(B("AA"));
e.add(NRRP(ses, rp));
}
go(pc, true, e.toArray(new DirectedEvidence[0]));
}
use of au.edu.wehi.idsv.ProcessingContext in project gridss by PapenfussLab.
the class NonReferenceContigAssemblerTest method should_remove_fully_reference_evidence_before_end.
@Test
public void should_remove_fully_reference_evidence_before_end() {
ProcessingContext pc = getContext();
pc.getAssemblyParameters().k = 4;
int n = 8;
DirectedEvidence[] input = new DirectedEvidence[2 * n];
for (int i = 0; i < n; i++) {
input[2 * i] = SCE(FWD, withSequence("ACGTGGTCGACC", Read(0, 1000 * i, "6M6S")));
input[2 * i + 1] = SCE(FWD, withSequence("AACGTGG", Read(0, 1000 * i - 1, "6M1S")));
}
NonReferenceContigAssembler caller = create(pc, true, input);
for (int i = 0; i < n / 2; i++) {
caller.next();
}
assertTrue(caller.tracking_activeNodes() <= 3);
}
use of au.edu.wehi.idsv.ProcessingContext in project gridss by PapenfussLab.
the class NonReferenceContigAssemblerTest method fwd_anchor_length_calculation_should_not_include_any_nonreference_bases.
@Test
public void fwd_anchor_length_calculation_should_not_include_any_nonreference_bases() {
ProcessingContext pc = getContext();
pc.getAssemblyParameters().k = 2;
List<SAMRecord> output = go(pc, true, SCE(FWD, withSequence("AAAAAAAAAT", Read(0, 1, "9M1S"))), SCE(FWD, withSequence("ATTTTTTTTT", Read(0, 9, "1M9S"))));
assertEquals(1, output.size());
assertEquals("AAAAAAAAATTTTTTTTT", S(output.get(0).getReadBases()));
}
Aggregations