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

Auspice has no problem reading a broken nwk tree #66

Open
corneliusroemer opened this issue Oct 9, 2023 · 2 comments
Open

Auspice has no problem reading a broken nwk tree #66

corneliusroemer opened this issue Oct 9, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@corneliusroemer
Copy link
Member

Current Behavior

Fascinatingly, Auspice has no issue reading a broken nwk tree with unmatching parentheses.

When viewing the raw nwk tree in Auspice it didn't complain. Only when I ran it through augur export did I get a complaint.

It's not so much a bug as I'm surprised that we're not even logging anything to the console.

Expected behavior

When I give a broken nwk, Auspice warns me.

How to reproduce

Steps to reproduce the current behavior:

  1. Open tree.nwk.txt in auspice.us
  2. Observe that there is nothing logged to console
@corneliusroemer corneliusroemer added the bug Something isn't working label Oct 9, 2023
@joverlee521 joverlee521 transferred this issue from nextstrain/auspice Oct 9, 2023
@joverlee521
Copy link
Contributor

parseNewick is the custom function for parsing a Newick string to a Javascript object. Looks like it currently does not do any sort of validation of the Newick format.

@joverlee521 joverlee521 mentioned this issue Nov 2, 2023
1 task
jameshadfield added a commit that referenced this issue Dec 6, 2023
Two recent issues (#71, #72) provide examples where the improved parsing
either didn't parse a valid newick tree or (much more worryingly)
returned an entirely incorrect tree structure, including nodes not
present in the newick. See those issues for details, including the tree
files. While this reversion will re-introduce bugs such as #66 and the
bug in
<https://discussion.nextstrain.org/t/displaying-trees-from-ncbi-pathogen-browser-in-auspice-us/1456/4>,
but they are lesser than the bugs introduced by #69.

This reverts commit cabba98, although
subsequent changes to package-lock.json mean it's not a clean revert.
jameshadfield added a commit that referenced this issue Dec 6, 2023
The newick parser we use is known to have issues with quoted node names,
as it will parse the node name content as newick. As a quick fix,
disallow trees with quotes. The result is that the trees in #66 and
<https://discussion.nextstrain.org/t/displaying-trees-from-ncbi-pathogen-browser-in-auspice-us/1456/4>
will now result in an error. The downside is trees with quoted names but
no newick-like structure within the node name will also fail to load.
jameshadfield added a commit that referenced this issue Dec 6, 2023
Two recent issues (#71, #72) provide examples where the improved parsing
either didn't parse a valid newick tree or (much more worryingly)
returned an entirely incorrect tree structure, including nodes not
present in the newick. See those issues for details, including the tree
files. While this reversion will re-introduce bugs such as #66 and the
bug in
<https://discussion.nextstrain.org/t/displaying-trees-from-ncbi-pathogen-browser-in-auspice-us/1456/4>,
but they are lesser than the bugs introduced by #69.

This reverts commit cabba98, although
subsequent changes to package-lock.json mean it's not a clean revert.
jameshadfield added a commit that referenced this issue Dec 6, 2023
The newick parser we use is known to have issues with quoted node names,
as it will parse the node name content as newick. As a quick fix,
disallow trees with quotes. The result is that the trees in #66 and
<https://discussion.nextstrain.org/t/displaying-trees-from-ncbi-pathogen-browser-in-auspice-us/1456/4>
will now result in an error. The downside is trees with quoted names but
no newick-like structure within the node name will also fail to load.
jameshadfield added a commit that referenced this issue Dec 6, 2023
Two recent issues (#71, #72) provide examples where the improved parsing
either didn't parse a valid newick tree or (much more worryingly)
returned an entirely incorrect tree structure, including nodes not
present in the newick. See those issues for details, including the tree
files. While this reversion will re-introduce bugs such as #66 and the
bug in
<https://discussion.nextstrain.org/t/displaying-trees-from-ncbi-pathogen-browser-in-auspice-us/1456/4>,
but they are lesser than the bugs introduced by #69.

This reverts commit cabba98, although
subsequent changes to package-lock.json mean it's not a clean revert.
jameshadfield added a commit that referenced this issue Dec 6, 2023
The newick parser we use is known to have issues with quoted node names,
as it will parse the node name content as newick. As a quick fix,
disallow trees with quotes. The result is that the trees in #66 and
<https://discussion.nextstrain.org/t/displaying-trees-from-ncbi-pathogen-browser-in-auspice-us/1456/4>
will now result in an error. The downside is trees with quoted names but
no newick-like structure within the node name will also fail to load.
@jameshadfield
Copy link
Member

As of #73 this file will no longer parse because it has single quotes (acting as an apostrophe) in node names, but the underlying unbalanced parentheses bug isn't fixed.

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