use of au.edu.wehi.idsv.ProcessingContext in project gridss by PapenfussLab.
the class NonReferenceContigAssemblerTest method should_handle_multiple_candidate_offsets_for_a_single_kmer_position.
@Test
public void should_handle_multiple_candidate_offsets_for_a_single_kmer_position() {
ProcessingContext pc = getContext();
pc.getAssemblyParameters().k = 4;
pc.getAssemblyParameters().includePairAnchors = false;
List<SAMRecord> output = go(pc, true, NRRP(SES(1, 100), withSequence("TAAAAA", DP(1, 100, "6M", false, 0, 1, "6M", true))));
assertEquals(1, output.size());
assertEquals("TAAAAA" + "NN", S(output.get(0).getReadBases()));
}
use of au.edu.wehi.idsv.ProcessingContext in project gridss by PapenfussLab.
the class NonReferenceContigAssemblerTest method bwd_anchor_length_calculation_should_not_include_any_nonreference_bases.
@Test
public void bwd_anchor_length_calculation_should_not_include_any_nonreference_bases() {
ProcessingContext pc = getContext();
pc.getAssemblyParameters().k = 2;
List<SAMRecord> output = go(pc, true, SCE(BWD, withSequence("AAAAAAAAAT", Read(0, 10, "9S1M"))), SCE(BWD, withSequence("ATTTTTTTTT", Read(0, 10, "1S9M"))));
assertEquals(1, output.size());
assertEquals("AAAAAAAAATTTTTTTTT", S(output.get(0).getReadBases()));
}
use of au.edu.wehi.idsv.ProcessingContext in project gridss by PapenfussLab.
the class KmerEvidence method getReferenceContigLength.
/**
* Finds the length of the reference sequence on which this kmer is placed
* @param e
* @return
*/
private static int getReferenceContigLength(DirectedEvidence e) {
int refIndex = e.getBreakendSummary().referenceIndex;
EvidenceSource source = e.getEvidenceSource();
if (source != null) {
ProcessingContext context = source.getContext();
if (context != null) {
return context.getReference().getSequenceDictionary().getSequence(refIndex).getSequenceLength();
}
}
return Integer.MAX_VALUE;
}
use of au.edu.wehi.idsv.ProcessingContext in project gridss by PapenfussLab.
the class AllocateEvidenceTest method should_annotate_reads.
@Test
public void should_annotate_reads() throws IOException {
final ProcessingContext pc = getCommandlineContext();
pc.getVariantCallingParameters().minScore = 0;
pc.getVariantCallingParameters().minSize = 0;
createInput(RP(0, 1, 10), DP(0, 1, "5M5S", true, 1, 10, "5M", true), DP(0, 2, "5M5S", true, 1, 10, "5M", true));
SAMEvidenceSource ses = new SAMEvidenceSource(getContext(), input, null, 0);
ses.ensureMetrics();
File assemblyFile = new File(testFolder.getRoot(), "assembly.bam");
AssemblyEvidenceSource aes = new AssemblyEvidenceSource(pc, ImmutableList.of(ses), assemblyFile);
aes.assembleBreakends(null);
aes.ensureExtracted();
VariantCaller caller = new VariantCaller(pc, ImmutableList.of(ses), aes);
caller.callBreakends(output, MoreExecutors.newDirectExecutorService());
AllocateEvidence cmd = new AllocateEvidence();
cmd.INPUT_VCF = output;
cmd.setContext(pc);
cmd.setAssemblySource(aes);
cmd.setSamEvidenceSources(ImmutableList.of(ses));
cmd.OUTPUT_VCF = new File(testFolder.getRoot(), "annotated.vcf");
List<VariantContextDirectedBreakpoint> vcfs = Lists.newArrayList(Iterables.filter(getVcf(output, null), VariantContextDirectedBreakpoint.class));
// both breakends
assertEquals(2 * 1, vcfs.size());
assertSymmetrical(vcfs);
List<VariantContextDirectedBreakpoint> results = Lists.newArrayList(cmd.iterator(new AutoClosingIterator<>(vcfs.iterator()), MoreExecutors.newDirectExecutorService()));
assertSymmetrical(results);
assertEquals(vcfs.size(), results.size());
VariantContextDirectedBreakpoint e = results.get(0);
assertEquals(2, e.getBreakpointEvidenceCount());
assertEquals(2, e.getBreakendEvidenceCountSoftClip());
}
use of au.edu.wehi.idsv.ProcessingContext in project gridss by PapenfussLab.
the class AllocateEvidenceTest method should_apply_filters.
@Test
public void should_apply_filters() throws IOException {
final ProcessingContext pc = getCommandlineContext();
pc.getVariantCallingParameters().minScore = 0;
pc.getVariantCallingParameters().minSize = 0;
createInput(RP(0, 1, 10), DP(0, 1, "5M5S", true, 1, 10, "5M", true));
SAMEvidenceSource ses = new SAMEvidenceSource(getContext(), input, null, 0);
ses.ensureMetrics();
File assemblyFile = new File(testFolder.getRoot(), "assembly.bam");
AssemblyEvidenceSource aes = new AssemblyEvidenceSource(pc, ImmutableList.of(ses), assemblyFile);
aes.assembleBreakends(null);
aes.ensureExtracted();
VariantCaller caller = new VariantCaller(pc, ImmutableList.of(ses), aes);
caller.callBreakends(output, MoreExecutors.newDirectExecutorService());
AllocateEvidence cmd = new AllocateEvidence();
cmd.INPUT_VCF = output;
cmd.setContext(pc);
cmd.setAssemblySource(aes);
cmd.setSamEvidenceSources(ImmutableList.of(ses));
cmd.OUTPUT_VCF = new File(testFolder.getRoot(), "annotated.vcf");
List<VariantContextDirectedBreakpoint> vcfs = Lists.newArrayList(Iterables.filter(getVcf(output, null), VariantContextDirectedBreakpoint.class));
// both breakends
assertEquals(2 * 1, vcfs.size());
assertSymmetrical(vcfs);
List<VariantContextDirectedBreakpoint> results = Lists.newArrayList(cmd.iterator(new AutoClosingIterator<>(vcfs.iterator()), MoreExecutors.newDirectExecutorService()));
assertSymmetrical(results);
// single read support
assertEquals(0, results.size());
}
Aggregations