use of au.edu.wehi.idsv.ProcessingContext in project gridss by PapenfussLab.
the class NonReferenceContigAssemblerTest method should_not_assembly_when_graph_density_exceeds_maximum.
@Test
public void should_not_assembly_when_graph_density_exceeds_maximum() {
ProcessingContext pc = getContext();
MockSAMEvidenceSource ses = SES(10, 10);
pc.getAssemblyParameters().k = 4;
pc.getAssemblyParameters().maxExpectedBreakendLengthMultiple = 1;
pc.getAssemblyParameters().positional.maximumNodeDensity = 0.1f;
List<DirectedEvidence> e = new ArrayList<>();
for (int i = 1; i < 101; i++) {
e.add(SCE(FWD, ses, withReadName(String.format("%d-%d", i, 0), withSequence("AAAATTGG", Read(0, i, "4M4S")))[0]));
e.add(SCE(FWD, ses, withReadName(String.format("%d-%d", i, 1), withSequence("AAAACCGG", Read(0, i, "4M4S")))[0]));
}
List<SAMRecord> output = go(pc, false, e.toArray(new DirectedEvidence[0]));
// the final advance doesn't get flushed since the underlying stream
// is considered to advance to Integer.MAX_VALUE at end of input
assertTrue(output.size() <= 20);
// shouldn't get throttled
pc.getAssemblyParameters().positional.maximumNodeDensity = 10;
output = go(pc, false, e.toArray(new DirectedEvidence[0]));
assertEquals(2 * 100, output.size());
}
use of au.edu.wehi.idsv.ProcessingContext in project gridss by PapenfussLab.
the class NonReferenceContigAssemblerTest method should_call_overlapping_sc_rp.
@Test
public void should_call_overlapping_sc_rp() {
ProcessingContext pc = getContext();
pc.getAssemblyParameters().k = 4;
SoftClipEvidence sce = SCE(FWD, withSequence("ACGTGGTCGACC", Read(0, 50, "6M6S")));
DiscordantReadPair e = (DiscordantReadPair) NRRP(SES(10, 200), withSequence("GACCTCTACT", DP(0, 25, "10M", true, 1, 1, "10M", false)));
List<SAMRecord> output = go(pc, true, sce, e);
assertEquals(1, output.size());
assertEquals("ACGTGGTCGACCTCTACT", S(output.get(0).getReadBases()));
}
use of au.edu.wehi.idsv.ProcessingContext in project gridss by PapenfussLab.
the class NonReferenceContigAssemblerTest method should_remove_misassembled_partial_paths.
@Test
public void should_remove_misassembled_partial_paths() {
ProcessingContext pc = getContext();
MockSAMEvidenceSource ses = SES(10, 10);
pc.getAssemblyParameters().k = 4;
pc.getAssemblyParameters().maxExpectedBreakendLengthMultiple = 1;
List<DirectedEvidence> e = new ArrayList<>();
for (int i = 1; i < 100; i++) {
e.add(SCE(FWD, ses, withReadName(String.format("%d-%d", 0, i), withSequence("TAAAAAAAAAAAAAAAAAAAAAAAAAAAA", Read(0, i * 20, "4M25S")))[0]));
}
List<SAMRecord> output = go(pc, false, e.toArray(new DirectedEvidence[0]));
// the rest should have been removed
assertEquals(1, output.size());
}
use of au.edu.wehi.idsv.ProcessingContext 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);
}
use of au.edu.wehi.idsv.ProcessingContext in project gridss by PapenfussLab.
the class NonReferenceContigAssemblerTest method should_call_simple_fwd_SC.
@Test
public void should_call_simple_fwd_SC() {
ProcessingContext pc = getContext();
pc.getAssemblyParameters().k = 4;
SoftClipEvidence sce = SCE(FWD, withSequence("ACGTGGTCGACC", Read(0, 5, "6M6S")));
List<SAMRecord> output = go(pc, true, sce);
assertEquals(1, output.size());
assertEquals("ACGTGGTCGACC", S(output.get(0).getReadBases()));
assertEquals("6M6S", output.get(0).getCigarString());
assertEquals(0, (int) output.get(0).getReferenceIndex());
assertEquals(5, output.get(0).getAlignmentStart());
}
Aggregations