KarchinLab / cancerSeqStudy

Analysis of statistical power and false positives for cancer exome sequencing studies
3 stars 3 forks source link

rateCvToAlphaBeta function #1

Open xiasijian opened 1 year ago

xiasijian commented 1 year ago

image image

Why could not find rateCvToAlphaBeta function?

xiasijian commented 1 year ago

' Converts mutation rate and coefficient of variation (CV) parameters

' to equivalent alpha and beta parameters typically used for beta-binomial.

'

' @param rate mutation rate

' @param cv coefficient of variation for mutation rate

' @return Param list containing alpha and beta

rateCvToAlphaBeta <- function(rate, cv) { ab <- rate (1-rate) / (cvrate)^2 - 1 my.alpha <- rate ab my.beta <- (1-rate)ab return(list(alpha=my.alpha, beta=my.beta)) }

#############################

Analyze power and false positives

when using a beta-binomial model

############################# smgBbdFullAnalysis <- function(mu, cv, Leff, signif.level, effect.size, desired.power, samp.sizes){

find the power and numer of samples needed for a desired power

powerResult <- smgBbdRequiredSampleSize(desired.power, mu, cv, samp.sizes, effect.size, signif.level, Leff) bbd.samp.size.min <- powerResult$samp.size.min bbd.samp.size.max <- powerResult$samp.size.max power.result.bbd <- powerResult$power

get alpha and beta parameterization

for beta-binomial

params <- rateCvToAlphaBeta(mu, cv) }