Skip to content

Commit 4bfadcf

Browse files
committed
updating neighbor joining documentation
1 parent 86974d4 commit 4bfadcf

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

test/neighbor-join-test.js

+7-11
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
1-
var fs = require("fs");
2-
3-
var tape = require("tape"),
1+
const tape = require("tape"),
42
phylotree = require("../dist/phylotree");
53

6-
tape("tip length export", function(test) {
4+
tape("neighbor joining", function(test) {
75

8-
let D = [
6+
const D = [
97
[0, 5, 9, 9, 8],
108
[5, 0, 10, 10, 9],
119
[9, 10, 0, 8, 7],
1210
[9, 10, 8, 0, 3],
1311
[8, 9, 7, 3, 0]
1412
];
1513

16-
let nodeList = ["A","B","C","D","E"];
17-
let nj = phylotree.neighborJoining(D, nodeList.length, nodeList)
18-
let expectedTree = "((((A:2,B:3)InternalNode0:3,C:4)InternalNode1:2,D:2)InternalNode2:0.5,E:0.5):0;"
19-
test.equal(nj.getNewick(), expectedTree)
14+
const nodeList = ["A","B","C","D","E"];
15+
const nj = phylotree.neighborJoining(D, nodeList.length, nodeList);
16+
const expectedTree = "((((A:2,B:3)InternalNode0:3,C:4)InternalNode1:2,D:2)InternalNode2:0.5,E:0.5):0;";
17+
test.equal(nj.getNewick(), expectedTree);
2018
test.end();
2119

2220
});
23-
24-

0 commit comments

Comments
 (0)