Created
December 8, 2010 13:08
-
-
Save seandavi/733260 to your computer and use it in GitHub Desktop.
Calculate genotype probabilities
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
phat <- | |
function(x,n,error=0.01,hetprob=0.001) { | |
#doesn't work as expected yet | |
prv=hetprob | |
pvv=(1-hetprob)/2 | |
phet = pbinom(x,n,0.5)*prv | |
phomref=pbinom(x,n,error)*(1-prv-pvv) | |
phomvar=pbinom(x,n,1-error)*pvv | |
return(c(phomvar=phomvar,phet=phet,phomref=phomref))} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment