Repository navigation
Conversation
Can now convert in both directions. The algorithm is pretty simple, but could be made simpler (at least in the code) in how it manages state. The GRG is traversed according to mutations in left-to- right order, and each such subtree below a mutation is added to the current coalescent tree. If adding that subtree will break the tree property (i.e., making it a multi-tree) then the offending parent edges are deleting from coalescent tree. Each coalescent tree is rooted by a single node, which sometimes requires the creation of synthetic nodes (ones not found in the GRG). The node times are fake, and just represent a topological order of the nodes.
When --no-simplify is provided, prevent simplification of the graph at every stage of construction.
Remove some debugging code, add the Python API. Add a simple end-to-end test. The Python API docs include a warning that this functionality is experimental and subject to change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Naive algorithm for converting from GRG to tskit TreeSequence. The multi-tree is traversed in Mutation order (lowest BP to highest BP) and the subtree below each mutation is copied to the current coalescent tree. When an edge violates the tree property (more than one parent), we delete the edge ("recombination").
This functionality is for experimental purposes only - it will likely change and the value of it is unclear (so it may go away).