Skip to content

make list of slim mutation ids in mutation metadata/derived state sorted by time #670

Description

@petrelharp

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:

  1. which mutations are here but not in the parent mutation?
  2. of those, which has the most recent time?
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions