#NEXUS
Begin Taxa;
Dimensions ntax=4;
TaxLabels
A
B
C
D
;
End;
Begin Trees;
Translate
1 A,
2 B,
4 C,
5 D
;
tree TREE1 = [&R] (((1[&rate=NA,branch_length=3.05210780043533E-003]:2.82146551149507E-003,2[&rate=NA,branch_length=3.11763249917918E-003]:2.82146551149507E-003)[&rate=NA,branch_length=3.27365421500745E-002,reltime=2.82146551149507E-003,reltime_stderr=3.48412420431308E-004,reltime_95%_CI={2.22004192087475E-003,3.58581860896548E-003},data_coverage=99%]:2.99429893613024E-002,4[&rate=NA,branch_length=2.83944102398042E-002]:3.27644548727974E-002)[&rate=NA,branch_length=4.76537203824402E-002,reltime=3.27644548727974E-002,reltime_stderr=2.55675381204422E-003,reltime_95%_CI={2.81342298521227E-002,3.81567047953361E-002},data_coverage=99%]:4.89568013527124E-002,5[&rate=NA,branch_length=8.39559068047214E-002]:8.17212562255099E-002)[&rate=NA,branch_length=1.28935725106037E-002,reltime=8.17212562255099E-002,reltime_stderr=4.03743281925163E-003,reltime_95%_CI={7.41901341411784E-002,9.00168707926448E-002},data_coverage=99%];
End;
If the translation table keys of the nexus file are not consecutive integers (which is possible for a
MEGAtimetreeanalysis output),read.mega/read.beastwill return a incorrect@datatable:test.nex
Note the node
3(labeledC) has no associated data, which is not the case in the nexus file. Also, node5has two different entries.The expected result will be:
This issue arises after a recent fix of the
apepackage, which relaxed the restriction of the translation table when reading nexus files. Before that fix, translation table containing non-consecutive keys are not supported. (see ape#133 )