Search in sources :

Example 1 with StructuralVariationCallBuilder

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;
}
Also used : StructuralVariationCallBuilder(au.edu.wehi.idsv.StructuralVariationCallBuilder) VariantCallingConfiguration(au.edu.wehi.idsv.configuration.VariantCallingConfiguration) DirectedEvidence(au.edu.wehi.idsv.DirectedEvidence) VariantContextDirectedBreakpoint(au.edu.wehi.idsv.VariantContextDirectedBreakpoint)

Example 2 with StructuralVariationCallBuilder

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();
}
Also used : ProcessingContext(au.edu.wehi.idsv.ProcessingContext) IdsvVariantContextBuilder(au.edu.wehi.idsv.IdsvVariantContextBuilder) StructuralVariationCallBuilder(au.edu.wehi.idsv.StructuralVariationCallBuilder) ExecutorService(java.util.concurrent.ExecutorService) VariantContextDirectedBreakpoint(au.edu.wehi.idsv.VariantContextDirectedBreakpoint) BreakpointSummary(au.edu.wehi.idsv.BreakpointSummary) Test(org.junit.Test)

Aggregations

StructuralVariationCallBuilder (au.edu.wehi.idsv.StructuralVariationCallBuilder)2 VariantContextDirectedBreakpoint (au.edu.wehi.idsv.VariantContextDirectedBreakpoint)2 BreakpointSummary (au.edu.wehi.idsv.BreakpointSummary)1 DirectedEvidence (au.edu.wehi.idsv.DirectedEvidence)1 IdsvVariantContextBuilder (au.edu.wehi.idsv.IdsvVariantContextBuilder)1 ProcessingContext (au.edu.wehi.idsv.ProcessingContext)1 VariantCallingConfiguration (au.edu.wehi.idsv.configuration.VariantCallingConfiguration)1 ExecutorService (java.util.concurrent.ExecutorService)1 Test (org.junit.Test)1