You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As per the above, the Nexus string emitted by tskit is not standard Nexus and cannot be parsed by most software.
There are a two different problems.
(1) The TAXA block requires a DIMENSIONS NTAX=## statement.
(2) The list of taxon labels should be separated by SPACES, NOT by commas.
The TreeSequence.to_nexus() statement currently emits:
#NEXUS
BEGIN TAXA;
TAXLABELS tsk_0_1,tsk_1_1,tsk_2_1,tsk_3_1,tsk_4_0,tsk_5_0,tsk_6_0;
END;
BEGIN TREES;
TREE tree0.00000000000000_100.00000000000000 = ((tsk_1_1:0.07086621911734,tsk_2_1:0.07086621911734)tsk_4_0:4.21281381972469,(tsk_0_1:1.20610709140453,tsk_3_1:1.20610709140453)tsk_5_0:3.07757294743750)tsk_6_0;
END;
Multiple program fail to parse this, including PAUP, BEAST, and, in fact, most phylogenetic programs and processing libraries.
Adding a DIMENSIONS statement and separating the taxon labels using spaces makes this not only compliant with standard Nexus, but also readable by most Nexus-supporting phylogenetic programs (whatever else their idiosyncracies! :) )
#NEXUS
BEGIN TAXA;
DIMENSIONS NTAX=7;
TAXLABELS tsk_0_1 tsk_1_1 tsk_2_1 tsk_3_1 tsk_4_0 tsk_5_0 tsk_6_0;
END;
BEGIN TREES;
TREE tree0.00000000000000_100.00000000000000 = ((tsk_1_1:0.07086621911734,tsk_2_1:0.07086621911734)tsk_4_0:4.21281381972469,(tsk_0_1:1.20610709140453,tsk_3_1:1.20610709140453)tsk_5_0:3.07757294743750)tsk_6_0;
END;
Activity
benjeffery commentedon Oct 13, 2021
@jeetsukumaran Thanks for this excellent issue report.
Would you like to submit a PR to fix these issues? Contributions to tskit are recognised by authorship on the upcoming tskit paper.
jeromekelleher commentedon Oct 13, 2021
(No directly involved here, but related is #1671)
jeetsukumaran commentedon Oct 14, 2021
That sounds great! I would love to contribute! I'll update you (and this issue) when I make progress
jeromekelleher commentedon Oct 22, 2021
The basic issue was fixed in #1835. This issue can be closed when we add dendropy based tests of the functionality to confirm.
Convert nexus tests to use dendropy
Convert nexus tests to use dendropy
Convert nexus tests to use dendropy