veg / phylotree.js

Interactive viewer of phylogenetic trees
http://phylotree.hyphy.org
MIT License
169 stars 77 forks source link

XML Parsing Error when parsing newick file #435

Closed bjaysheel closed 1 year ago

bjaysheel commented 1 year ago

Hi, Let me prefix by saying that I have inherited this project and I am not familiar with Drupal, Tripal and/or phlyotree integration.

I have confirmed that all libraries are installed, they are of correct version and when page load its looking for libraries such as d3js3 in the right place.

Problem: When the page loads, a phylogeny tree is show on the page, however when I click on any part the tree, or the menu buttons on top of the tree the who page reloads. In the JS console I see that at page load I get an error

XML Parsing Error: syntax error Location: http://galen.dbi.udel.edu:8080/sites/default/files/its_all_same_length.newick Line Number 1, Column 1:

The file exists and the content of the file are correct (network panel shows the raw data). I can also see that phlyotree.js is loaded on the page.

I am complete lost as to what might be wrong, why I am getting the xml parsing error and how to fix it.

Any pointer will be greatly appreciated.

Thank you Jaysheel.

p.s: I think you can visit the link in the error above to the see working example.

stevenweaver commented 1 year ago

Dear @bjaysheel,

The file you provided is Newick format, not phyloXML. Please remove specifying xml when instantiating phylotree.

You can verify that your tree works here -- http://phylotree.hyphy.org

Best, Steven

bjaysheel commented 1 year ago

Hey Steven, Do you by any chance know where it settings within Drupal and Tripal framwork that specifies xml over newick? I have looked through tripal extension settings for Phylotree, and even under the view template but there are no settings for file type.

Thanks Jaysheel

stevenweaver commented 1 year ago

Dear @bjaysheel,

Not a clue. If the repo is open source you can send a link over and I can take a peek.

Best, Steven

bjaysheel commented 1 year ago

Here is the link for the project

[https://git.drupalcode.org/project/phylotree]

I see a content type created with extension filters set to newick, nwk, nhx

Jaysheel

stevenweaver commented 1 year ago

Do you have a page where it is failing? When I search trees with your application, it renders for me.

I do notice that xml detection is a bit fragile. If you were to have a < character to start your Newick file, phylotree would interpret it as xml. Later versions of phylotree allow you to explicitly state which format you are passing in.

Best, Steven

bjaysheel commented 1 year ago

Yes, the page does render, but the trouble is when you click on any node inside the tree or the tool bar on top the page refreshes. It should highlight the node as per the example you sent here http://phylotree.hyphy.org/

I have doubled checked the newick file there aren't any special characters other than () and , I can download and load the file on phlyotree without any issues

http://galen.dbi.udel.edu:8080/sites/default/files/its_all_same_length.newick

stevenweaver commented 1 year ago

Dear @bjaysheel,

I saw the error last night, but everything seems to be working now. Is it OK to close this ticket?

Best, Steven

bjaysheel commented 1 year ago

Yes we can close the case, teammate found an onclick event in the ds module that caused a page refresh. Thank you for your help.

Jaysheel