hard_filter: Hard filter a vcf file by depth and genotype quality (gq)

View source: R/hard_filter.R

hard_filterR Documentation

Hard filter a vcf file by depth and genotype quality (gq)

Description

This function requires a vcfR object as input. The user can then specify the minimum value for depth of coverage required to retain a called genotype (must be numeric). Additionally, the user can specify a minimum genotype quality required to retain a called genotype (again, must be numeric).

Usage

hard_filter(vcfR, depth = NULL, gq = NULL)

Arguments

vcfR

a vcfR object

depth

an integer representing the minimum depth for genotype calls that you wish to retain (e.g. 'depth = 5' would remove all genotypes with a sequencing depth of 4 reads or less)

gq

an integer representing the minimum genotype quality for genotype calls that you wish to retain (e.g. 'gq = 30' would remove all genotypes with a quality score of 29 or lower)

Value

The vcfR object input, with the sites failing specified filters converted to 'NA'

Examples

hard_filter(vcfR = SNPfiltR::vcfR.example, depth = 5)
hard_filter(vcfR = SNPfiltR::vcfR.example, depth = 5, gq = 30)

SNPfiltR documentation built on March 31, 2023, 8:57 p.m.