Search in sources :

Example 1 with VcfFilter

use of au.edu.wehi.idsv.vcf.VcfFilter in project gridss by PapenfussLab.

the class StructuralVariationCallBuilder method applyFilters.

public VariantContextDirectedEvidence applyFilters(VariantContextDirectedEvidence variant) {
    List<VcfFilter> filters = processContext.getVariantCallingParameters().calculateBreakendFilters(variant);
    if (variant instanceof VariantContextDirectedBreakpoint) {
        filters.addAll(processContext.getVariantCallingParameters().calculateBreakpointFilters((VariantContextDirectedBreakpoint) variant));
    }
    if (!filters.isEmpty()) {
        VariantContextBuilder builder = new VariantContextBuilder(variant);
        for (VcfFilter f : filters) {
            builder.filter(f.filter());
        }
        variant = (VariantContextDirectedEvidence) IdsvVariantContext.create(processContext, variant.source, builder.make());
    }
    return variant;
}
Also used : VariantContextBuilder(htsjdk.variant.variantcontext.VariantContextBuilder) VcfFilter(au.edu.wehi.idsv.vcf.VcfFilter)

Example 2 with VcfFilter

use of au.edu.wehi.idsv.vcf.VcfFilter in project gridss by PapenfussLab.

the class VariantCallingConfiguration method calculateBreakpointFilters.

public List<VcfFilter> calculateBreakpointFilters(VariantContextDirectedBreakpoint call) {
    List<VcfFilter> filters = Lists.newArrayList();
    BreakpointSummary bp = call.getBreakendSummary();
    if (call.getEventSize() != null && call.getEventSize() < minSize) {
        // over 90% of events are small. Since most SV analysis excludes such events
        // we allow the default output
        filters.add(VcfFilter.SMALL_EVENT);
    }
    if (bp.couldBeReferenceAllele() && call.getUntemplatedSequence().length() == 0) {
        filters.add(VcfFilter.REFERENCE_ALLELE);
    }
    if (call.getBreakpointQual() < minScore || call.getBreakpointEvidenceCount() == 0) {
        filters.add(VcfFilter.LOW_BREAKPOINT_SUPPORT);
    }
    if (call.getBreakpointEvidenceCountAssembly() == 0 && call.getBreakpointEvidenceCountReadPair() + call.getBreakpointEvidenceCountSoftClip() == 1) {
        filters.add(VcfFilter.SINGLE_SUPPORT);
    }
    return filters;
}
Also used : VcfFilter(au.edu.wehi.idsv.vcf.VcfFilter) BreakpointSummary(au.edu.wehi.idsv.BreakpointSummary)

Aggregations

VcfFilter (au.edu.wehi.idsv.vcf.VcfFilter)2 BreakpointSummary (au.edu.wehi.idsv.BreakpointSummary)1 VariantContextBuilder (htsjdk.variant.variantcontext.VariantContextBuilder)1