Adjacent node ids from ts.samples() are not guaranteed to come from the same individual #2047
grahamgower
started this conversation in
General
Replies: 2 comments 3 replies
-
Although you are assuming everything is the same ploidy there. It's not impossible (I guess) to only have e.g. one of the two genomes from a diploid sample. I suspect this might happen with some historical samples (aDNA is sometimes pseudohaploid, which is a horrible hack) |
Beta Was this translation helpful? Give feedback.
3 replies
-
I think the following does it regardless of ploidy etc, and also accounts for the possibility that some intermediate nodes may not be associated with individuals:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This assumption often holds though. One can check the assumption with the following code:
Presumably this affects many tskit functions, albeit perhaps not obviously. Like
ts.genotype_matrix()
, where the adjacent columns are not guaranteed to be from the same individual.Beta Was this translation helpful? Give feedback.
All reactions