archaeopteryx 3.16.0 → 3.18.0
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 +129 -38
- package/archaeopteryx.d.ts +2 -0
- package/archaeopteryx.js +1166 -255
- package/forester.js +479 -111
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -630,7 +630,8 @@ missing symbol `?` arrives as `X` or `N`. A phyloXML `<mol_seq>` is kept
|
|
|
630
630
|
exactly as written, by both programs. Sequences
|
|
631
631
|
of *unequal* length are not an alignment and cannot form a character matrix,
|
|
632
632
|
so they are not written at all — the file says so in a bracketed comment
|
|
633
|
-
rather than padding them into an alignment that does not exist
|
|
633
|
+
rather than padding them into an alignment that does not exist, and the
|
|
634
|
+
Nexus entry of the Download menu says so before you choose it.
|
|
634
635
|
|
|
635
636
|
## Heat maps
|
|
636
637
|
|
|
@@ -721,25 +722,55 @@ Ages (`unit="mya"` and friends, or values that look like ages) get the
|
|
|
721
722
|
**geologic axis**: two rows of ICS intervals in their official colours —
|
|
722
723
|
Period over Epoch for most trees, coarser pairs for Precambrian-deep ones —
|
|
723
724
|
plus a "Ma before present" ruler. Years (`unit="year"`, or values that look
|
|
724
|
-
like calendar years) get a labelled **calendar axis
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
725
|
+
like calendar years) get a labelled **calendar axis**. The layout itself
|
|
726
|
+
never changes: time is an overlay calibrated by the dates, so it also works
|
|
727
|
+
for a fossil-only tree, where the axis stops at the youngest tip and labels
|
|
728
|
+
that age (the ammonite demo ends at the K-Pg, 66).
|
|
728
729
|
|
|
729
730
|
Nodes with a date **range** (`minimum`/`maximum` — minimum is the younger
|
|
730
731
|
bound) draw uncertainty bars: translucent blue **HPD age bars** on internal
|
|
731
|
-
nodes, and on tips whatever the axis says the range means
|
|
732
|
-
time
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
732
|
+
nodes, and on tips whatever the axis says the range means — on geologic
|
|
733
|
+
time a fossil's observed range, sepia **FAD/LAD bars with end caps**; on
|
|
734
|
+
calendar time the uncertainty of a **sampling date**, drawn like an age bar,
|
|
735
|
+
slimmer, and only when it has a width. Node tooltips show the date. The
|
|
736
|
+
**Time Axis** checkbox under Display Data toggles everything; the axis needs
|
|
737
|
+
a phylogram and the rectangular or circular layout. In **circular** the bars
|
|
738
|
+
run along each node's spoke — on through the centre where a range reaches
|
|
739
|
+
back past the root's own age — the ruler runs out from the root along the
|
|
740
|
+
gap between the last tip and the first, turning with the tree, and a
|
|
741
|
+
geologic axis lays its intervals down as coloured rings. **Time Grid** (off
|
|
742
|
+
by default) adds faint lines, or rings, at the fine interval boundaries or
|
|
743
|
+
the calendar years.
|
|
744
|
+
|
|
745
|
+
### Time | Div
|
|
746
|
+
|
|
747
|
+
Where a tree can be laid out by **time** and by **divergence**, a
|
|
748
|
+
**Time | Div** switch appears beside the phylogram buttons (⌘⇧X). Two kinds
|
|
749
|
+
of tree state a divergence: an Auspice build, on its nodes (`div`), and a
|
|
750
|
+
BEAST clock-model tree, as a clock `rate` on every branch — its branch
|
|
751
|
+
lengths are time, and its divergence is each length times its rate, in
|
|
752
|
+
substitutions per site. A tree with neither has no second layout. A rate or
|
|
753
|
+
a recorded divergence is a plain decimal number (`0.01abc` is not one); a
|
|
754
|
+
negative divergence is a value, drawn at 0.
|
|
755
|
+
|
|
756
|
+
The switch is offered only when both layouts can state **every** branch —
|
|
757
|
+
every node dated, every branch with a length, and divergence on every node
|
|
758
|
+
or a rate on every branch — and each picture has some depth. A value the
|
|
759
|
+
file states counts, whether zero or negative; where one is missing the
|
|
760
|
+
switch is withheld rather than a branch drawn at a length the file never
|
|
761
|
+
gave. Whether the two pictures differ is not asked: a strict clock's
|
|
762
|
+
divergence is its time at another scale, and it is offered like any other.
|
|
763
|
+
|
|
764
|
+
Back in Time the tree has exactly the lengths it arrived with. A span that
|
|
765
|
+
runs backwards — a child dated before its parent, which real Nextstrain
|
|
766
|
+
builds state — keeps its sign, and is drawn at length 0 like any negative
|
|
767
|
+
branch length. The switch acts on the whole tree, also from a subtree view,
|
|
768
|
+
and a node deleted meanwhile leaves the branch that takes its place spanning
|
|
769
|
+
what both spanned, in either layout. The time axis is hidden while the
|
|
770
|
+
branches show divergence. Each layout stamps the tree's `branch_length_unit`
|
|
771
|
+
(`subs/site`; for time the dates' unit, or `time`), so a tree saved while
|
|
772
|
+
Div is on screen says so and opens again showing divergence. All of this is
|
|
773
|
+
shared with the desktop.
|
|
743
774
|
|
|
744
775
|
# forester.js
|
|
745
776
|
forester.js is a general suite for dealing with phylogenetic trees.
|
|
@@ -939,16 +970,21 @@ A protein/DNA/RNA characters matrix in a Nexus file
|
|
|
939
970
|
(sequential or interleaved) lands on the tips as an aligned `mol_seq`, so the
|
|
940
971
|
alignment track appears just as it does for phyloXML.
|
|
941
972
|
|
|
942
|
-
An Auspice dataset
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
973
|
+
An Auspice dataset has no branch lengths of its own, so it opens in the
|
|
974
|
+
metric it states completely: the **time view** when every node states a
|
|
975
|
+
`num_date` (branch lengths are the `num_date` differences, sign kept), else
|
|
976
|
+
the divergence view when every node states a `div`, else time if any node is
|
|
977
|
+
dated. In the time view the calendar time axis and node-age bars come from
|
|
978
|
+
`num_date` and its confidence interval, and every trait (country, host,
|
|
979
|
+
clade, ...) becomes a
|
|
946
980
|
`nextstrain:<trait>` node property — so Color-by, search and the node dialog
|
|
947
981
|
pick them up. Both metrics are retained, and
|
|
948
982
|
`forester.applyTimeBranchLengths(phy)` /
|
|
949
983
|
`forester.applyDivergenceBranchLengths(phy)` /
|
|
950
|
-
`forester.hasTimeAndDivergence(phy)` are the plumbing
|
|
951
|
-
|
|
984
|
+
`forester.hasTimeAndDivergence(phy)` are the plumbing behind the
|
|
985
|
+
**Time | Div** switch. The two `apply` functions answer `true` when they
|
|
986
|
+
laid the tree out, and `false` — leaving every branch length as it was —
|
|
987
|
+
when their layout cannot state every branch.
|
|
952
988
|
|
|
953
989
|
**BEAST-style and NHX annotations** in Newick/Nexus input are always parsed
|
|
954
990
|
(they used to be discarded): in a `[&key=value,...]` blob — as written by
|
|
@@ -1004,12 +1040,62 @@ a popup any more, and nothing fails silently.
|
|
|
1004
1040
|
| **MrBayes** annotations | in (embedded in Newick/Nexus) | `prob=`/`prob.stddev=` blobs: posterior-probability clade support. | [8] |
|
|
1005
1041
|
| **Metadata table** (`.tsv`, `.csv`) | in (beside a tree) | A header row and one row per tip, the first column naming the tip: every other column is joined onto the tips as a property, so it is offered for Color-by and Shape, searched, shown in the node data and written into phyloXML exports. See [Metadata tables](#metadata-tables). | — |
|
|
1006
1042
|
| **FASTA** | out | The molecular sequence(s) of the selected tip(s), or every sequence the tree carries. Offered in the Download menu only when the tree actually carries molecular sequences (aligned or not). | [9] |
|
|
1007
|
-
| SVG · PNG · vector PDF | out |
|
|
1043
|
+
| SVG · PNG · vector PDF | out | The drawn tree for publication or further editing — vector (SVG, PDF) or raster (PNG), either as shown on screen or the whole tree at full size (see [Downloads](#downloads)). General-purpose graphics formats, not phylogenetic data, so no literature reference applies. | — |
|
|
1008
1044
|
|
|
1009
1045
|
The parser for a given input is auto-detected (see **The entry points**
|
|
1010
1046
|
above); the Download menu offers whichever output formats the current tree
|
|
1011
1047
|
can carry.
|
|
1012
1048
|
|
|
1049
|
+
### Downloads
|
|
1050
|
+
|
|
1051
|
+
The panel's **Download** section (folded until you open it) holds the choices
|
|
1052
|
+
every download shares, and its **Download…** button opens the format menu,
|
|
1053
|
+
grouped as Graphics, Tree and Tip data. Each entry says what that format keeps — phyloXML everything the
|
|
1054
|
+
tree carries, Newick only names, branch lengths and support — and the Nexus
|
|
1055
|
+
entry says, before you pick it, whether the file will carry the alignment or,
|
|
1056
|
+
when the sequences are of unequal length, why it cannot.
|
|
1057
|
+
|
|
1058
|
+
* **Name** — the file name; each format adds its own extension (a typed
|
|
1059
|
+
`.svg` or `.tre` is not doubled). It starts as the tree's name.
|
|
1060
|
+
* **Graphics: As shown / Full size** — what SVG, PDF and PNG draw. *As shown*
|
|
1061
|
+
is the window: the part of the tree in view, at the current zoom. *Full
|
|
1062
|
+
size* (the default) is the whole tree, re-laid-out large enough that no tip
|
|
1063
|
+
name has to be hidden — in rows in the rectangular layout, around the ring in
|
|
1064
|
+
the circular one — and cropped to the drawing, with the legends (colour,
|
|
1065
|
+
shape, domains, the heat-map ring's scale) stacked beside the tree rather
|
|
1066
|
+
than over it. The window itself is left exactly as it was. An unrooted fan
|
|
1067
|
+
is enlarged only while that still frees names: tips on very short branches
|
|
1068
|
+
can collide at any size. An alignment track is drawn as its window, the
|
|
1069
|
+
columns in view, in a full-size figure too: a genome-length alignment drawn
|
|
1070
|
+
whole would be hundreds of thousands of cells.
|
|
1071
|
+
* **PNG: 2× / 4× / 8×** — the image's resolution relative to the screen
|
|
1072
|
+
(`pngExportScale` sets the starting choice, snapped to one of the three). A browser caps how large a
|
|
1073
|
+
canvas it will paint; past that the PNG comes out at the largest scale it can
|
|
1074
|
+
paint, with a console warning, rather than blank.
|
|
1075
|
+
* **Copy Newick** puts the tree on the clipboard, exactly as the Newick
|
|
1076
|
+
download writes it.
|
|
1077
|
+
* **Copy PNG** puts the picture on the clipboard, drawn as the Graphics and PNG
|
|
1078
|
+
choices say — ready to paste into a Word document or a slide. It needs a
|
|
1079
|
+
secure page (https, or localhost) and canvg, and is offered only where both
|
|
1080
|
+
are there.
|
|
1081
|
+
|
|
1082
|
+
**In a subtree, and with clades collapsed.** Every download follows the tree
|
|
1083
|
+
you are looking at. In a **subtree** the files hold the subtree only — the
|
|
1084
|
+
menu's Tree and Tip data groups say so ("subtree, 19 of 50 tips"), and
|
|
1085
|
+
phyloXML and Nexus name it after the tree, marked "(subtree)"; the subtree is
|
|
1086
|
+
written as a rooted tree of its own, its root keeping the branch that leads
|
|
1087
|
+
into it. A **collapsed** clade is how the tree is drawn, not what it holds:
|
|
1088
|
+
the graphics draw it collapsed, as on screen, and every file writes it in
|
|
1089
|
+
full.
|
|
1090
|
+
|
|
1091
|
+
**TSV** (under Tip data) writes every tip's data as a table, one row per tip in
|
|
1092
|
+
the order drawn: the node menu's **Download Ext. Node Data** for the whole
|
|
1093
|
+
tree, with the same columns, and a table that joins back onto the tree as
|
|
1094
|
+
[metadata](#metadata-tables).
|
|
1095
|
+
|
|
1096
|
+
A full-size PDF taller or wider than 200 inches (14,400 pt, the PDF page
|
|
1097
|
+
limit) is scaled onto the largest page; it is vector, so nothing is lost.
|
|
1098
|
+
|
|
1013
1099
|
Newick and Nexus files usually carry branch support as a bare internal label
|
|
1014
1100
|
(`)100:0.05`). Archaeopteryx.js recognises those automatically and treats them
|
|
1015
1101
|
as confidence values, so support-based features work without any setup. If your
|
|
@@ -1094,8 +1180,8 @@ between them rather than either one being shrunk.
|
|
|
1094
1180
|
|
|
1095
1181
|
The **control panel itself** follows the same idea. It opens showing the
|
|
1096
1182
|
sections that describe the tree — what it can be coloured by, what it shows —
|
|
1097
|
-
plus Search, and folds the ones that are adjustments to make later:
|
|
1098
|
-
Sizes and the domain controls. Whatever you open or close is then remembered, for the
|
|
1183
|
+
plus Search, and folds the ones that are adjustments to make later: View &
|
|
1184
|
+
Tools, Sizes and the domain controls. Whatever you open or close is then remembered, for the
|
|
1099
1185
|
page and across reloads, so a panel you have arranged stays arranged, even
|
|
1100
1186
|
when you switch to another tree. In a short window it also keeps itself to one
|
|
1101
1187
|
screen: opening a section folds the one you opened longest ago, and dragging
|
|
@@ -1141,7 +1227,8 @@ branch-length values and support symbols are drawn only where they fit: each
|
|
|
1141
1227
|
mark claims the box it is about to occupy, and one that would overlap a box
|
|
1142
1228
|
already claimed in that pass is left out. The claim order is the tree's own,
|
|
1143
1229
|
root first, so the mark nearer the root keeps its place and the same tree at
|
|
1144
|
-
the same size always drops the same marks — on screen and in
|
|
1230
|
+
the same size always drops the same marks — on screen and in an *As shown*
|
|
1231
|
+
export. A *Full size* figure is drawn larger, so it has room to keep more.
|
|
1145
1232
|
|
|
1146
1233
|
**The Auto-hide Labels toggle lights up while it is taking something away**,
|
|
1147
1234
|
and its tooltip says what. The switch governs three rules and the light asks
|
|
@@ -1274,7 +1361,7 @@ copy-pastable JSON.
|
|
|
1274
1361
|
| `visualizationsLegendXpos` | `254` | Legend position, x. |
|
|
1275
1362
|
| `visualizationsLegendYpos` | `30` | Legend position, y. |
|
|
1276
1363
|
| `enableDownloads` | `true` | Offer the download buttons. |
|
|
1277
|
-
| `pngExportScale` | `4` | PNG
|
|
1364
|
+
| `pngExportScale` | `4` | The PNG resolution the Download section starts on: 2, 4 or 8 (any other value is snapped to the nearest, with a console warning). |
|
|
1278
1365
|
| `nhExportWriteConfidences` | `true` | Write confidences into exported Newick. |
|
|
1279
1366
|
| `internalNumericLabels` | `'auto'` | Newick / Nexus parsing: how a bare numeric internal label (`)100:0.05`) is read. `'auto'` reads them as confidence values only when *every* internal label looks like support; `'confidence'` reads every numeric label as one, whatever its value; `'label'` keeps them as names. Replaces `nhConfidenceValuesAsInternalNames` (still accepted, with a warning; its `true` maps to `'confidence'`). |
|
|
1280
1367
|
| `nodeLabels` | `null` | Custom label-field checkboxes: `{key: {label, description, propertyRef, showButton, selected}}` — each adds a panel checkbox labelling nodes with the named property's value. (Was `launch()`'s sixth positional argument.) |
|
|
@@ -1385,11 +1472,11 @@ All 118 of them, alphabetically:
|
|
|
1385
1472
|
| `labelColorDefault` | The default label colour is fixed. |
|
|
1386
1473
|
| `minBranchLengthValueToShow` | No longer configurable. |
|
|
1387
1474
|
| `minConfidenceValueToShow` | No longer configurable. |
|
|
1388
|
-
| `nameForFastaDownload` | Download names follow `treeName
|
|
1389
|
-
| `nameForNhDownload` | Download names follow `treeName
|
|
1390
|
-
| `nameForPhyloXmlDownload` | Download names follow `treeName
|
|
1391
|
-
| `nameForPngDownload` | Download names follow `treeName
|
|
1392
|
-
| `nameForSvgDownload` | Download names follow `treeName
|
|
1475
|
+
| `nameForFastaDownload` | Download names follow `treeName`, or the Download section's Name field. |
|
|
1476
|
+
| `nameForNhDownload` | Download names follow `treeName`, or the Download section's Name field. |
|
|
1477
|
+
| `nameForPhyloXmlDownload` | Download names follow `treeName`, or the Download section's Name field. |
|
|
1478
|
+
| `nameForPngDownload` | Download names follow `treeName`, or the Download section's Name field. |
|
|
1479
|
+
| `nameForSvgDownload` | Download names follow `treeName`, or the Download section's Name field. |
|
|
1393
1480
|
| `nhExportReplaceIllegalChars` | Always on; Newick cannot carry those characters. |
|
|
1394
1481
|
| `nodeLabelGap` | The label gap is fixed. |
|
|
1395
1482
|
| `nodeSizeDefault` | Node size is fixed; the Node size slider changes it. |
|
|
@@ -2181,11 +2268,15 @@ loops). Calibration: the **largest** date value is the root age (geologic)
|
|
|
2181
2268
|
or the present (calendar) — no unit conversion is done, so a Ga-valued tree
|
|
2182
2269
|
is misbanded exactly as on the desktop.
|
|
2183
2270
|
|
|
2184
|
-
Rendering (phylogram
|
|
2185
|
-
`anchorX + (anchorAge − age) × corr` with `corr` the branch-length
|
|
2186
|
-
slope, anchored at the **deepest dated tip** rather than the root
|
|
2187
|
-
|
|
2188
|
-
|
|
2271
|
+
Rendering (phylogram, rectangular or circular; the layout never changes):
|
|
2272
|
+
age→x is `anchorX + (anchorAge − age) × corr` with `corr` the branch-length
|
|
2273
|
+
scale's slope, anchored at the **deepest dated tip** rather than the root,
|
|
2274
|
+
so the root's own branch, drawn to scale where the file states one, shifts
|
|
2275
|
+
no band. In circular the same arithmetic runs along each spoke: a bar is a
|
|
2276
|
+
segment of its node's spoke (a bound past the root's estimate a negative
|
|
2277
|
+
radius, continued through the centre), the ruler a ray along the gap between
|
|
2278
|
+
the last tip and the first, the grid and the geologic intervals rings. The
|
|
2279
|
+
geologic axis draws
|
|
2189
2280
|
`forester.geoBandRanks(rootAge)` — the finest of Period/Epoch, Era/Period,
|
|
2190
2281
|
Eon/Era that still covers the range — as two 13 px rows of ICS intervals
|
|
2191
2282
|
(official colours; ink by the same luminance rule), clipped to
|
package/archaeopteryx.d.ts
CHANGED
|
@@ -79,6 +79,8 @@ export interface ArchaeopteryxConfig {
|
|
|
79
79
|
/** 'compact' tightens the control panel's spacing and narrows it (the
|
|
80
80
|
* tree's left margin follows). The same controls, nothing hidden. */
|
|
81
81
|
panelDensity?: 'comfortable' | 'compact';
|
|
82
|
+
/** The PNG resolution the Download section starts on, snapped to its
|
|
83
|
+
* 2x, 4x or 8x. */
|
|
82
84
|
pngExportScale?: number;
|
|
83
85
|
rootOffset?: number;
|
|
84
86
|
searchAinitialValue?: string | null;
|