Repository navigation
Implement standard compliant Nexus - #1801
jeetsukumaran wants to merge 11 commits into
Conversation
This reverts commit b0f7c62.
Codecov Report
@@ Coverage Diff @@
## main #1801 +/- ##
=======================================
Coverage 93.43% 93.43%
=======================================
Files 27 27
Lines 24803 24804 +1
Branches 1094 1094
=======================================
+ Hits 23174 23175 +1
Misses 1594 1594
Partials 35 35
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
CI is failing due to one new branch in the code (the option to wrap underscores in quotes so they will be interpreted as underscores rather than spaces when parsed by a strict Nexus-compliant program) not being tested. As things stand, I can do one of the following: (1) Remove the branch (i.e., the option to wrap in quotes). (2) Hack in a dummy test that visits that branch but doesn't really do (3) Import dendropy into the test code to properly test the branch. The reason for (2) and (3) is, unfortunately, as far as I can tell, Right now, I'm leaning toward (1). (2) has a bad code smell to me, and |
|
I think (1) is the simplest option for now @jeetsukumaran, as we should probably think a bit more about what the default labels should be in the first place (no point in emitting non-compliant/ambiguous labels by default). I'm perfectly happy to add dendropy to the test requirements, and maybe it would be good to replace the verifications that we currently have using BioPython with dendropy? Or just add an additional step to |
|
I've added #1803 to discuss the node labels @jeetsukumaran - I think it would be better to change them to something non-ambiguous rather than adding quotes. |
|
So the protected vs. unprotected underscores being interpreted one way or another is an OK "wart" to have now. Fact is, that lots of supposedly Nexus-compliant programs sometimes respect it and sometimes don't. However, at least they are internally consistent. So in practice it doesn't matter if an underscore is "meant" by tskit and a (strictly-compliant) program reads the labels as having spaces, as the trees/data all makes sense internally. The only issue arises if there are mixed sources and the labels have to correspond across sources. This can certainly arise, e.g., if data generated by tskit (with labels such as " Even more unfortunately, the "correct" handling of the underscores is probably in the minority of bioinformatics packages and maybe even in phylogenetics programs, so defaulting to the correct behavior may end up being more annoying (that's what I discovered in dendropy). Given all this, I agree that in the short run, (1) is the way to go. While not semantically correct, it is syntactically correct, and it will work for 90% of folks, 90% of the time (and the remaining 10%/10% can easily fix it with some pre- or post-processing). So I will revert the quoting changes and submit a new PR. |
|
Looks good, thanks @jeetsukumaran. I would be nice to test this though - how about I follow up with a PR in which we add dendropy as a test dependency and do some basic round-tripping tests based on that? Can you squash down the commits please so it's ready to merge? |
|
Superseded by #1835 |
Description
to_nexus()will now implement standard compliant Nexus.Fixes #1785
PR Checklist: