R/get_vaf.r

Defines functions get_vaf

Documented in get_vaf

#' Calculate VAF
#' 
#' @param ref A numeric vector with number of reference reads for a set of loci
#' @param alt A numeric vector with numer of variant reads for a set of loci
#' @return The Variant Allele Frequency of a locus given reference and altered (variant) reads for a given locus
#' @examples
#' alt <- sample(10:1000, 5)
#' ref <- sample(10:1000, 5)
#' vaf <- get_vaf(ref, alt)
get_vaf <- function(ref, alt){
    return(alt / (ref + alt))
}
paularstrpo/GeTalleleR documentation built on Aug. 8, 2020, 12:51 p.m.