Learn R Programming

MBASED (version 1.6.0)

getPFinal: Function that adjusts true underlying allele frequency for pre-existing allelic bias to produce actual generating probability of observing allele-supporting read

Description

Function that adjusts true underlying allele frequency for pre-existing allelic bias to produce actual generating probability of observing allele-supporting read

Usage

getPFinal(trueAF, noASEAF, checkArgs = FALSE)

Arguments

trueAF
true underlying allele frequency. Must be a single number >=0 and
noASEAF
probability of observing allele-supporting read under conditions of no ASE. Must be a vector of numbers >0 and
checkArgs
single boolean specifying whether arguments should be checked for adherence to specifications. DEFAULT: FALSE

Value

a vector of generating probabilities of the same length as noASEAF

Details

Given true underlying allele frequency AF and probability of observing reads supporting that allele under conditiosn of no ASE (P(allele, noASE)), it calculates the generating probability for observed allele-supporting reads as P(allele-supporting read)=AF*P(allele, noASE)/(AF*P(allele, noASE) + (1-AF)*(1-P(allele, noASE))).

Examples

Run this code
MBASED:::getPFinal(trueAF=1, noASEAF=seq(0.1, 0.9, by=0.1)) ## is always 1
MBASED:::getPFinal(trueAF=0, noASEAF=seq(0.1, 0.9, by=0.1)) ## is always 0
MBASED:::getPFinal(trueAF=0.3, noASEAF=0.5) ## no pre-existing allelic bias
c(MBASED:::getPFinal(trueAF=0.3, noASEAF=0.9), MBASED:::getPFinal(trueAF=1-0.3, noASEAF=1-0.9)) ## strong pre-existing allelic bias

Run the code above in your browser using DataLab