archaeopteryx 1.8.1 → 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/README.md CHANGED
@@ -1,203 +1,206 @@
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/site/cmzmasek/home/software/archaeopteryx-js
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
-
36
-
37
-
38
- ### Detailed developer documentation
39
- https://docs.google.com/document/d/1COVe0iYbKtcBQxGTP4_zuimpk2FH9iusOVOgd5xCJ3A/edit
40
-
41
-
42
- ### Dependencies
43
- Archaeopteryx.js has the following dependencies:
44
- * forester.js: https://www.npmjs.com/package/archaeopteryx
45
- * phyloxml.js: https://www.npmjs.com/package/phyloxml
46
- * d3.js (version 3): https://www.npmjs.com/package/d3/v/3.5.17
47
- * jQuery (1.12.4): https://www.npmjs.com/package/jquery/v/1.12.4
48
- * jQuery UI (1.12.1): https://www.npmjs.com/package/jquery-ui/v/1.12.1
49
- * sax.js (1.2.4): https://www.npmjs.com/package/sax/v/1.2.4
50
-
51
- For file (Newick/New Hampshire, phyloXML) and graphics (PNG, SVG)
52
- download/export, the following five libraries are required as well:
53
- * canvg: https://www.npmjs.com/package/canvg
54
- * rgbcolor: https://www.npmjs.com/package/rgbcolor
55
- * Blob.js: https://github.com/eligrey/Blob.js
56
- * canvas-toBlob.js (needed in some versions of Internet Explorer and Opera): https://github.com/eligrey/canvas-toBlob.js
57
- * FileSaver.js: https://github.com/eligrey/FileSaver.js
58
-
59
- Additionally, Archaeopteryx.js also requires the following CSS:
60
- * jquery-ui.css: https://code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css
61
-
62
-
63
- ## Basic Example of HTML for launching Archaeopteryx.js
64
-
65
- Example of HTML page to launch a basic Archaeopteryx.js instance:
66
- ```
67
- <!DOCTYPE html>
68
- <meta charset="utf-8">
69
- <head>
70
- <title>Archaeopteryx.js Basic Demo</title>
71
-
72
- <!-- For MS IE/Edge compatibility:-->
73
- <meta http-equiv="X-UA-Compatible" content="IE=100">
74
-
75
- <!-- D3.js, jQuery, and jQuery UI:-->
76
- <script src="http://d3js.org/d3.v3.min.js"></script>
77
- <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
78
- <script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js"></script>
79
-
80
- <!-- SAX XML parser:-->
81
- <script src="http://www.phyloxml.org/js/dependencies/sax.js"></script>
82
-
83
- <!-- Archaeopteryx.js requires forester.js and phyloxml.js:-->
84
- <script src="http://path/to/phyloxml.js"></script>
85
- <script src="http://path/to/forester.js"></script>
86
- <script src="http://path/to/archaeopteryx.js"></script>
87
-
88
- <!-- CSS for jQuery UI: -->
89
- <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css">
90
-
91
- <script>
92
- function load() {
93
- var options = {};
94
- options.backgroundColorDefault = '#f0f0f0';
95
- var settings = {};
96
- var loc = 'https://raw.githubusercontent.com/cmzmasek/archaeopteryx-js/master/test/data/phyloxml_trees/apaf.xml';
97
-
98
- jQuery.get(loc,
99
- function (data) {
100
- var tree = null;
101
- try {
102
- tree = archaeopteryx.parseTree(loc, data, true, false);
103
- }
104
- catch (e) {
105
- alert("error while parsing tree: " + e);
106
- }
107
- if (tree) {
108
- try {
109
- archaeopteryx.launch('#phylogram1', tree, options, settings);
110
- }
111
- catch (e) {
112
- alert("error while launching archaeopteryx: " + e);
113
- }
114
- }
115
- },
116
- "text")
117
- .fail(function () {
118
- alert("error: failed to read tree(s) from \"" + loc + "\"");
119
- }
120
- );
121
- }
122
- </script>
123
- </head>
124
-
125
- <body onload="load()">
126
- <div>
127
- <h2>Archaeopteryx.js Basic Demo</h2>
128
- <div id='phylogram1'></div>
129
- <div id='controls0' class='ui-widget-content'></div>
130
- </div>
131
- </body>
132
- ```
133
-
134
-
135
-
136
-
137
- # forester.js
138
- forester.js is a general suite for dealing with phylogenetic trees.
139
-
140
- ## forester.js Example
141
-
142
- This basic example shows how to parse a New Hampshire formatted String
143
- into to a object representing a phylogenetic tree.
144
- Followed by pre- and post-order traversal,
145
- and writing back to a New Hampshire formatted String.
146
-
147
- Change './forester' to 'forester' if you use this code outside of this package
148
-
149
- ```
150
- var forester = require('./forester').forester;
151
-
152
- var newHampshireFormattedString = "(((a:1,b:1,c:1)N:2,(d:1,e:1)M:4)O:4,f:1)R:1;";
153
- var phylogeneticTree = forester.parseNewHampshire(newHampshireFormattedString);
154
-
155
- console.log('Pre-order traversal:');
156
- forester.preOrderTraversalAll(forester.getTreeRoot(phylogeneticTree), function (n) {
157
- console.log(n.name + ':' + n.branch_length);
158
- });
159
-
160
- console.log('Post-order traversal:');
161
- forester.postOrderTraversalAll(forester.getTreeRoot(phylogeneticTree), function (n) {
162
- console.log(n.name + ':' + n.branch_length);
163
- });
164
-
165
- console.log('In New Hampshire format:');
166
- var nh = forester.toNewHampshire(phylogeneticTree);
167
- console.log(nh);
168
- ```
169
-
170
- Expected output:
171
-
172
- ```
173
- Pre-order traversal:
174
- R:1
175
- f:1
176
- O:4
177
- M:4
178
- e:1
179
- d:1
180
- N:2
181
- c:1
182
- b:1
183
- a:1
184
- Post-order traversal:
185
- a:1
186
- b:1
187
- c:1
188
- N:2
189
- d:1
190
- e:1
191
- M:4
192
- O:4
193
- f:1
194
- R:1
195
- In New Hampshire format:
196
- (((a:1,b:1,c:1)N:2,(d:1,e:1)M:4)O:4,f:1)R:1;
197
- ```
198
-
199
-
200
-
201
-
202
-
203
-
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
+