postFilterVariants {VariantTools} | R Documentation |
Applies filters to a set of called variants. The only current filter
is a cutoff on the weighted neighbor count of each variant. This
filtering is performed automatically by callVariants
, so
these functions are for when more control is desired.
postFilterVariants(x, post.filters = VariantPostFilters(...), ...) VariantPostFilters(max.nbor.count = 0.1, whitelist = NULL)
x |
A tally |
post.filters |
The filters applied to the called variants. |
... |
Arguments passed to |
max.nbor.count |
Maximum allowed number of neighbors (weighted by distance) |
whitelist |
Positions to ignore; these will always pass the filter, and are excluded from the neighbor counting. |
The neighbor count is calculated within a 100bp window centered on the variant. Each neighbor is weighted by the inverse square root of the distance to the neighbor. This was motivated by fitting logistic regression models including a term the count (usually 0, 1, 2) at each distance. The inverse square root function best matched the trend in the coefficients.
For postFilterVariants
, a tally GRanges
of the variants that
pass the filters.
For VariantPostFilters
, a FilterRules
object with the filters.
Michael Lawrence and Jeremiah Degenhardt
bams <- LungCancerLines::LungCancerBamFiles() ## post-filters are not enabled by default during calling data(vignette) called.variants <- callVariants(tallies_H1993) ## but can be applied at a later time... postFilterVariants(called.variants, max.nbor.count = 0.15) # or enable during calling called.variants <- callVariants(tallies_H1993, post.filters = VariantPostFilters())