Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parsenexus() tree validation fails if '-' in TaxLabels #75

Closed
isaacovercast opened this issue Sep 14, 2022 · 4 comments
Closed

parsenexus() tree validation fails if '-' in TaxLabels #75

isaacovercast opened this issue Sep 14, 2022 · 4 comments

Comments

@isaacovercast
Copy link

Tested with Phylo.jl v0.4.21

When loading a nexus file, if any TaxLabels in the Taxa block contain dashes ('-') then the open operation will fail with the following messages:

┌ Warning: Taxa list length (6) and ntax (4) do not match
└ @ Phylo /home/isaac/.julia/packages/Phylo/0WXtf/src/newick.jl:436
┌ Info: Created a tree called "best"
└ @ Phylo /home/isaac/.julia/packages/Phylo/0WXtf/src/newick.jl:495
┌ Warning: Wrong number of roots for OneRoot tree (3)
└ @ Phylo /home/isaac/.julia/packages/Phylo/0WXtf/src/LinkTree.jl:223
Tree Tree does not validate!

Steps to reproduce:

Save the following file as wat.nexus:

#NEXUS
BEGIN TAXA;
      Dimensions NTax=4;
      TaxLabels fish-fry frog snake mouse;
END;

BEGIN TREES;
      Tree best=(fish, (frog, (snake, mouse)));
END;

In Julia REPL call: ts = open(parsenexus, Phylo.path("wat.nexus"))

@richardreeve
Copy link
Member

richardreeve commented Oct 16, 2022

Sorry @isaacovercast - I missed this when you posted it. I'll have a look at it as soon as I can. I've been trying to find the time to completely rewrite the parser because it's such a mess, but it's just so much work!

@isaacovercast
Copy link
Author

Thanks for taking a look at it! No rush for me, I just edited the nex by hand.

@richardreeve
Copy link
Member

Hi @isaacovercast - I realise this is long after you raised this issue, but I've just been looking at it, and I can't see any evidence that this is in fact legal nexus syntax. - is punctuation according to the standard, and names of taxa have to be a single word (and a word can only contain punctuation if it is enclosed in 'single quotes', which doesn't happen here). Beyond that, you're also not using the same word in the TAXA block as in the TREES block (fish-fry vs fish). I've looked through the original paper, and it doesn't seem to allow any of that. Any thoughts?

@isaacovercast
Copy link
Author

@richardreeve Thank you for sharing the original paper, fun to go back and read through it! I had no idea about the - punctuation specification, and I've probably just gotten used to other software which is more permissive (or less correct) in the treatment of - inside taxon labels. Thanks for clarifying, i'm happy to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants