samples_filter: Filter out samples of a vcfR object based on depth

View source: R/wrap_vcfR.R

samples_filterR Documentation

Filter out samples of a vcfR object based on depth

Description

Filter out samples of a vcfR object based on depth

Usage

samples_filter(
  x,
  lower_quant = 0.05,
  stat = "median",
  filter_bot = TRUE,
  filter_top = FALSE,
  remove_nonpolymorphs = TRUE
)

Arguments

x

A vcfR object

lower_quant

lower quantile to filter by. The top quantile will be 1-lower_quant

stat

Statistic to filter by. Right now, supports "median" to filter on median depth, "mean" to filter on mean depth, or "missingness" to filter on percent missing data.

filter_bot

Omit samples in the bottom quantile

filter_top

Omit samples in the top quantile

remove_nonpolymorphs

After omitting samples, some variants will be nonpolymorphic. These should be removed.

Value

A filtered vcfR object.

Examples

ultrafiltered_vcf <- samples_filter(filtered_vcf)

Neato-Nick/mllR documentation built on Aug. 30, 2024, 7:22 a.m.