archaeopteryx 3.18.0 → 3.20.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
@@ -247,9 +247,20 @@ A phylogram carries a **scale bar** at the bottom left: a round number of
247
247
  branch-length units (1, 2 or 5 × 10ᵏ, whichever makes the bar about 100 px)
248
248
  with its length written above it. It is drawn with the tree, so it zooms and
249
249
  exports with it and its label always holds. A cladogram has nothing to
250
- measure and shows none, and a tree under a time axis leaves the measuring to
250
+ measure and shows none, and a tree under a scale axis leaves the measuring to
251
251
  the axis.
252
252
 
253
+ **Scale Axis** under Display Data (off by default, as on the desktop) draws a
254
+ labelled ruler under a phylogram, from 0 at the root out to the deepest tip, in
255
+ the tree's branch-length units, with the unit at its end when the tree states
256
+ one. **Scale Grid** adds a faint line at every tick, behind the tree. In the
257
+ circular layout the ruler runs out from the root along the gap between the last
258
+ tip and the first, and the grid lines become rings; the unrooted layout has no
259
+ axis. The ruler floats at the bottom of the window as the tree scrolls, and it
260
+ starts at a subtree view's own root. On a time tree the same switch draws the
261
+ time axis instead (below): a tree flipped to **Div** gets the distance ruler,
262
+ and one flipped back gets its time axis.
263
+
253
264
  In the two radial layouts the zoom row changes meaning, exactly as on the
254
265
  desktop: **Y+ / Y− become the plain + / − zoom** (a circle has one diameter;
255
266
  the mouse wheel zooms too, and never rotates), **X− / X+ become rotate** (a
@@ -479,7 +490,7 @@ too.
479
490
  | ⌘⇧E | Ctrl+Shift+E | Expand vertically until the labels fit |
480
491
  | ⌘⇧L | Ctrl+Shift+L | Next layout: rectangular, circular, unrooted |
481
492
  | ⌘⇧D | Ctrl+Shift+D | Next display type: phylogram, aligned, cladogram |
482
- | ⌘⇧X | Ctrl+Shift+X | Time axis on / off |
493
+ | ⌘⇧X | Ctrl+Shift+X | Time \| Div, where the tree offers it; the Scale Axis on / off otherwise |
483
494
  | ⌘⇧O | Ctrl+Shift+O | Ladderize |
484
495
  | ⌘⇧U | Ctrl+Shift+U | Uncollapse every clade |
485
496
  | ⌘F | Ctrl+F | Go to the search box |
@@ -504,9 +515,10 @@ desktop's Unicode entry: it stays with the text field there, as it should.
504
515
  A view is what you made of a tree with the panel: the layout and display
505
516
  type, which labels show, the colour and shape fields, both searches, the
506
517
  clade you switched to, the clades you collapsed, the font, node and branch
507
- sizes, the rotation, and the tracks — which track is shown, the heat map's
508
- column order (including one you arranged by hand) and whether the alignment
509
- is summarised as a logo. On the demo pages it rides in the URL's
518
+ sizes, the rotation, whether the branches show time or divergence, and the
519
+ tracks — which track is shown, the heat map's column order (including one
520
+ you arranged by hand) and whether the alignment is summarised as a logo. On
521
+ the demo pages it rides in the URL's
510
522
  `#` hash and follows every change, so the address bar is always a link to
511
523
  what is on screen: copy it (**Copy link to this view** in the toolbar) and
512
524
  the recipient opens the same tree in the same view. Opening your own file
@@ -649,16 +661,42 @@ number wherever it appears — that is what makes a block of related columns
649
661
  readable as a block, and it is the point of a heat map rather than a row of
650
662
  independent stripes. The scale spans the whole tree, so entering a subtree
651
663
  narrows the rows and leaves the colours where they were. The columns that
652
- appear are exactly the numeric fields the **Color by** menu offers, so the two
653
- agree about what the tree holds; by default their left-to-right order follows
664
+ appear are the numeric fields the **Color by** menu offers, so the two agree
665
+ about what the tree holds — plus a field with **one value on every tip**, which
666
+ has nothing to colour by but is a column all the same (a single-copy core gene
667
+ is a column of 1s); by default their left-to-right order follows
654
668
  the order the file lists them in, which keeps a producer's grouping (core genes,
655
669
  then resistance, then prophages) intact even where some tips are missing a
656
670
  field — see **Order columns** below for the alternatives.
657
671
 
672
+ Where a cell is at least 5 px on screen, each cell is drawn on its own with a
673
+ **thin border in its own hue, darker** — a block of equal values still reads
674
+ as a block, and each cell can be counted. The border stays 0.75 px at any
675
+ zoom. Smaller cells, or a matrix of more than 60,000 cells, are drawn as merged
676
+ runs of equal colour instead, and zooming across that threshold switches
677
+ between the two.
678
+
658
679
  A cell **nobody filled in** is drawn as an outlined empty box, never as the
659
680
  scale's low end: on a presence/absence matrix, reading a missing field as zero
660
681
  states the opposite of what the file says. The key beside the scale names it.
661
682
 
683
+ **A file can open straight into its matrix.** The desktop Archaeopteryx
684
+ stores its figure setting as one property of the phylogeny, directly under
685
+ `<phylogeny>`:
686
+
687
+ ```xml
688
+ <property ref="aptx:figure" datatype="xsd:string" applies_to="phylogeny">v1;columns=pgfam:PGF_00019355\sMATRIX\sCIRCLE\sfalse\ppgfam:PGF_00019313\sMATRIX\sCIRCLE\sfalse</property>
689
+ ```
690
+
691
+ When it names two or more `MATRIX` columns the tree has, the tree opens with the
692
+ heat map on, showing **only those columns, in that order** (the order is then
693
+ `manual`, and **Order columns** can still change it). Other column types are
694
+ the desktop's and are not drawn here. Only a property directly under
695
+ `<phylogeny>` counts: an `aptx:figure` on a clade — where desktops
696
+ 0.11.117 to 0.11.172 wrote it — is ignored and left out of what is saved; the phylogeny's
697
+ own is saved back unchanged. An explicit `showHeatmap`, `heatmapColumnOrder`
698
+ or `heatmapManualOrder` in the config wins over the file.
699
+
662
700
  **Hover any cell** for its tip, the column and its value — or `not assessed` —
663
701
  and the scale it was coloured against. The column names stand under the matrix,
664
702
  turned; a matrix with more columns than will fit shows a window and says so
@@ -733,12 +771,12 @@ nodes, and on tips whatever the axis says the range means — on geologic
733
771
  time a fossil's observed range, sepia **FAD/LAD bars with end caps**; on
734
772
  calendar time the uncertainty of a **sampling date**, drawn like an age bar,
735
773
  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
774
+ **Scale Axis** checkbox under Display Data toggles everything; the axis needs
737
775
  a phylogram and the rectangular or circular layout. In **circular** the bars
738
776
  run along each node's spoke — on through the centre where a range reaches
739
777
  back past the root's own age — the ruler runs out from the root along the
740
778
  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
779
+ geologic axis lays its intervals down as coloured rings. **Scale Grid** (off
742
780
  by default) adds faint lines, or rings, at the fine interval boundaries or
743
781
  the calendar years.
744
782
 
@@ -767,7 +805,7 @@ builds state — keeps its sign, and is drawn at length 0 like any negative
767
805
  branch length. The switch acts on the whole tree, also from a subtree view,
768
806
  and a node deleted meanwhile leaves the branch that takes its place spanning
769
807
  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`
808
+ branches show divergence, and the Scale Axis measures distance instead. Each layout stamps the tree's `branch_length_unit`
771
809
  (`subs/site`; for time the dates' unit, or `time`), so a tree saved while
772
810
  Div is on screen says so and opens again showing divergence. All of this is
773
811
  shared with the desktop.
@@ -1164,7 +1202,8 @@ developer spec below). The checkboxes are still there to override it.
1164
1202
 
1165
1203
  The same data-driven rule applies to the two big overlays: a tree whose tips
1166
1204
  carry an aligned `mol_seq` opens with its **sequence alignment** showing, and
1167
- a tree with phyloXML `<date>` elements opens with its **time axis** drawn —
1205
+ a tree with phyloXML `<date>` elements that opens shown in time has its
1206
+ **time axis** drawn —
1168
1207
  each with a checkbox under Display Data to turn it off.
1169
1208
 
1170
1209
  Support and branch-length values draw **2 px smaller than the label font**
@@ -1340,16 +1379,18 @@ copy-pastable JSON.
1340
1379
  | `layout` | `'rectangular'` | The starting layout: `'rectangular'`, `'circular'`, or `'unrooted'`. |
1341
1380
  | `ladderizeTree` | `true` | Ladderize the tree on load: at each node, the larger clade first (any number of children, so a polytomy sorts too). |
1342
1381
  | `showMsa` | tree-derived | Open with the alignment track shown. Default: on when the tree carries an aligned `mol_seq`, off otherwise — an explicit `true`/`false` overrides that. |
1382
+ | `showProperties` | tree-derived | Open with the nodes' property values in their labels. Default: off, unless the file's figure setting (`show.SHOW_PROPERTIES=true`) says on. See [Properties in the label](#properties-in-the-label). |
1383
+ | `labelProperties` | tree-derived | Which properties the label shows, in order, as an array of refs (`['BVBRC:species', 'BVBRC:host_name']`). Default: the figure setting's `labelprops`, else `null` — every property but the heat map's columns. |
1343
1384
  | `showMsaLogo` | `false` | Open with the alignment summarised as a sequence logo instead of a conservation bar: a stack of letters per column, as tall as its information content, over the tips currently on screen. Only drawn while the alignment track is shown. |
1344
- | `showHeatmap` | `false` | Open with the heat map shown. Offered whenever the tree carries two or more numeric per-tip fields, but off unless asked for: almost any annotated tree has such fields, so turning it on by itself would be an opinion about the tree rather than a service. |
1385
+ | `showHeatmap` | tree-derived | Open with the heat map shown. Offered whenever the tree carries two or more numeric per-tip fields, but off unless asked for — almost any annotated tree has such fields, so turning it on by itself would be an opinion about the tree rather than a service — or unless the file's own figure setting (`aptx:figure`, see [Heat maps](#heat-maps)) draws them as a matrix. |
1345
1386
  | `heatmapColumnOrder` | tree-derived | How the heat map's columns are ordered: `'document'` (as the file lists them), `'clustered'` (Euclidean), `'clustered-presence'` (Bray–Curtis), `'alphabetical'`, `'frequency'`. The clustered modes also draw the dendrogram. Default: a **clustered** order, with the distance chosen from the values — Bray–Curtis where the matrix has zeros to ignore and nothing negative, Euclidean otherwise. An explicit value always wins and is never re-derived. |
1346
1387
  | `heatmapManualOrder` | `null` | The heat map's columns in your own order, as an array of property refs (`['meta:recA', 'meta:gyrA', …]`). Only read while `heatmapColumnOrder` is `'manual'`. A ref the tree has not got is ignored, and a column the list does not name follows the ones it does. |
1347
1388
  | `showDomainArchitectures` | tree-derived | Open with the domain tracks shown. Default: on when any tip carries a `<domain_architecture>`, off otherwise — an explicit `true`/`false` overrides that. |
1348
1389
  | `domainLabels` | `'domains'` | Where domain names go: `'domains'` (on the boxes), `'legend'` (a card), or `'none'`. |
1349
1390
  | `domainGlow` | `false` | Open with the glow around each domain box on. |
1350
1391
  | `domainEvalueExponent` | `-3` | The E-value threshold's exponent at launch, an integer from `-20` to `3`: domains with an E-value at or under `10^exponent` are drawn. |
1351
- | `showTimeAxis` | tree-derived | Open with the time axis shown. Default: on when the tree carries `<date>` elements, off otherwise — an explicit `true`/`false` overrides that. |
1352
- | `timeAxisGrid` | `false` | Open with the Time Grid vertical lines on (only meaningful — and only offered as a checkbox — while the time axis itself is shown). |
1392
+ | `showScaleAxis` | tree-derived | Open with the scale axis shown: the time axis on a time tree whose branches show time, a distance axis on any other phylogram. Default: on when the tree carries `<date>` elements and opens shown in time, off otherwise (a dated tree that opens in divergence is a divergence tree on screen) — an explicit `true`/`false` overrides that. |
1393
+ | `showScaleGrid` | `false` | Open with the Scale Grid lines on (only meaningful — and only offered as a checkbox — while the scale axis itself is shown). |
1353
1394
  | `showSupportDots` | `false` | Open with the Support Dots marks on (the checkbox appears whenever the tree has confidences). |
1354
1395
  | `supportDotMinimum` | `95` | Support Dots threshold, as a percentage. On a tree whose confidences top out at 1 (posterior probabilities) it is read on the 0–1 scale, so the default means ≥ 0.95 there and ≥ 95 on a bootstrap tree. |
1355
1396
  | `searchAinitialValue` | `null` | Prefill search box A. |
@@ -1372,7 +1413,7 @@ copy-pastable JSON.
1372
1413
  ### Anything else throws
1373
1414
 
1374
1415
  An unrecognised key is an error, whether it was removed in this modernization
1375
- or simply mistyped (the two deprecated keys below are the exception — they
1416
+ or simply mistyped (the deprecated keys below are the exception — they
1376
1417
  warn rather than throw):
1377
1418
 
1378
1419
  ```
@@ -1387,14 +1428,15 @@ whatever it names.
1387
1428
 
1388
1429
  ### Accepted, with a warning
1389
1430
 
1390
- Two keys are neither current nor removed: they are accepted so an existing
1391
- embed keeps working, and warn on the console. Both concern Newick support
1392
- values.
1431
+ Four keys are neither current nor removed: they are accepted so an existing
1432
+ embed keeps working, and warn on the console.
1393
1433
 
1394
1434
  | Key | What happens |
1395
1435
  |---|---|
1396
1436
  | `nhConfidenceValuesAsInternalNames` | Translated to `internalNumericLabels`. **`true` becomes `'confidence'`, not `'auto'`** — `'auto'` is all-or-nothing and promotes nothing in a tree that mixes clade names with support, so a caller moved to it silently would lose promotions they had. An explicit `internalNumericLabels` always wins. |
1397
1437
  | `nhConfidenceValuesInBrackets` | Retired: ignored. It gated whether `[95]` is read as a confidence, but setting it `false` never reinterpreted the bracket — it *discarded* it, so the option's only effect was to throw support values away. A bracket that is not a number is a Newick comment and was ignored either way, and NHX / BEAST blobs go through a different path. Bracketed values are now always read as confidences. |
1438
+ | `showTimeAxis` | Translated to `showScaleAxis`, value unchanged: the switch now also draws a distance axis on a tree that is not in time. An explicit `showScaleAxis` always wins. |
1439
+ | `timeAxisGrid` | Translated to `showScaleGrid`, value unchanged. |
1398
1440
 
1399
1441
  ### What replaced the rest
1400
1442
 
@@ -1835,6 +1877,28 @@ rather than 300 identical "Influenz.." labels).
1835
1877
  Both menus live in the single control panel, above Display Data, which is where
1836
1878
  the desktop puts them.
1837
1879
 
1880
+ ### Properties in the label
1881
+
1882
+ A tip's other fields — a species, a host, a country, anything a node carries
1883
+ as a `<property>` — can go into its label, as on the desktop. **Properties**
1884
+ under Display Data (offered when nodes carry properties, off by default) adds
1885
+ their **values** after the rest of the label, joined by ` | ` as the rest of the
1886
+ label is: `255457.3 | Brucella lupini | host`, or `Brucella lupini` alone with
1887
+ Node Name off. (The desktop joins them with `, `; a pipe was chosen here
1888
+ because values often contain commas — a host such as `Bottlenose dolphin,
1889
+ Tursiops truncatus`.) A unit follows its value. With nothing chosen, every property shows in the
1890
+ node's own order, except the heat map's columns while it is shown — a field
1891
+ has one display role. **Label fields…** picks which properties, and in what
1892
+ order; picking one turns Properties on. The checkbox and the fields travel in
1893
+ a shared view (`show=…,properties`, `labelFields=`), and the config keys are
1894
+ `showProperties` and `labelProperties`.
1895
+
1896
+ A file can choose for itself: the desktop's figure setting (`aptx:figure`,
1897
+ see [Heat maps](#heat-maps)) carries `labelprops=` (the properties, in order)
1898
+ and the display switches `show.SHOW_PROPERTIES=true` and
1899
+ `show.SHOW_NODE_NAMES=false`, and a tree opens labelled that way in both
1900
+ programs. The config wins over the file.
1901
+
1838
1902
  ### Initial label fields
1839
1903
 
1840
1904
  Which of the three label checkboxes — Node Name, Taxonomy, Sequence — start
@@ -2070,8 +2134,10 @@ bottom reserve the fit allows for follows that.
2070
2134
 
2071
2135
  Model (`forester.heatmapColumns(tree)` → `{refs:[{ref,label}], min, max}`,
2072
2136
  pure, in `test/heatmap_test.js`): a column is any candidate that
2073
- `forester.visualizationCandidates` already calls a **numeric property** — so
2074
- candidacy is not re-invented here and the refusal rules are inherited — carried
2137
+ `forester.visualizationCandidates(tree, {keepConstant: true})` calls a
2138
+ **numeric property** — so candidacy is not re-invented here and the refusal
2139
+ rules are inherited, except the one against a field with a single value, which
2140
+ suits colour-by and not a matrix — carried
2075
2141
  by at least one **tip**; an internal node has no row, so a ref only internal
2076
2142
  nodes hold is not a column and its values never reach the scale. `min`/`max`
2077
2143
  span every drawn cell of the whole tree. `forester.heatmapValue(node, ref)`
@@ -2174,8 +2240,16 @@ order the columns happened to be in. Measured: without it, the 6×6 linkage
2174
2240
  fixture fed in reverse clustered to `h6,h5,h3,h4,h2,h1` instead of R's
2175
2241
  `h6,h3,h5,h4,h1,h2` — the index order drives the tie-break and the leaf order,
2176
2242
  so the incoming order really does leak through. The normaliser deliberately does
2177
- **not** go through `heatmapColumns`: that applies candidacy rules (a constant
2178
- column is refused), and ordering must not move with them.
2243
+ **not** go through `heatmapColumns`: that applies candidacy rules, and
2244
+ ordering must not move with them.
2245
+
2246
+ `forester.heatmapColumns(tree, only)` keeps just the refs in `only` — the
2247
+ figure's MATRIX columns (`forester.figureMatrixRefs(tree)`, from
2248
+ `forester.readFigure`, which reads the phylogeny's own `aptx:figure` only:
2249
+ `"v1;key=value;…"`, values escaped as the desktop's `PropertyTextCodec` does,
2250
+ `columns=` a `|` list of `ref~TYPE~SHAPE~normalized`; an unknown version is no
2251
+ figure, unknown keys are ignored). `forester.dropCladeFigures(tree)` removes
2252
+ the old clade-level copies at launch.
2179
2253
 
2180
2254
  Distances are `forester.heatmapEuclideanDistances` (R's `dist` convention for
2181
2255
  missing values: pairwise deletion, the squared sum scaled up by `tips / used`;
@@ -104,9 +104,21 @@ export interface ArchaeopteryxConfig {
104
104
  * bar: each column a stack of letters as tall as its information content,
105
105
  * over the tips currently on screen. Only drawn with the track shown. */
106
106
  showMsaLogo?: boolean;
107
+ /** The nodes' property values in their labels (the desktop's "Properties"). */
108
+ showProperties?: boolean;
109
+ /** Which properties the label shows, in order; null for all but the heat map's columns. */
110
+ labelProperties?: string[] | null;
111
+ /** The scale axis under a phylogram: the time axis on a time tree whose
112
+ * branches show time, a distance axis on any other. Default: on for a
113
+ * time tree, off otherwise. */
114
+ showScaleAxis?: boolean;
115
+ /** Grid lines (rings, in circular) at the scale axis's ticks. */
116
+ showScaleGrid?: boolean;
107
117
  showSupportDots?: boolean;
118
+ /** @deprecated renamed showScaleAxis; still read, with a warning. */
108
119
  showTimeAxis?: boolean;
109
120
  supportDotMinimum?: number;
121
+ /** @deprecated renamed showScaleGrid; still read, with a warning. */
110
122
  timeAxisGrid?: boolean;
111
123
  /** Open straight into a view (getViewState / decodeViewState). */
112
124
  view?: ViewState | null;
@@ -161,11 +173,17 @@ export interface ViewState {
161
173
  heatmap?: boolean;
162
174
  heatmapOrder?: 'document' | 'clustered' | 'clustered-presence' | 'alphabetical' | 'frequency' | 'manual';
163
175
  heatmapManual?: string[];
176
+ /** The properties the label shows, in order (labelProperties). */
177
+ labelFields?: string[];
164
178
  domains?: boolean;
165
179
  domainLabels?: 'none' | 'domains' | 'legend';
166
180
  domainGlow?: boolean;
167
181
  domainEvalue?: number;
182
+ scaleAxis?: boolean;
183
+ scaleGrid?: boolean;
184
+ /** @deprecated the name of scaleAxis in older links; still read. */
168
185
  timeAxis?: boolean;
186
+ /** @deprecated the name of scaleGrid in older links; still read. */
169
187
  timeGrid?: boolean;
170
188
  searchA?: ViewSearch;
171
189
  searchB?: ViewSearch;