Skip to content

Commit

Permalink
newick-js 1.1.1 seems to work.
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav committed Jul 5, 2023
1 parent e13b647 commit 7eac66b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
},
"license": "MIT",
"author": "Gaurav Vaidya <[email protected]>",
"type": "module",
"main": "src/index.js",
"bin": {
"phyx2owl": "bin/phyx2owl.js",
Expand Down
10 changes: 5 additions & 5 deletions src/wrappers/PhylogenyWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
const { has } = require('lodash');

/** Used to parse Newick strings. */
const parseNewick = require('newick-js').parse;
const newickJs = require('newick-js');

/** OWL terms to be used here. */
const owlterms = require('../utils/owlterms');
Expand Down Expand Up @@ -73,9 +73,9 @@ class PhylogenyWrapper {
});
}

// Finally, try parsing it with parseNewick and see if we get an error.
// Finally, try parsing it with newickJs.parse() and see if we get an error.
try {
parseNewick(newickTrimmed);
newickJs.parse(newickTrimmed);
} catch (ex) {
errors.push({
title: 'Error parsing phylogeny',
Expand Down Expand Up @@ -152,7 +152,7 @@ class PhylogenyWrapper {
// - 'both': Return node labels on both internal and terminal nodes.

// Parse the phylogeny (will throw an exception if parsing failed).
const { graph } = parseNewick(this.phylogeny.newick || '()');
const { graph } = newickJs.parse(this.phylogeny.newick || '()');
const [vertices, arcs] = graph;

if (nodeType === 'both') {
Expand Down Expand Up @@ -252,7 +252,7 @@ class PhylogenyWrapper {
// This method provides a similar facility using the newick-js library.
//
// Throws an exception if the Newick could not be parsed.
const { graph, root, rootWeight } = parseNewick(newick);
const { graph, root, rootWeight } = newickJs.parse(newick);
const [, arcs] = graph;

// Go through the arcs, assigning 'children' to the appropriate parent node.
Expand Down

0 comments on commit 7eac66b

Please sign in to comment.