Skip to content

Commit

Permalink
updating neighbor joining documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenweaver committed Sep 24, 2022
1 parent 86974d4 commit 4bfadcf
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions test/neighbor-join-test.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
var fs = require("fs");

var tape = require("tape"),
const tape = require("tape"),
phylotree = require("../dist/phylotree");

tape("tip length export", function(test) {
tape("neighbor joining", function(test) {

let D = [
const D = [
[0, 5, 9, 9, 8],
[5, 0, 10, 10, 9],
[9, 10, 0, 8, 7],
[9, 10, 8, 0, 3],
[8, 9, 7, 3, 0]
];

let nodeList = ["A","B","C","D","E"];
let nj = phylotree.neighborJoining(D, nodeList.length, nodeList)
let expectedTree = "((((A:2,B:3)InternalNode0:3,C:4)InternalNode1:2,D:2)InternalNode2:0.5,E:0.5):0;"
test.equal(nj.getNewick(), expectedTree)
const nodeList = ["A","B","C","D","E"];
const nj = phylotree.neighborJoining(D, nodeList.length, nodeList);
const expectedTree = "((((A:2,B:3)InternalNode0:3,C:4)InternalNode1:2,D:2)InternalNode2:0.5,E:0.5):0;";
test.equal(nj.getNewick(), expectedTree);
test.end();

});


0 comments on commit 4bfadcf

Please sign in to comment.