Skip to content

Commit

Permalink
in QVAL_20PC computation, replace floor function by 5% quantile of bi…
Browse files Browse the repository at this point in the history
…nomial distribuation (for issue #133)
  • Loading branch information
nalcala committed Oct 21, 2016
1 parent 56b0378 commit 1997af2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/needlestack.r
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ common_annot=function() {
}

toQvalue20pc <- function(x,rob_nb_res){
y = floor(x*0.2) #take floor to be conservative
y = qbinom(0.05,x,0.2,lower.tail = T) #5% quantile of distrib of number or ALT reads if AF is 0.2
unlist(-10*log10(p.adjust((dnbinom(c(rob_nb_res$ma_count,y),size=1/rob_nb_res$coef[[1]],mu=rob_nb_res$coef[[2]]*c(rob_nb_res$coverage,x)) +
pnbinom(c(rob_nb_res$ma_count,y),size=1/rob_nb_res$coef[[1]],mu=rob_nb_res$coef[[2]]*c(rob_nb_res$coverage,x),lower.tail = F)))
[length(rob_nb_res$coverage)+1]))
Expand Down

0 comments on commit 1997af2

Please sign in to comment.