Add --maintain-topo and --no-simplify options to grg convert #14
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.
Conversion from TS to GRG previously ignored topology changes below a mutation IF that topology change did not impact the sample set of the mutation. This manifests when the break and join point of a recombination both occur entirely below a mutation.
You can now run
grg convert --maintain-topo
if you want to instead retain such topology changes. The algorithm change is quite simple: instead of traversing from added/removed edges to their MRCA we instead just traverse all the way to the root(s). The nodes along the way are marked to be split next time they are encountered by a mutation.On a reasonably large Tree-Seq file (500k samples, 100Mbp len), there is no noticeable timing difference between the two versions of the algorithm.
GRG file size is pretty much the same as well; when you look at the edges/nodes you see the minimal difference:
But both files are 140Mb
Additionally I exposed the already existing "--no-simplify" option to "grg convert". When you turn off simplification you DO see the size difference:
File size = 201Mb vs. 140Mb