-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update likelihood code to handle non-uniform allelic mixtures #571
Conversation
|
||
lazy val uniqueAllelesCount = alleles.toSet.size | ||
assume(alleleMixture.values.sum <= 1, "Allele fractions are larger than 1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will alleleMixture
contain a reference allele so that we'd expect the sum to be ≈1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this test was originally = 1
but was thinking it might be more likely that we assume .5
for the reference and then something like .2
for the variant if it is a low purity sample. Could possibly come back and adjust this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotcha… I feel like the existence of this runtime-check raises more questions than it answers; is this a failure mode we're worried about? I'm ok leaving it in but maybe add a comment explaining the thinking, it's a peculiar and somewhat unnerving thing to feel the need to assert!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm ok, maybe to clarify - the mixture should be a true mixture where the weights sum to 1. The reason for the check is to ensure that the entered values are at least fractions ... will add some comments around this
lgtm modulo adding a comment per above, and also some tweaks I sent in #574, which you can incorporate here or which I can pull out as a separate PR, uty! |
- private-ize a few methods - simplify alignment-inclusion API in likelihood calculation: simple boolean instead of arbitrary function - remove "Likelihood." from call-sites - misc line-spacing
fd654b2
to
c79d615
Compare
This PR contains the following changes:
Genotype
from a collection of alleles to a map ofAllele
-> Allele FractionLikelihood.scala
andLikelihoodSuite.scala
to handle thisThis change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)