Repository navigation
Apply NEXUS node labels to alignment rows - #3514
Merged
Merged
Conversation
rpinho
added a commit
to rpinho/tskit
that referenced
this pull request
Nov 18, 2026
jeromekelleher-bot
left a comment
There was a problem hiding this comment.
Thanks @rpinho, this is a genuine bug: since node_labels was added to write_nexus in 1.0.3, using it together with alignments produces a NEXUS file whose MATRIX rows don't match the TAXLABELS, which readers like DendroPy reject. I've confirmed the new test fails on main and passes with this change, and the round-trip test via DendroPy is a nice way to check it.
A few small things before we merge:
- Could you add
:user:`rpinho`to the changelog entry, to match the other entries? - Please squash the two commits into one.
- Please remove the
Co-Authored-By: Claude ...andClaude-Session: ...lines from the commit message.
Otherwise LGTM.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3514 +/- ##
==========================================
- Coverage 91.72% 91.72% -0.01%
==========================================
Files 37 37
Lines 30840 30839 -1
Branches 4922 4921 -1
==========================================
- Hits 28287 28286 -1
Misses 2223 2223
Partials 330 330
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This was referenced Nov 19, 2026
rpinho
force-pushed
the
fix-nexus-alignment-labels
branch
from
November 19, 2026 13:21
f5baaf0 to
84b1f5e
Compare
Contributor
Author
|
Thanks. I changed those. |
jeromekelleher
approved these changes
Nov 19, 2026
Contributor
Author
|
Thanks for looking into this. |
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.
Description
When
as_nexusreceivesnode_labels, the taxa block uses those names and the alignment matrix uses node IDs. DendroPy rejects a file produced this way because it cannot find the matrix labels in the taxa block. Build the sample labels once and use them in both sections. The tests parse the export with and without trees and compare the labels and bases.PR Checklist:
🤖 Generated with Claude Code
https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N