use of au.edu.wehi.idsv.SoftClipEvidence in project gridss by PapenfussLab.
the class CallVariantsTest method test_sr_rp_assembly.
@Test
public void test_sr_rp_assembly() throws IOException {
List<DirectedEvidence> in = new ArrayList<DirectedEvidence>();
in.add(SCE(FWD, withSequence("AACCGGTTCTA", Read(0, 15, "5M6S"))));
in.add(SCE(FWD, withSequence("AACCGGTTCTA", Read(0, 15, "6M5S"))));
in.add(NRRP(withSequence("AACCGGTTCTA", DP(0, 1, "11M", true, 1, 100, "11M", false))));
in.add(NRRP(withSequence("AACCGGTTCTA", DP(0, 2, "11M", true, 1, 100, "11M", false))));
List<SAMRecord> insam = in.stream().flatMap(de -> {
if (de instanceof SoftClipEvidence)
return ImmutableList.<SAMRecord>of(((SoftClipEvidence) de).getSAMRecord()).stream();
if (de instanceof NonReferenceReadPair)
return ImmutableList.<SAMRecord>of(((NonReferenceReadPair) de).getNonReferenceRead(), ((NonReferenceReadPair) de).getLocalledMappedRead()).stream();
throw new RuntimeException("NYI");
}).collect(Collectors.toList());
insam.addAll(Lists.newArrayList(RP(0, 1, 100, 10)));
createInput(insam);
File propfile = testFolder.newFile("custom.properties");
try (BufferedWriter writer = new BufferedWriter(new FileWriter(propfile))) {
writer.write("assembly.k=5\n");
writer.write("softclip.minLength=1\n");
writer.write("minAnchorShannonEntropy=0\n");
writer.write("softclip.minAnchorIdentity=0\n");
writer.write("softclip.minAverageQual=0\n");
writer.write("realignment.aligner=\n");
}
File assembly = new File(testFolder.getRoot(), "assembly.bam");
String[] args = new String[] { "INPUT=" + input.toString(), "ASSEMBLY=" + assembly.toString(), "REFERENCE_SEQUENCE=" + reference.toString(), "OUTPUT=" + output.toString(), "TMP_DIR=" + super.testFolder.getRoot().toString(), "WORKING_DIR=" + super.testFolder.getRoot().toString(), "CONFIGURATION_FILE=" + propfile.toString(), "INPUT_MIN_FRAGMENT_SIZE=10", "INPUT_MAX_FRAGMENT_SIZE=100" };
assertEquals(0, new CallVariants().instanceMain(args));
List<SAMRecord> breakendAssemblies = getRecords(assembly);
assertEquals(1, breakendAssemblies.size());
assembly.delete();
}
use of au.edu.wehi.idsv.SoftClipEvidence in project gridss by PapenfussLab.
the class KmerEvidenceTest method createAnchor_should_check_reference_overrun.
@Test
public void createAnchor_should_check_reference_overrun() {
SoftClipEvidence placholderEvidence = SCE(BWD, Read(0, 1, "2S5M2S"));
assertEquals(5, nodesNotNull(KmerEvidence.createAnchor(placholderEvidence, 1, Read(0, 1, "2S5M2S"), BWD, 2, SMALL_FA)));
assertEquals(5, nodesNotNull(KmerEvidence.createAnchor(placholderEvidence, 1, Read(0, 1, "2S5M2S"), FWD, 2, SMALL_FA)));
// overruns on both end
assertEquals(2, nodesNotNull(KmerEvidence.createAnchor(placholderEvidence, 1, Read(0, -10, "10M"), FWD, 4, SMALL_FA)));
// end overrun
assertEquals(1, nodesNotNull(KmerEvidence.createAnchor(placholderEvidence, 1, Read(0, 10000, "10M"), FWD, 10, SMALL_FA)));
}
use of au.edu.wehi.idsv.SoftClipEvidence in project gridss by PapenfussLab.
the class CallVariantsTest method should_handle_unpaired_libraries.
@Test
public void should_handle_unpaired_libraries() throws IOException {
List<DirectedEvidence> in = new ArrayList<DirectedEvidence>();
in.add(SCE(FWD, withSequence("AACCGGTTCTA", Read(0, 15, "5M6S"))));
List<SAMRecord> insam = in.stream().flatMap(de -> {
if (de instanceof SoftClipEvidence)
return ImmutableList.<SAMRecord>of(((SoftClipEvidence) de).getSAMRecord()).stream();
if (de instanceof NonReferenceReadPair)
return ImmutableList.<SAMRecord>of(((NonReferenceReadPair) de).getNonReferenceRead(), ((NonReferenceReadPair) de).getLocalledMappedRead()).stream();
throw new RuntimeException("NYI");
}).collect(Collectors.toList());
createInput(insam);
File assembly = new File(testFolder.getRoot(), "assembly.bam");
createBAM(assembly, SortOrder.coordinate);
String[] args = new String[] { "INPUT=" + input.toString(), "ASSEMBLY=" + assembly.toString(), "REFERENCE_SEQUENCE=" + reference.toString(), "OUTPUT=" + output.toString(), "TMP_DIR=" + super.testFolder.getRoot().toString(), "WORKING_DIR=" + super.testFolder.getRoot().toString() };
assertEquals(0, new CallVariants().instanceMain(args));
assertTrue(output.exists());
assembly.delete();
}
use of au.edu.wehi.idsv.SoftClipEvidence in project gridss by PapenfussLab.
the class NonReferenceContigAssemblerTest method should_truncate_anchored_polyA_expansion_bwd.
@Test
public void should_truncate_anchored_polyA_expansion_bwd() {
ProcessingContext pc = getContext();
pc.getAssemblyParameters().k = 4;
SoftClipEvidence sce = SCE(BWD, withSequence("AAAAGTAC", Read(0, 100, "4S4M")));
DiscordantReadPair dp = (DiscordantReadPair) NRRP(SES(11, 100), withSequence("CAAAAG", DP(0, 110, "6M", false, 1, 1, "6M", true)));
List<SAMRecord> output = go(pc, true, sce, dp);
assertEquals(1, output.size());
assertEquals("AAAAGTAC", S(output.get(0).getReadBases()));
}
use of au.edu.wehi.idsv.SoftClipEvidence in project gridss by PapenfussLab.
the class NonReferenceContigAssemblerTest method should_remove_fully_reference_evidence.
@Test
public void should_remove_fully_reference_evidence() {
ProcessingContext pc = getContext();
pc.getAssemblyParameters().k = 4;
SoftClipEvidence sce = SCE(FWD, withSequence("ACGTGGTCGACC", Read(0, 50, "6M6S")));
SoftClipEvidence fullref = SCE(FWD, withSequence("ACGTGG", Read(0, 50, "5M1S")));
List<SAMRecord> output = go(pc, true, sce, fullref);
assertEquals(1, output.size());
assertEquals("ACGTGGTCGACC", S(output.get(0).getReadBases()));
assertEquals(2, tracker.tracking_evidenceTotal());
assertEquals(0, tracker.tracking_evidenceActive());
assertEquals(0, caller.tracking_activeNodes());
}
Aggregations