Skip to content

Newick parser bug #13

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

Open
nromashchenko opened this issue Mar 9, 2023 · 2 comments
Open

Newick parser bug #13

nromashchenko opened this issue Mar 9, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@nromashchenko
Copy link
Member

If a clade name contains symbols like "(", ")", the parser crashes assuming that it's part of the tree syntax.
Name example:

... ('AE006468, Salmonella enterica subsp. enterica, Salmonella enterica subsp. enterica, (AE006468), LT2 T':0.01112,...

@nromashchenko nromashchenko added the bug Something isn't working label Mar 9, 2023
@nromashchenko nromashchenko self-assigned this Mar 9, 2023
@blinard-BIOINFO
Copy link
Member

@nromashchenko, as a general trend in what i see in bioinformatic programs, people solve the issue by a) forbidding these characters in the sequence labels . Or b) by replacing all : and () characters by _ . First in the alignement, then in the newick by exact match of the original alignment label. (I think I used the second in RAPPAS).

@lczech
Copy link

lczech commented Apr 10, 2023

Hey there,

the (not super well standardized) Newick specification allows that, as long as it's in quotes (single - but I vaguely remember that I've seen double quotes as well somewhere...). See also https://doi.org/10.1093/molbev/msx055 for the mess of Newick.

Also, as for @blinard-BIOINFO's comment: Yes, that seems to be the case, many tools go that way now. But personally, I find it an unfortunate trend that often file formats are not properly implemented. Sure, in this case at least it will fail somehow ("crashing" probably not being the best way though). There are however also cases where tools will silently continue, such as when requiring FASTA files to have exactly 2 lines per record, instead of allowing line breaks in the sequence. But given that bioinformatics file formats are a huge mess anyway, I think it will only get messier if tools require their own simplified versions, shifting the burden to the user to check and convert as needed.

Don't mean to rant here - it's just something that has bugged me in too many tools, and hence wanted to use this opportunity to advocate to properly implement the format :-)

Cheers
Lucas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants