Currently it's annoying to figure out "which is the most recent mutation" out of a set of stacked mutations in a given tskit mutation in the tree sequence. I do it by:
- which mutations are here but not in the parent mutation?
- of those, which has the most recent time?
- if ties, use the last one
This is useful, for instance, in convert_alleles: we want to write the nucleotide for the most recent mutation, so have to figure out which that is. Arguably this is not actually very important, since "pick a single nucleotide" is fundamentally at odds to mutation stacking, but hey.
I think the method above is correct all the time? But we could get rid of a bunch of brittle and annoying code (and make things easier for users) if the mutations were just in order of application. So for instance, substitutions should come first (not last, like they do now).
If this is a big problem, we can skip it.
Currently it's annoying to figure out "which is the most recent mutation" out of a set of stacked mutations in a given tskit mutation in the tree sequence. I do it by:
This is useful, for instance, in
convert_alleles: we want to write the nucleotide for the most recent mutation, so have to figure out which that is. Arguably this is not actually very important, since "pick a single nucleotide" is fundamentally at odds to mutation stacking, but hey.I think the method above is correct all the time? But we could get rid of a bunch of brittle and annoying code (and make things easier for users) if the mutations were just in order of application. So for instance, substitutions should come first (not last, like they do now).
If this is a big problem, we can skip it.