archaeopteryx 3.17.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 CHANGED
@@ -722,25 +722,55 @@ Ages (`unit="mya"` and friends, or values that look like ages) get the
722
722
  **geologic axis**: two rows of ICS intervals in their official colours —
723
723
  Period over Epoch for most trees, coarser pairs for Precambrian-deep ones —
724
724
  plus a "Ma before present" ruler. Years (`unit="year"`, or values that look
725
- like calendar years) get a labelled **calendar axis** instead. The tree's
726
- layout itself never changes: time is an overlay calibrated by the dates, so
727
- it also works for a fossil-only tree, where the axis simply stops at the
728
- youngest tip and labels that age (the ammonite demo ends at the K-Pg, 66).
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).
729
729
 
730
730
  Nodes with a date **range** (`minimum`/`maximum` — minimum is the younger
731
731
  bound) draw uncertainty bars: translucent blue **HPD age bars** on internal
732
- nodes, and on tips whatever the axis says the range means. On **geologic**
733
- time it is a fossil's observed range: sepia **fossil-range (FAD/LAD) bars with
734
- end caps**. On **calendar** time it is the uncertainty of a **sampling date**
735
- — a virus sample dated only to its month or year — drawn like an age bar,
736
- slimmer, and only when it has a width: a tip dated to the day draws nothing.
737
- Node
738
- tooltips show the date. The **Time Axis** checkbox under Display Data toggles
739
- everything; the axis needs a phylogram (branch lengths carry the time) and
740
- the rectangular layout. **Time Grid** (off by default, like the desktop's
741
- "Time axis grid lines") adds faint vertical lines behind the tree at the
742
- fine geologic-interval boundaries or the calendar year ticks, so a node's
743
- position can be read against the axis.
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.
744
774
 
745
775
  # forester.js
746
776
  forester.js is a general suite for dealing with phylogenetic trees.
@@ -940,16 +970,21 @@ A protein/DNA/RNA characters matrix in a Nexus file
940
970
  (sequential or interleaved) lands on the tips as an aligned `mol_seq`, so the
941
971
  alignment track appears just as it does for phyloXML.
942
972
 
943
- An Auspice dataset opens on the **time view** (branch lengths from `num_date`
944
- differences; a divergence-only build falls back to `div` differences): the
945
- calendar time axis and node-age bars come from `num_date` and its confidence
946
- interval, and every trait (country, host, clade, ...) becomes a
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
947
980
  `nextstrain:<trait>` node property — so Color-by, search and the node dialog
948
981
  pick them up. Both metrics are retained, and
949
982
  `forester.applyTimeBranchLengths(phy)` /
950
983
  `forester.applyDivergenceBranchLengths(phy)` /
951
- `forester.hasTimeAndDivergence(phy)` are the plumbing for a future
952
- time↔divergence display toggle.
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.
953
988
 
954
989
  **BEAST-style and NHX annotations** in Newick/Nexus input are always parsed
955
990
  (they used to be discarded): in a `[&key=value,...]` blob — as written by
@@ -1145,8 +1180,8 @@ between them rather than either one being shrunk.
1145
1180
 
1146
1181
  The **control panel itself** follows the same idea. It opens showing the
1147
1182
  sections that describe the tree — what it can be coloured by, what it shows —
1148
- plus Search, and folds the ones that are adjustments to make later: Zoom,
1149
- 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
1150
1185
  page and across reloads, so a panel you have arranged stays arranged, even
1151
1186
  when you switch to another tree. In a short window it also keeps itself to one
1152
1187
  screen: opening a section folds the one you opened longest ago, and dragging
@@ -2233,11 +2268,15 @@ loops). Calibration: the **largest** date value is the root age (geologic)
2233
2268
  or the present (calendar) — no unit conversion is done, so a Ga-valued tree
2234
2269
  is misbanded exactly as on the desktop.
2235
2270
 
2236
- Rendering (phylogram + rectangular only; the layout never changes): age→x is
2237
- `anchorX + (anchorAge − age) × corr` with `corr` the branch-length scale's
2238
- slope, anchored at the **deepest dated tip** rather than the root — the root
2239
- and its direct children carry a synthetic half-average branch length, which
2240
- would shift every band. The geologic axis draws
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
2241
2280
  `forester.geoBandRanks(rootAge)` — the finest of Period/Epoch, Era/Period,
2242
2281
  Eon/Era that still covers the range — as two 13 px rows of ICS intervals
2243
2282
  (official colours; ink by the same luminance rule), clipped to