misc.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4899 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
5265f943b0
commit
b024b85798
|
|
@ -122,4 +122,18 @@ plotQsamples <- function(depths, Qs, Qmax) {
|
||||||
}
|
}
|
||||||
|
|
||||||
legend("topleft", paste("Q", Qs), fill=cols)
|
legend("topleft", paste("Q", Qs), fill=cols)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pCallHetGivenDepth <- function(depth, nallelesToCall) {
|
||||||
|
depths = 0:(2*depth)
|
||||||
|
pNoAllelesToCall = apply(as.matrix(depths),1,function(d) sum(dbinom(0:nallelesToCall,d,0.5)))
|
||||||
|
dpois(depths,depth)*(1-pNoAllelesToCall)
|
||||||
|
}
|
||||||
|
|
||||||
|
pCallHets <- function(depth, nallelesToCall) {
|
||||||
|
sum(pCallHetGivenDepth(depth,nallelesToCall))
|
||||||
|
}
|
||||||
|
|
||||||
|
pCallHetMultiSample <- function(depth, nallelesToCall, nsamples) {
|
||||||
|
1-(1-pCallHets(depth,nallelesToCall))^nsamples
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue