archaeopteryx 1.0.9 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +504 -0
- package/README.md +206 -103
- package/archaeopteryx.js +8596 -7224
- package/forester.js +1748 -1905
- package/package.json +17 -11
- package/forester_example.js +0 -25
package/README.md
CHANGED
|
@@ -1,103 +1,206 @@
|
|
|
1
|
-
#
|
|
2
|
-
Archaeopteryx.js is a software tool for the visualization and analysis of highly annotated phylogenetic trees.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
### Website
|
|
6
|
-
https://sites.google.com/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
(
|
|
103
|
-
|
|
1
|
+
# Archaeopteryx.js
|
|
2
|
+
Archaeopteryx.js is a software tool for the visualization and analysis of highly annotated phylogenetic trees.
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Website
|
|
6
|
+
https://sites.google.com/view/archaeopteryxjs
|
|
7
|
+
|
|
8
|
+
### npm
|
|
9
|
+
https://www.npmjs.com/package/archaeopteryx
|
|
10
|
+
|
|
11
|
+
### GitHub
|
|
12
|
+
https://github.com/cmzmasek/archaeopteryx-js
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Examples
|
|
16
|
+
|
|
17
|
+
* [Bcl-2 gene family](http://www.phyloxml.org/archaeopteryx-js/bcl2_js.html)
|
|
18
|
+
* Eukaryotic tree of life:
|
|
19
|
+
* [collapsed with initial depth = 5](http://www.phyloxml.org/archaeopteryx-js/euk_tol_collapsed_js.html)
|
|
20
|
+
* [uncollapsed](http://www.phyloxml.org/archaeopteryx-js/euk_tol_js.html)
|
|
21
|
+
* [Influenza HA H3 collapsed by Country](http://www.phyloxml.org/archaeopteryx-js/influenza_collapsed.html)
|
|
22
|
+
* [Amphibian phylogeny](http://www.phyloxml.org/archaeopteryx-js/amphi_frost_js.html)
|
|
23
|
+
* Visualizations:
|
|
24
|
+
* [Herpesviridae DNA polymerases](http://www.phyloxml.org/archaeopteryx-js/hg1001_js.html)
|
|
25
|
+
* RAxML examples:
|
|
26
|
+
* [bipartitions](http://www.phyloxml.org/archaeopteryx-js/raxml_bipartitions_bcl2_js.html)
|
|
27
|
+
* [bipartitionsBranchLabels](http://www.phyloxml.org/archaeopteryx-js/raxml_bipartitions_branchlabels_bcl2_js.html)
|
|
28
|
+
* MSA Residue Visualization:
|
|
29
|
+
* [Bunyaviridae Glycoprotein](http://www.phyloxml.org/archaeopteryx-js/bunya_glycoprotein.html)
|
|
30
|
+
* [Bcl-2 protein](http://www.phyloxml.org/archaeopteryx-js/bcl2_msa.html)
|
|
31
|
+
* Preset search fields:
|
|
32
|
+
* [H3N2](http://www.phyloxml.org/archaeopteryx-js/h3n2_search_js.html)
|
|
33
|
+
* Grouping of species and years for visualization:
|
|
34
|
+
* [Viral Strains](http://www.phyloxml.org/archaeopteryx-js/many_species_js.html)
|
|
35
|
+
* SARS-CoV-2 with mutations and PANGO lineages:
|
|
36
|
+
* [SARS-CoV-2](http://www.phyloxml.org/archaeopteryx-js/sars_cov_3.html)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Detailed developer documentation
|
|
40
|
+
https://docs.google.com/document/d/1COVe0iYbKtcBQxGTP4_zuimpk2FH9iusOVOgd5xCJ3A/edit
|
|
41
|
+
|
|
42
|
+
### Version History
|
|
43
|
+
https://github.com/cmzmasek/archaeopteryx-js/wiki/Archaeopteryx.js-Version-History
|
|
44
|
+
|
|
45
|
+
### Dependencies
|
|
46
|
+
Archaeopteryx.js has the following dependencies:
|
|
47
|
+
* forester.js: https://www.npmjs.com/package/archaeopteryx
|
|
48
|
+
* phyloxml.js: https://www.npmjs.com/package/phyloxml
|
|
49
|
+
* d3.js (version 3): https://www.npmjs.com/package/d3/v/3.5.17
|
|
50
|
+
* jQuery (1.12.4): https://www.npmjs.com/package/jquery/v/1.12.4
|
|
51
|
+
* jQuery UI (1.12.1): https://www.npmjs.com/package/jquery-ui/v/1.12.1
|
|
52
|
+
* sax.js (1.2.4): https://www.npmjs.com/package/sax/v/1.2.4
|
|
53
|
+
|
|
54
|
+
For file (Newick/New Hampshire, phyloXML) and graphics (PNG, SVG)
|
|
55
|
+
download/export, the following five libraries are required as well:
|
|
56
|
+
* canvg: https://www.npmjs.com/package/canvg
|
|
57
|
+
* rgbcolor: https://www.npmjs.com/package/rgbcolor
|
|
58
|
+
* Blob.js: https://github.com/eligrey/Blob.js
|
|
59
|
+
* canvas-toBlob.js (needed in some versions of Internet Explorer and Opera): https://github.com/eligrey/canvas-toBlob.js
|
|
60
|
+
* FileSaver.js: https://github.com/eligrey/FileSaver.js
|
|
61
|
+
|
|
62
|
+
Additionally, Archaeopteryx.js also requires the following CSS:
|
|
63
|
+
* jquery-ui.css: https://code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## Basic Example of HTML for launching Archaeopteryx.js
|
|
67
|
+
|
|
68
|
+
Example of HTML page to launch a basic Archaeopteryx.js instance:
|
|
69
|
+
```
|
|
70
|
+
<!DOCTYPE html>
|
|
71
|
+
<meta charset="utf-8">
|
|
72
|
+
<head>
|
|
73
|
+
<title>Archaeopteryx.js Basic Demo</title>
|
|
74
|
+
|
|
75
|
+
<!-- For MS IE/Edge compatibility:-->
|
|
76
|
+
<meta http-equiv="X-UA-Compatible" content="IE=100">
|
|
77
|
+
|
|
78
|
+
<!-- D3.js, jQuery, and jQuery UI:-->
|
|
79
|
+
<script src="http://d3js.org/d3.v3.min.js"></script>
|
|
80
|
+
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
|
|
81
|
+
<script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js"></script>
|
|
82
|
+
|
|
83
|
+
<!-- SAX XML parser:-->
|
|
84
|
+
<script src="http://www.phyloxml.org/js/dependencies/sax.js"></script>
|
|
85
|
+
|
|
86
|
+
<!-- Archaeopteryx.js requires forester.js and phyloxml.js:-->
|
|
87
|
+
<script src="http://path/to/phyloxml.js"></script>
|
|
88
|
+
<script src="http://path/to/forester.js"></script>
|
|
89
|
+
<script src="http://path/to/archaeopteryx.js"></script>
|
|
90
|
+
|
|
91
|
+
<!-- CSS for jQuery UI: -->
|
|
92
|
+
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css">
|
|
93
|
+
|
|
94
|
+
<script>
|
|
95
|
+
function load() {
|
|
96
|
+
var options = {};
|
|
97
|
+
options.backgroundColorDefault = '#f0f0f0';
|
|
98
|
+
var settings = {};
|
|
99
|
+
var loc = 'https://raw.githubusercontent.com/cmzmasek/archaeopteryx-js/master/test/data/phyloxml_trees/apaf.xml';
|
|
100
|
+
|
|
101
|
+
jQuery.get(loc,
|
|
102
|
+
function (data) {
|
|
103
|
+
var tree = null;
|
|
104
|
+
try {
|
|
105
|
+
tree = archaeopteryx.parseTree(loc, data, true, false);
|
|
106
|
+
}
|
|
107
|
+
catch (e) {
|
|
108
|
+
alert("error while parsing tree: " + e);
|
|
109
|
+
}
|
|
110
|
+
if (tree) {
|
|
111
|
+
try {
|
|
112
|
+
archaeopteryx.launch('#phylogram1', tree, options, settings);
|
|
113
|
+
}
|
|
114
|
+
catch (e) {
|
|
115
|
+
alert("error while launching archaeopteryx: " + e);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"text")
|
|
120
|
+
.fail(function () {
|
|
121
|
+
alert("error: failed to read tree(s) from \"" + loc + "\"");
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
</script>
|
|
126
|
+
</head>
|
|
127
|
+
|
|
128
|
+
<body onload="load()">
|
|
129
|
+
<div>
|
|
130
|
+
<h2>Archaeopteryx.js Basic Demo</h2>
|
|
131
|
+
<div id='phylogram1'></div>
|
|
132
|
+
<div id='controls0' class='ui-widget-content'></div>
|
|
133
|
+
</div>
|
|
134
|
+
</body>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
# forester.js
|
|
141
|
+
forester.js is a general suite for dealing with phylogenetic trees.
|
|
142
|
+
|
|
143
|
+
## forester.js Example
|
|
144
|
+
|
|
145
|
+
This basic example shows how to parse a New Hampshire formatted String
|
|
146
|
+
into to a object representing a phylogenetic tree.
|
|
147
|
+
Followed by pre- and post-order traversal,
|
|
148
|
+
and writing back to a New Hampshire formatted String.
|
|
149
|
+
|
|
150
|
+
Change './forester' to 'forester' if you use this code outside of this package
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
var forester = require('./forester').forester;
|
|
154
|
+
|
|
155
|
+
var newHampshireFormattedString = "(((a:1,b:1,c:1)N:2,(d:1,e:1)M:4)O:4,f:1)R:1;";
|
|
156
|
+
var phylogeneticTree = forester.parseNewHampshire(newHampshireFormattedString);
|
|
157
|
+
|
|
158
|
+
console.log('Pre-order traversal:');
|
|
159
|
+
forester.preOrderTraversalAll(forester.getTreeRoot(phylogeneticTree), function (n) {
|
|
160
|
+
console.log(n.name + ':' + n.branch_length);
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
console.log('Post-order traversal:');
|
|
164
|
+
forester.postOrderTraversalAll(forester.getTreeRoot(phylogeneticTree), function (n) {
|
|
165
|
+
console.log(n.name + ':' + n.branch_length);
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
console.log('In New Hampshire format:');
|
|
169
|
+
var nh = forester.toNewHampshire(phylogeneticTree);
|
|
170
|
+
console.log(nh);
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Expected output:
|
|
174
|
+
|
|
175
|
+
```
|
|
176
|
+
Pre-order traversal:
|
|
177
|
+
R:1
|
|
178
|
+
f:1
|
|
179
|
+
O:4
|
|
180
|
+
M:4
|
|
181
|
+
e:1
|
|
182
|
+
d:1
|
|
183
|
+
N:2
|
|
184
|
+
c:1
|
|
185
|
+
b:1
|
|
186
|
+
a:1
|
|
187
|
+
Post-order traversal:
|
|
188
|
+
a:1
|
|
189
|
+
b:1
|
|
190
|
+
c:1
|
|
191
|
+
N:2
|
|
192
|
+
d:1
|
|
193
|
+
e:1
|
|
194
|
+
M:4
|
|
195
|
+
O:4
|
|
196
|
+
f:1
|
|
197
|
+
R:1
|
|
198
|
+
In New Hampshire format:
|
|
199
|
+
(((a:1,b:1,c:1)N:2,(d:1,e:1)M:4)O:4,f:1)R:1;
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|