question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pedigree topological order

See original GitHub issue

Many pedigree algorithms require the topological ordering of nodes such that each individual occurs before its decedents. In sgkit it makes sense to simply calculate and store the topological order as an array of indices. This array can be calculated from the parent array introduced in #839. There are several graph libraries which could be used to compute topological order https://github.com/pystatgen/sgkit/discussions/786#discussioncomment-1863520. Alternatively we could implement Kahn’s algorithm to avoid picking up another dependency (it’s quite simple).

Either way the API is quite simple e.g. topological_sort(ds, parent=parent) -> ds with topological_order where topological_order has dimension samples and is of type uint64. Suggestions for better names are welcome!

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
jeromekellehercommented, Apr 22, 2022

Great idea @timothymillar. I suspect it would be simpler to just implement this ourselves. We have an implementation in tskit we can compare against:

0reactions
timothymillarcommented, May 1, 2022

Done in #846

Read more comments on GitHub >

github_iconTop Results From Across the Web

prepPed: Prepares a pedigree by sorting and adding 'founders'
This function easily prepares data sets to accommodate these requirements using a very fast topological sorting algorithm. NOTE: more columns than just a ......
Read more >
Prepares a pedigree by sorting and adding 'founders' - R
This function easily prepares data sets to accommodate these requirements using a very fast topological sorting algorithm.
Read more >
Efficient path-based computations on pedigree graphs with ...
A pedigree is a diagram of family relationships, and it is often used to determine the mode of inheritance (dominant, recessive, etc.)
Read more >
Does organismal pedigree impact the magnitude of topological ...
Abstract One of the fundamental assumptions in the multi-locus approach to phylogeographic studies is that unlinked loci have independent genealogies.
Read more >
What structure and algorithm use for building genealogy tree?
I found in one book, that for presenting genealogy (family) tree good to use DAG (directed acyclic graph) with topological sorting, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found