-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate VariantWalkerBase with CountingVariantFilter.
- Loading branch information
Showing
8 changed files
with
100 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 28 additions & 2 deletions
30
src/main/java/org/broadinstitute/hellbender/engine/filters/VariantFilterLibrary.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,35 @@ | ||
package org.broadinstitute.hellbender.engine.filters; | ||
|
||
import htsjdk.variant.variantcontext.VariantContext; | ||
|
||
/** | ||
* Collects common variant filters. | ||
*/ | ||
public final class VariantFilterLibrary { | ||
public static VariantFilter ALLOW_ALL_VARIANTS = variant -> true; | ||
public static VariantFilter NOT_SV_OR_SYMBOLIC = variant -> !variant.isSymbolicOrSV(); | ||
public static VariantFilter ALLOW_ALL_VARIANTS = new AllowAllVariantsVariantFilter(); | ||
public static VariantFilter NOT_SV_OR_SYMBOLIC = new NotSymbolicOrSVVariantFilter(); | ||
public static VariantFilter PASSES_FILTERS = new PassesFiltersVariantFilter(); | ||
|
||
/** Do not filter out any variants. */ | ||
public static class AllowAllVariantsVariantFilter implements VariantFilter { | ||
private static final long serialVersionUID = 1L; | ||
@Override public boolean test(final VariantContext variant) { return true; } | ||
} | ||
|
||
/** Filter out any variants that are symbolic or SV. */ | ||
public static class NotSymbolicOrSVVariantFilter implements VariantFilter { | ||
private static final long serialVersionUID = 1L; | ||
@Override public boolean test(final VariantContext variant) { | ||
return !variant.isSymbolicOrSV(); | ||
} | ||
} | ||
|
||
/** Filter out any variants that fail (variant-level) filters. */ | ||
public static class PassesFiltersVariantFilter implements VariantFilter { | ||
private static final long serialVersionUID = 1L; | ||
@Override public boolean test(final VariantContext variant) { | ||
return !variant.isFiltered(); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters