# Displaying trees from NCBI Pathogen Browser in auspice.us

**URL:** <https://nextstrain.discourse.group/t/displaying-trees-from-ncbi-pathogen-browser-in-auspice-us/1456>\
**Category:** Uncategorized\
**Created:** [October 26, 2023, 5:32pm UTC](https://nextstrain.discourse.group/t/displaying-trees-from-ncbi-pathogen-browser-in-auspice-us/1456 "2023-10-26T17:32:18Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ewolfsohn](https://avatars.discourse-cdn.com/v4/letter/e/858c86/32.png) [@ewolfsohn](https://nextstrain.discourse.group/u/ewolfsohn)\
**Post date:** [October 26, 2023, 5:32pm UTC](https://nextstrain.discourse.group/t/displaying-trees-from-ncbi-pathogen-browser-in-auspice-us/1456/1 "2023-10-26T17:32:18Z")

</div>

NCBI generates phylogenetic trees from sequences submitted to NARMS, PulseNet, and GenomeTrakr, which can be found here: [Isolates Browser - Pathogen Detection - NCBI](https://www.ncbi.nlm.nih.gov/pathogens/isolates/)

I’m interested in visualizing these trees using auspice. They can be downloaded as Newick files, but they don’t display properly when imported into auspice. I was wondering if you all had time to take a look and see if the newick files can be easily converted into a format that will display properly. I’ve attached a small newick file I pulled from the pathogen browser to this post.  
[pathogen\_browser.nwk](https://nextstrain.discourse.group/uploads/short-url/ijhXTiOACGH6wvfBzhiBTlMJfXw.nwk) (1.2 KB)

---

<div class="post-metadata">

**Author:** ![Jason](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@Jason](https://nextstrain.discourse.group/u/Jason)\
**Post date:** [October 26, 2023, 6:36pm UTC](https://nextstrain.discourse.group/t/displaying-trees-from-ncbi-pathogen-browser-in-auspice-us/1456/2 "2023-10-26T18:36:00Z")

</div>

There’re a few things in that tree might be confusing Newick parser, but the first place I would look is the long tip names with commas in them. Commas are used as delimiters in newick format, so any parser that isn’t respecting the quotes around those names is going do something weird or panic and die.

Ex: ‘clinical, 2021-06-01, USA, PNUSAS204121, PDT001057153.1’ as a tip name

---

<div class="post-metadata">

**Author:** ![trs](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/trs/32/5_2.png) [@trs](https://nextstrain.discourse.group/u/trs)\
**Post date:** [October 30, 2023, 5:15pm UTC](https://nextstrain.discourse.group/t/displaying-trees-from-ncbi-pathogen-browser-in-auspice-us/1456/3 "2023-10-30T17:15:59Z")

</div>

@ewolfsohn When you say you’re importing these into Auspice, are you dragging them onto [auspice.us](http://auspice.us) or converting them to Auspice JSONs via Augur?

@Jason’s hunch about parsing is a good guess.

---

<div class="post-metadata">

**Author:** ![ewolfsohn](https://avatars.discourse-cdn.com/v4/letter/e/858c86/32.png) [@ewolfsohn](https://nextstrain.discourse.group/u/ewolfsohn)\
**Post date:** [November 2, 2023, 4:44pm UTC](https://nextstrain.discourse.group/t/displaying-trees-from-ncbi-pathogen-browser-in-auspice-us/1456/4 "2023-11-02T16:44:19Z")

</div>

I am dragging them onto [auspice.us](http://auspice.us).

---

<div class="post-metadata">

**Author:** ![trs](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/trs/32/5_2.png) [@trs](https://nextstrain.discourse.group/u/trs)\
**Post date:** [November 2, 2023, 6:19pm UTC](https://nextstrain.discourse.group/t/displaying-trees-from-ncbi-pathogen-browser-in-auspice-us/1456/5 "2023-11-02T18:19:52Z")

</div>

Ah, it’s definitely a Newick parsing issue then. The [minimal parser used by auspice.us](https://github.com/nextstrain/auspice.us/blob/master/auspice_client_customisation/parseNewick.js) doesn’t support the [single-quoted names](https://en.wikipedia.org/wiki/Newick_format#Notes) allowed by the Newick format and used in those trees from NCBI. We should definitely replace that parser with a better one.

---

<div class="post-metadata">

**Author:** ![trs](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/trs/32/5_2.png) [@trs](https://nextstrain.discourse.group/u/trs)\
**Post date:** [November 2, 2023, 8:03pm UTC](https://nextstrain.discourse.group/t/displaying-trees-from-ncbi-pathogen-browser-in-auspice-us/1456/6 "2023-11-02T20:03:24Z")

</div>

I’ve [proposed changes](https://github.com/nextstrain/auspice.us/pull/69) to [auspice.us](http://auspice.us) to swap in a better Newick parser. It won’t be on [auspice.us](http://auspice.us) until accepted and merged, but you can test it out for now on [https://auspice-us-trs-improved-udntd9.herokuapp.com/](https://auspice-us-trs-improved-udntd9.herokuapp.com/).

 ![Screenshot from 2023-11-02 13-02-53](https://canada1.discourse-cdn.com/flex031/uploads/nextstrain/original/1X/f7f9dbe409f6b68daf5f98a70d71f3e09d6a9be7.png)

---

<div class="post-metadata">

**Author:** ![trs](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/trs/32/5_2.png) [@trs](https://nextstrain.discourse.group/u/trs)\
**Post date:** [November 3, 2023, 12:07am UTC](https://nextstrain.discourse.group/t/displaying-trees-from-ncbi-pathogen-browser-in-auspice-us/1456/7 "2023-11-03T00:07:48Z")

</div>

@ewolfsohn Those changes are now deployed to [auspice.us](http://auspice.us), so you should be able to view the NCBI Pathogens trees there.

---

<div class="post-metadata">

**Author:** ![ewolfsohn](https://avatars.discourse-cdn.com/v4/letter/e/858c86/32.png) [@ewolfsohn](https://nextstrain.discourse.group/u/ewolfsohn)\
**Post date:** [November 16, 2023, 6:06pm UTC](https://nextstrain.discourse.group/t/displaying-trees-from-ncbi-pathogen-browser-in-auspice-us/1456/8 "2023-11-16T18:06:17Z")

</div>

It’s working great for me! Thank you for looking into it.

---

<div class="post-metadata">

**Author:** ![james](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/james/32/11_2.png) [@james](https://nextstrain.discourse.group/u/james)\
**Post date:** [December 6, 2023, 11:35pm UTC](https://nextstrain.discourse.group/t/displaying-trees-from-ncbi-pathogen-browser-in-auspice-us/1456/9 "2023-12-06T23:35:09Z")

</div>

Unfortunately our new newick parsing introduced a few other bugs and I’ve had to switch back to the old way. This means that the handling of quoted strain names (such as the tree in this post) are problematic again. To avoid rendering incorrect trees I’ve made trees with quotes in them result in an error while we sort this out. Thanks!

---

<div class="post-metadata">

**Author:** ![krisandra](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/krisandra/32/563_2.png) [@krisandra](https://nextstrain.discourse.group/u/krisandra)\
**Post date:** [January 18, 2024, 3:53pm UTC](https://nextstrain.discourse.group/t/displaying-trees-from-ncbi-pathogen-browser-in-auspice-us/1456/10 "2024-01-18T15:53:26Z")

</div>

@ewolfsohn You can change the tip labels when you download the newick file from NCBI. I usually choose the strain only as the label. This also makes it easier to match up the metadata file to the tip labels using whatever you choose as the tip label. Demo files attached pulled from NCBI that work on auspice  
[pdp\_metadata.tsv](https://nextstrain.discourse.group/uploads/short-url/oxA1QmB36CkIL0Soh8XbYTNTFbS.tsv) (1.6 MB)  
[pdp\_tree.newick](https://nextstrain.discourse.group/uploads/short-url/41i0HVj1z77CHsvSd1z8Lb45b4A.newick) (157.6 KB)

![image](https://canada1.discourse-cdn.com/flex031/uploads/nextstrain/original/1X/3596d23709f3f6b480938f984796b9596d07c966.png)
