Description Usage Arguments Details Value Author(s) Examples

View source: R/diffVariantError.R

This function finds a practical threshold to differentiate a variant call from sequencing error.

1 | ```
diffVariantError(Xmean, N.p, error, N.test = 1)
``` |

`Xmean` |
The average coverage on the pool |

`N.p` |
The pool size: number of individuals per pool |

`error` |
Sequencing error rate |

`N.test` |
Number of tests, usually the same as number of pools P |

It is a helper function to calculate the probability of detection.

diffVariantError() returns a vector c(v, p0, p1), where v is the threshold for a variant call, p0 is the false discovery rate and p1 is the lower bound of true discovery rate.

Wei E. Liang

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ```
##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function(Xmean, N.p, error, N.test=1)
{
theta <- (1-error)/(2*N.p) + error*(1-1/(2*N.p))
for(v in 1:Xmean)
{
p1 <- pbinom(v-1, Xmean, theta, lower.tail=FALSE)
p0 <- pbinom(v-1, Xmean, error, lower.tail=FALSE)
if(p1/p0 > 5 & p0<0.05/N.test) break;
}
c(v, p0, p1)
}
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.