Skip to content

Tutorial: tree algorithms with numba #63

@jeromekelleher

Description

@jeromekelleher

Once we have direct numpy access to the tree arrays in Python (tskit-dev/tskit#1299) I think we should be able to do quite performant traversal algorithms in python using numba. We can illustrate this with a couple of examples:

  1. Implement the get_mrca function, using the algorithm given here: more efficient TMRCA computation? tskit#1306 (although we might get hit by the creation of the node_time array if we create it for each function call - we could work around this for the moment by using a copy of the node time array that we keep lying around). This is easy because we only go up the tree.
  2. Implement one of the phylogenetics parsimony algorithms in a simple way. This would illustrate how to do traversals down from the root efficiently. Probably the Sankoff score would be a good one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions