Skip to contents

internal helper function to create Filt_Genotype column. note this column name is from Daniel's original BSA analysis. It just means a column which calls genotype based on frequency of allele with RealDepth, which are only those bases which pass the variant caller thresholds and exist (not missing in the CIGAR), in the denominator. Currently the three levels that may be returned are lowDepth, Rerence or Alterantive.

Usage

set_genotype(depth, ref_freq, depth_thres, ref_freq_thres)

Arguments

depth

depth of a given variant, at a given position

ref_freq

frequency of a given variant, at a given position

depth_thres

if less than depth threshold, or is.na(depth), return value is lowDepth

ref_freq_thres

if ref is greater than or equal to this number, and depth passes threshold, call genotype Reference. note that genotype is called Alternative if passes depth threshold and ref_freq is less than or equal to 1 - ref_freq_thres. If depth is below depth_thres, return lowDepth

Value

one of undefinedGenotype, lowDepth, Reference, Alternative