-
Notifications
You must be signed in to change notification settings - Fork 72
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
Add states()
method to return actual genotype states as characters
#2617
Conversation
de16b39
to
928176e
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2617 +/- ##
=======================================
Coverage 87.07% 87.07%
=======================================
Files 11 11
Lines 24666 24666
Branches 4556 4556
=======================================
Hits 21478 21478
Misses 1824 1824
Partials 1364 1364
Flags with carried forward coverage won't be shown. Click here to find out more. |
928176e
to
2c21b63
Compare
2c21b63
to
92940ab
Compare
I'm not sure why this is failing CI: everything is covered AFAICS. Ready to merge, I reckon, pending approval of the name of the function. |
92940ab
to
bb97893
Compare
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.
LGTM - not sure about the name though.
Also not clear that an Object array is what people would want. Would it be better to have a "missing data symbol" or something like we do for |
ISWYM, but using any particular character will mean that we can't use that for an allele type (which we might conceivably want to do). This is only going to bite for missing data, so I don't think it's too bad TBH. |
Hmm - how about writing some client code for this with and without missing data? Something like the We use "N" as the default missing data character elsewhere and its fine. We should be able to use this function to compare easily with e.g. Is the |
@hyanwong Would you like this to be in 0.5.4? |
Ah, good point. There's no hurry from my PoV. Is it just a question of my changing the name? I can do that easily enough. |
9f178fe
to
3b884b0
Compare
I don't think we should hurry this in as we don't want to get stuck with Object arrays unless we have to. They have subtly different semantics to arrays of unicode. We should have some example client code for this before committing ourselves to a particular representation. |
Sure. I have updated this so it should never return an object array anyway. But no hurry to get this in. It was to help @szhan and others who spent a fair bit of time comparing integer arrays between tree sequence before realising that they weren't actually comparable. |
genotype_values()
methodstates()
method to return actual genotype states as characters
I think this also fixes #2181 . The name was changed to |
e21faaa
to
efa8d08
Compare
This no longer returns object arrays, and so should be ready to merge, IMO, assuming the name |
efa8d08
to
b9909c0
Compare
b9909c0
to
0e3f1fa
Compare
Description
Adds
variant.genotype_values()
. See tskit-dev/tsinfer#739PR Checklist: