use of au.edu.wehi.idsv.StructuralVariationCallBuilder in project gridss by PapenfussLab.
the class AllocateEvidence method annotate.
private VariantContextDirectedBreakpoint annotate(VariantEvidenceSupport ves) {
VariantCallingConfiguration vc = getContext().getConfig().getVariantCalling();
StructuralVariationCallBuilder builder = new StructuralVariationCallBuilder(getContext(), ves.variant);
for (DirectedEvidence e : ves.support) {
boolean shouldExclude = false;
if (!shouldExclude) {
builder.addEvidence(e);
}
}
VariantContextDirectedBreakpoint bp = (VariantContextDirectedBreakpoint) builder.make();
if (!vc.writeFiltered) {
if (bp.getBreakpointQual() < vc.minScore)
return null;
if (bp.getBreakpointEvidenceCount() < vc.minReads)
return null;
if (bp.isFiltered())
return null;
}
bp = (VariantContextDirectedBreakpoint) vc.applyConfidenceFilter(getContext(), bp);
return bp;
}
use of au.edu.wehi.idsv.StructuralVariationCallBuilder in project gridss by PapenfussLab.
the class AnnotateInexactHomologyTest method should_calculate_inexact_homology.
@Test
public void should_calculate_inexact_homology() {
ProcessingContext pc = getContext();
StructuralVariationCallBuilder builder = new StructuralVariationCallBuilder(pc, (VariantContextDirectedEvidence) new IdsvVariantContextBuilder(getContext()) {
{
breakpoint(new BreakpointSummary(2, FWD, 78, 6, BWD, 79), "");
phredScore(50);
}
}.make());
builder.addEvidence(SR(Read(2, 78, "1M1S"), Read(6, 79, "1M")));
VariantContextDirectedBreakpoint e = (VariantContextDirectedBreakpoint) builder.make();
AnnotateInexactHomology aih = new AnnotateInexactHomology();
aih.setContext(pc);
ExecutorService threadpool = Executors.newSingleThreadExecutor();
e = aih.iterator(new AutoClosingIterator<>(ImmutableList.of(e).iterator()), threadpool).next();
assertEquals(-78, ((int[]) e.getAttribute(VcfInfoAttributes.INEXACT_HOMPOS.attribute()))[0]);
assertEquals(300, ((int[]) e.getAttribute(VcfInfoAttributes.INEXACT_HOMPOS.attribute()))[1]);
threadpool.shutdown();
}
Aggregations