Repository navigation
Missing genotypes in variants and genotype_matrix - #272
Conversation
Codecov Report
@@ Coverage Diff @@
## master #272 +/- ##
==========================================
+ Coverage 85.82% 85.85% +0.02%
==========================================
Files 19 19
Lines 14093 14162 +69
Branches 2742 2758 +16
==========================================
+ Hits 12096 12159 +63
- Misses 1043 1048 +5
- Partials 954 955 +1
Continue to review full report at Codecov.
|
|
This seems like a reasonable way to deal with the issue to me. The only down side is that this way, the missingness criterion (i.e. the value to use for |
|
I think this is OK - for tsinfer derived tree sequences where we expect to deal with missing data we always set If client code doesn't know how to deal with missing data, by default any missing states are imputed as the ancestral state (which, I guess, is reasonable). So, the missingness criteria is encoded in the tree sequence (samples with no edges), but how you deal with that missingness is determined by the user. If the user wants to know explicitly that the sites are missing when generating genotypes, they set There's a different conversation to be had about how we deal with short regions of missing data within tsinfer (should we break edges and output them as missing, or should we impute the states using LS?), but that's something to discuss in the context of inference rather than tskit. |
|
Or, we could make this the default behaviour and add a flag @petrelharp, any thoughts on this? I actually need this for something I'm working on now, so I'd like to push it through ASAP. |
830adae to
afff9f7
Compare
|
... and of course this has implications for the stats. Currently most site based tests are broken as the default behaviour of |
|
I think that making "isolated nodes = missing" is probably the right thing to do. I can think of all sorts of potential questions (what if there are two sister nodes in their own tree? why are they not missing?) but not questions that are likely to come up in practice. The case of ancestral nodes that aren't specified in the current tree is much more important, and these should obviously be missing. (Note: the more obvious method of just sticking a "missing" mutation above the relevant samples should also work - because just because someone's genotype is unknown at a site doesn't mean we don't have a good guess at their location in the genealogy... but this we already have, right?) |
|
I agree that having isolated nodes as missing seems the most sensible default, FWIW |
032a650 to
b78490c
Compare
The haplotype generator will now fail if missing data is detected and impute missing is not set.
Also fixed up tests that depended on the missing data imputation property of haplotypes and genotypes.
|
Notes to self, TODO
|
b78490c to
e82df42
Compare
Also port test cases for genotypes into new file, test_genotypes.
48b2e25 to
d902a4f
Compare
|
I think this is ready to merge - final reviews anyone? |
|
Looks good to me! I got confused for a bit about why we can't also denote missingness by setting the derived state of a mutation to "missing", but after thinking about it more, I like this approach. |
3e1b60a to
16d7794
Compare
16d7794 to
5cb42f1
Compare
|
OK, merging. |
Here's the basic proposal:
isolated_samples_missing(or something) tovariants/genotype_matrix.There's some work to be done here, but I thought I'd share the basic idea first to see what people think before going any further with it. Pinging @hyanwong and @petrelharp for input.
Closes #270