Repository navigation
Change node labelling and add rooting to Nexus. - #1838
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1838 +/- ##
==========================================
- Coverage 93.43% 93.42% -0.01%
==========================================
Files 27 27
Lines 24808 24818 +10
Branches 1094 1098 +4
==========================================
+ Hits 23179 23186 +7
- Misses 1594 1595 +1
- Partials 35 37 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
007e399 to
70fce49
Compare
5a6eaf4 to
b4a4b2a
Compare
|
This is ready for review now I think. I've ended up changing quite a lot here, as there was a lot of technical debt incurred on these code paths. Essentially, the newick output hadn't been touched since the very early days when all I wanted it to do was mimic ms output as efficiently as possible. This is as long-overdue spring clean. The main changes are to add a new I know there's a lot of code changes here, but I'd really appreciate it if you could take a look the API updates (in trees.py) and the examples in the test cases test_phylo_formats.py @jeetsukumaran. Does the new spatial coordinate encoding ("tree|{tree.interval.left}^{tree.interval.right|") look OK to you? I don't have any particular attachment to it, it was just the best I could come up with that parsed in dendropy. Happy to consider alternatives. Note there's also the question of whether we should output the alignments in the nexus output, so I've opened #1840 to track. |
b4a4b2a to
712417a
Compare
|
Quick look, and it seems fine. Only thing to remark is that some programs may not be able to handle the pipe character in the tree labels. But that is speculative. PAUP* (reference standard for me) and DendroPy have no issues. In any case, it's easy to fix downstream if needed, and most programs ignore the labels anyway. OTOH, |
712417a to
66c7eb6
Compare
|
Good point @jeetsukumaran - I've changed to On reflection, the "tree" prefix is superfluous, and it's consistent that we use the prefix "t" to denote a tree like we use "n" to denote a node. So, "t{x}^{y}" is the tree defined on interval left=x, right=y and "n{u}" is the node with ID u. This seems logical and consistent. Do you see any issues @jeetsukumaran? |
|
@Mergifyio rebase |
✅ Branch has been successfully rebased |
66c7eb6 to
ec4840f
Compare
|
@Mergifyio rebase |
❌ Base branch update has failedDetailsGit reported the following error: err-code: 75871 |
ec4840f to
8e9308e
Compare
benjeffery
left a comment
There was a problem hiding this comment.
Very nice, just one fix. Agree with the naming you've gone for here.
| buffer_size=buffer_size, | ||
| legacy_ms_labels=legacy_ms_labels, | ||
| ) | ||
| return |
There was a problem hiding this comment.
Looks like an extra return slipped in.
There was a problem hiding this comment.
Aha, thanks! Surprising flake8 didn't spot this.
- Remove TreeSequence.to_nexus and add TreeSequence.as_nexus - Add Tree.as_newick and refactor - Update C newick generation to cover new defaults - Refactor newick testing code paths Closes tskit-dev#1803 Closes tskit-dev#1815 Closes tskit-dev#1671
8e9308e to
8386079
Compare
Batch of improvements for nexus handling.
Closes #1803
Closes #1815