Skip to content

Every release of Skopia and the changes in it, newest first; entries under Unreleased are on main but not yet in a numbered release.

Changelog

All notable changes to skopia are documented in this file. Format follows Keep a Changelog, and versions follow Semantic Versioning as set out in docs/about/versioning.md: a patch release holds only fixes, a minor release adds features (and, before 1.0, may break things), a major release after 1.0 breaks things. Each entry's bold lead names its kind: **Fixed: …**, **Breaking: …**, or anything else for a feature or change. pixi run release warns when the version does not fit the entries.

Unreleased

0.9.0 - 2026-12-03

  • Breaking: Metacells by annotation leaves out label combinations of fewer than 10 cells by default. In 0.8.0 every combination made a metacell, down to a single cell. Set Leave out groups under to 1 (min_cells=1) for that behavior. The floor is now part of the run's record; a record made before this change has none and its code export writes min_cells=1, so it still reproduces what was run.
  • Metacells by annotation handles groups of unequal size. Picking the grouping columns now shows the groups before the run (how many, their sizes, the smallest ones) and what the run would make, read from the backend's own plan (POST /api/metacells/groups). Three settings under Group size: Leave out groups under N cells (min_cells, 10 by default); Same number of cells in every group (cells_per_group: that many cells drawn uniformly at random from each group, by default as many as the smallest group that passed the floor, groups with fewer left out); and Same total counts in every profile (match_depth, summed counts only: counts are removed at random from each profile until all match the shallowest, a draw without replacement, so totals are exactly equal and composition is kept in expectation). Cells are never chosen by depth, since a cell's depth follows its type, cycle phase and quality. The source's membership column is NaN for cells that went into no profile, the metacell dataset gains n_cells_available and n_counts_summed, and the record holds the number of cells used and the seed so the code export replays the same draw. On a 700-cell gastrulation dataset grouped by cell type × stage (25 groups of 1 to 74 cells), summed counts per profile spanned 458-fold with every cell (floor of 1), 8.4-fold with the default floor of 10, 2.1-fold after drawing 12 cells per group, and were equal with matched totals; the guide page has the table and says when to leave the groups unequal instead.
  • Downsample can balance by a label column. Balance by takes the same number of cells from each label of a column, counted within the pool (selection, active cells or all): blank keeps as many as the smallest label has, and with a larger number the labels that have fewer are left out (equal groups) or kept whole. The dialog states the result before it runs. Browser-only, as before: the result is a selection.
  • Fixed: a dataset whose cell or gene names were stored as nullable strings could not be saved. Files written by anndataR from a Seurat object store names that way; anndata reads them as pandas string arrays and then refuses to write them ("anndata.settings.allow_write_nullable_strings is False"), so Save, Download and the export of anything made from such a file, a metacell dataset included, failed. The export now writes them as ordinary strings, in the encoding every anndata version reads. The same holds for string-typed .obs / .var columns, .raw gene names and string arrays in .uns.

0.8.0 - 2026-12-02

  • Metacells (Analyze → Cells → Metacells). Groups highly similar cells and aggregates their profiles into a new, smaller dataset that opens in its own tab and is handled like any single-cell dataset. By similarity is SuperCell's method (walktrap on the kNN graph the dataset already has, cut at cells ÷ cells-per-metacell), optionally kept inside the labels of chosen columns so no metacell mixes samples or cell types; By annotation makes one metacell per combination of labels (a pseudobulk). Profiles are the sum of raw counts or the mean of the current matrix; Automatic sums when raw counts exist. The cells per metacell is suggested from the data (160,000 counts per metacell from the median depth, within 10 to 50, lowered when it would leave under 50 metacells) and the reason is shown. Each metacell carries its size, the majority label of every label column, the purity of the columns you ask about, the mean of every numeric column and embedding. The source dataset gains only the membership column. Graphs above 20,000 connected cells are cut into Leiden blocks first, since walktrap's cost grows roughly with the square of the cell count. Checked on 9,186 E11.5 limb mesenchyme cells: 10 cells per metacell kept within 13 cell types gave 1,003 metacells (cell-type purity 1.0 by construction, purity of the finer 35-label annotation 0.92), which then ran Normalize through Leiden and UMAP; by annotation, cell type × cell-cycle phase gave 39 pseudobulks.
  • Tight clusters (Analyze → Cells → Tight clusters). Labels only the cells whose cluster survives re-clustering and leaves the rest unassigned, for populations with continuous structure where Leiden's boundaries move with the resolution and the seed. Leiden runs ten times over a resolution range (0.5 to 1.0) with different seeds; a cell's stability is the chance that a short random walk from it ends in its own cluster, averaged over the runs; cells at 0.9 or more that stay connected along edges most runs keep form the tight clusters (C1, C2, … by size). Writes the labels (tight by default) and <column>_stability, works on any graph and on a named subset, and reports what every other threshold would have given so a second run can be chosen from the first. On two simulations with known end states the tight clusters were those end states exactly; on the limb mesenchyme the defaults gave 8 tight clusters holding 16% of cells whose top-25 markers had a mean log2 fold change of 2.60, against 1.61 for Leiden with 8 clusters over all cells, and the tight cluster labels repeated on 80% subsamples (ARI 0.98) where all-cell Leiden did not (0.63). Differential expression between tight clusters is optimistic because the cells were selected for separating; the guide page says so. Numbers, conditions and the alternatives dropped: docs/measurements/2026-12-02-tight-clusters.md, reproduced by backend/benchmarks/tight_clusters/run.py. The tool was called Core clusters on main for a day before this release; a file saved then (runs under uns['skopia_core_clusters']) is read as is, and its columns keep their names.
  • Heatmaps and dot plots group cells by more than one column (Then by). Under Group by (dot plot) or a category cell ordering (heatmap), click more categorical columns to nest them inside the grouping column, for example cluster and then sample. There is one group per combination that has cells, the first column outermost; the group pick, colors and marker blocks stay the first column's; labels are tiered (the innermost on each row or block, the outer ones bracketed), and a heatmap column too narrow for a slanted label now gets it upright instead of none, down to 8 px. The dot plot's cluster groups reorders the first column's groups and keeps their nested groups together, and the heatmap's one value per cell group gives one column per combination. Saved figures record the nested columns (inputs.then_by) and report a deleted one as missing. Request field then_by on /api/heatmap/data and /api/dotplot/data.
  • Fixed: a heatmap grouped by a categorical column laid its blocks out in alphabetical order of the labels (0, 1, 10, 11, 2) rather than the column's own category order whenever every group was shown. The dot plot already used the column's order; both now do.

  • Documentation site. Tutorials, a user guide for every tool, a reference of what Skopia writes into the AnnData, and a citation page for the methods it calls or reimplements, built with MkDocs Material from docs/ and published to https://cahanlab.github.io/skopia/ by .github/workflows/docs.yml (pixi run -e docs docs previews it). The README now says what Skopia is, its status, how to install it and where to read more; its detailed sections moved into the site. A Docs link in the app header opens it. CITATION.cff gives GitHub's Cite this repository.

0.7.0 - 2026-11-30

  • Save a Panels figure (Panels → Save), and open it again from the Figures tab. A Panels figure used to live only in the browser, so New figure, a reload or a backend restart lost it. Save now stores it in the dataset as a figure of the new kind embedding_panels in uns['skopia_figures'], next to the other figures, and it travels in the .h5ad once the file is saved. It is a spec, not pixels: the embedding and its two columns, the cells (every cell, or the crop's indices), the layout, each panel's colouring, title, labels and look, the overlay layers (a gene-set layer as its genes and cutoffs, a cell-set layer as its cells), and the Display scoring settings the panels were computed with. In the Figures tab it shows a summary and Open in Panels, which redraws it with those saved scoring settings even if Display has changed since; the Panels sidebar says so and offers Use current Display settings. Next to Save, the toolbar says whether the figure is saved; New figure, opening another saved figure, and leaving the page ask first when there are unsaved changes, and a re-save after a crop updates the same figure. A gene-set overlay layer is rescored with the settings it was first scored with, so its cutoffs select the same cells. A crop and a cell-set overlay layer are cell indices, so once cells are deleted or filtered such a figure (or a Duplicate of it) refuses to open and says why rather than drawing on the wrong cells; a figure of every cell with no cell-set layer still opens. In exported code, a cell-set layer of more than 50,000 cells (the record's selection cap) is left out of the replayed figure. Checked on the toy dataset: a 2×2 figure (cell_type, a two-gene set, a 50-cell overlay and a gene-set overlay, log1p scoring) saved, survived a page reload, and reopened with the same panels and overlay; cropped to 200 cells and re-saved, the record held the 200 indices under the same id.

  • Fixed: the CNV, Cell Typing (PySCN), Differentiation (StemFinder), Pseudotime, ligand-receptor and multi-contour modals coloured the hidden Embedding when they finished on the Panels tab. Every other colouring on Panels goes to the active panel, and these now do too, run or Color by alike. Checked on the toy dataset: a pseudotime computed with Panels open coloured the active panel by dpt_pseudotime_pm and left the Embedding's leiden_pm colouring alone.

  • Fixed: Show UMAP in Cluster Cells by Gene Set switched the Embedding to the new UMAP but sent the cluster colouring to the active panel. It now brings the Embedding tab forward on the new UMAP, coloured by the clusters; the panel is untouched.
  • Fixed: a gene-set highlight layer (🖍) could land on the wrong plot or dataset. Where it went was decided after its score came back, so switching between Embedding and Panels, or to another dataset, while the score was in flight put the layer there. It now goes where it was asked for, scored on the dataset that was active then.
  • Fixed: a gene typed in a Panels panel's Or gene field and not yet applied showed up in the next panel clicked. Each panel's controls now start from that panel.
  • Fixed: category labels' leader lines were white and vanished on a white background, in the Embedding, Panels panels, snapshots and the exported PNG. They are dark on a light background now, by the same contrast rule as figure titles.

0.6.0 - 2026-11-25

  • Fixed: the code export of a split HVG run (Highly Variable Genes with Detect within groups of). It was labeled exact, but it passed split_by, add_union, add_intersection and min_cells_per_group to sc.pp.highly_variable_genes, which accepts none of them, so the exported notebook failed at that step. It now exports the skopia call, which writes the same per-group, union and intersection columns. Its line in the analysis summary no longer reads "Selected ? highly variable genes": it gives the number of groups, the genes variable in any group and in every group, and any groups skipped as too small.
  • Highly Variable Genes takes a gene subset (Analyze → Preprocess → Highly Variable Genes → Gene Subset). Pick boolean .var columns, such as the analysis_genes column Exclude Genes → Mark writes, and detection runs on those genes alone: only they compete for Top N and fill the dispersion bins, and every other gene is written as not variable. It applies on the whole dataset, on a cell selection or named subset, and within each group of a split run, and the preview shows the same genes the run will flag. A one-column subset exports as plain scanpy code, while combined columns export as the skopia call. Measured on the Grosswendt demo (700 cells, normalized and log-transformed, cell_ranger, Top N 2,000) after a Protein-coding only Mark: 2,000 genes flagged, none of them outside the 17,156 in analysis_genes. Also, the modal's gene-subset pills no longer reset after every run. Before, a run re-read the column list and put the pills back to the function's default, so a second HVG run after a Top N change silently used every gene, and PCA lost any pick other than its default.
  • Exclude genes by type (Analyze → Preprocess → Exclude Genes → By gene type). Below the name and pattern fields, tick GENCODE classes (protein_coding, lncRNA, pseudogene, small_rna, ig_tr, other, unannotated) and named sets that cut across them (mt, ribo, predicted, hb, histone, rrna, 45S_ribo, the cell-cycle, stress and sex-chromosome sets, each described on hover), with the number of the dataset's genes in each. Biotype alone cannot say "protein-coding only": about 2,000 mouse protein-coding genes are Gm or Rik models, and the ribosomal and mitochondrial genes are protein-coding too. Protein-coding only ticks every class except protein_coding and unannotated, plus mt, ribo and predicted; reporters and transgenes stay, as unannotated is never ticked for you. The panel shows how many genes the choice removes, from the same mask Run uses, and what the name and pattern fields add beyond the types (the stock ^Gm\d+ takes Gm2a, a protein-coding gene). Run removes the union of names, patterns and types; Mark instead writes a boolean .var column (default analysis_genes) that is False for exactly those genes, plus gene_type and gene_class when absent, so HVG and PCA can be restricted to the kept genes while every gene stays plottable. Types come from new shipped tables, gene_types_{human,mouse}.tsv.gz, built by data/build_gene_types.py from the same GENCODE releases as the symbol maps (v32 + v50, M23 + M39), keeping both releases' symbols so 10x 2020-A names that M39 renamed still match (Olfr484 is Or5p60); a renamed gene's sets follow its current symbol, so a placeholder M39 has named (Gm38394, now Zbed6) is not predicted. A file whose .var has its own gene_class column (the SJD pipeline's cryten output) is excluded by that annotation and its set columns instead, and Mark never overwrites a column. The code export lists the genes the types removed, so it reproduces the run after the tables are rebuilt. Measured with the preset and the stock mouse patterns: the Grosswendt demo (21,133 genes, symbols only) matched 20,715, and Run removed 3,977, keeping 17,156 (the stock ^Gm\d+ accounts for 123 of them, renamed placeholders such as Gm38394 among them, which the panel lists); SJD pijuan_small QC output (29,329 genes, cryten annotation) removed 9,657, keeping 19,672; in both, the preview, Run and Mark agreed.
  • Enrichment heatmap figures can be ordered by hand (Figures tab). Drag a row label up or down, or a column label sideways, to move it; click a column label to sort the rows by that column's value (largest first, click again for smallest first). A teal line shows where a dragged label will land. The new order redraws at once from the data in hand and is kept as figure params (row_order / col_order = custom, with the names in row_custom_order / col_custom_order), so Save stores it, the exports draw it, and Revert undoes it. Rows the list does not name (a higher Top N brings some in) follow by peak column; clear under each order menu returns to the automatic order. Checked on the Grosswendt demo (an overlap batch of 7 sets × 7 cell types).
  • Raw values in the per-group heatmap (Expression → Settings → One value per cell group → Colour scale). Raw group means, one scale colours each cell by the group's mean set score itself, on one scale shared by every row, with the legend giving its range; Each row 0..1 (the default) is unchanged. Rescaling every row hides how much a set varies (with two groups each row is always 0 and 1), so raw values are the way to compare sets. Rows are ordered on the scaled values either way, so switching does not reorder the plot. scale_rows on POST /api/heatmap/data and as an expression_heatmap figure param, default on; the response carries value_range. On the Grosswendt demo the raw scale ran from -0.85 to 2.33, and the cardio set's Meso.Cardio peak was lower than the gut set's Endo.Gut peak, which the 0..1 rows had drawn as equal.
  • One value per cell group for gene-set aggregate rows (Expression → Settings → Show gene set aggregates → One value per cell group). Each column is a group of the category ordering and each cell is the mean of that group's per-cell set scores (the embedding's score, under the scoring options above), then rows are rescaled to 0..1 across the groups like any heatmap row. The Settings panel offers it for aggregate rows only; through the API it also applies to gene rows (group means of expression). Bins do not apply, and columns widen to 32 px so the group names fit under them. It needs a category cell ordering (the backend refuses it otherwise, and the checkbox is disabled). group_columns on POST /api/heatmap/data and as an expression_heatmap figure param, default off. Checked on the Grosswendt demo (700 cells, 7 celltypes, three seeded sets, MAD z-score then mean): cardio peaks in Meso.Cardio, epiblast in Epiblast, gut in Endo.Gut, and the saved figure draws the same seven columns.
  • Groups to show has a none button (Expression → Settings, heatmap and dot plot), so a few groups can be ticked without unticking the rest one by one. The last group can now be unticked; with none ticked the panel says to tick one and Generate is disabled.
  • Panels opens straight into a figure and is coloured from the Genes and Cells panes. Opening the Panels tab with no figure makes a 2×2 figure of every cell on the embedding the Embedding tab shows; the Cells pane's Create figure button is gone, and Crop to selection / All cells in the Panels toolbar choose the cells instead. While Panels shows a figure of the active dataset, a click on a gene, a set's 🎨, bivariate colouring, a score-matrix column or a Cells-pane Color button colours the active panel (outlined; click a panel to make it active) instead of the Embedding, which keeps its own colouring. A panel computes its colours as Display does on the figure's dataset (transform, clip, layer, per-gene normalization, aggregation, UCell). The figure has one overlay of highlight layers drawn on every panel that shows it: while Panels is open the Genes pane's 🖍 tools edit that overlay, Copy from Embedding starts it from the Embedding's layers, and the per-panel Overlay box turns it off for one panel. A panel's title follows its colouring (gene, set, column, or "A vs B") until it is renamed by clicking the title on the plot; a blank name returns to the automatic one. A panel coloured by a category column writes the category names at their cells' median positions, placed as the Embedding tab places them, with a font size, and the labels are drawn into the exported PNG. When another dataset is active the Panels pane says which dataset the figure shows and the panes colour that dataset as usual. A figure remembers the file and cell count it was made on: after cells are deleted or filtered, or another file is loaded in its place, the Panels pane says the cells have changed and offers New figure instead of drawing old positions with new values. Checked on the Grosswendt demo (700 cells, normalized and log1p, UMAP on 30 PCs): the cardio set coloured a panel from -0.41 to 3.90, the range the Embedding drew for the same set under Display's MAD z-score; celltype labels at 16 px were drawn live and in the PNG. Saving a Panels figure is on the roadmap.
  • Fixed: Panels drew every point at half the Embedding tab's size, and a new figure ignored the Display settings. Panel points now use the point size as a radius, as the Embedding does, and a new figure starts from Display's background, point size, opacity, colour scale and label size. Panel and figure titles take dark or light ink from their background, so a white background no longer hides them.
  • Fixed: gene-set aggregate rows in the Expression heatmap were a plain mean of unscaled values, so one high-magnitude gene drowned the rest of the set. The embedding coloured by the same set z-scored each gene first (MAD, the Display default), so the two disagreed. An aggregate row is now scored by the Display panel's pipeline and options (Expression → Settings → Show gene set aggregates): scoring method (mean pipeline or UCell, which uses a directional set's down genes), per-gene normalization, the min-max clip, and aggregation across genes, starting from what Display is set to (shipped default: MAD z-score, then mean). Per-gene statistics are over every cell, as the embedding's are, so a row is the embedding's score for the plotted cells, then rescaled to 0..1 like every heatmap row (which makes Sum draw the same as Mean). gene_set_scoring_method, gene_set_per_gene_norm, gene_set_per_gene_clip and gene_set_aggregation on POST /api/heatmap/data and as expression_heatmap figure params; a heatmap figure saved before them keeps the plain mean it was drawn with. Directional sets now carry genes_down in plot requests and figure inputs.
  • Drag to reorder the Expression tab's cell groups, gene-set row blocks and marker blocks (Expression → Settings). Groups to show (heatmap under a category ordering, and the dot plot) is a drag list: ticked groups are drawn in the dragged order, and column order puts them back; dragging a dot plot's groups switches cluster groups back to as given, since clustering would undo the drag. Picked gene sets get a Row order list (the Gene Panel's order until dragged). A marker run's blocks follow the cell groups by default whenever the run was made on the plot's column, so a reordered heatmap or dot plot keeps its diagonal; dragging the Block order list overrides that, and follow cell groups returns to it. group_order on a plot request's markers and marker_group_order as a figure input hold the override; marker run summaries now list their groups. Checked on the Grosswendt demo (700 cells, markers by celltype, top 5): with the groups dragged to Epiblast, Meso.Cardio, Anterior.PS, … the dot plot and its saved figure drew the marker blocks in the same order.
  • The Display panel's per-gene normalization option None (raw values) is now None (no per-gene scaling). It always read .X (or its log1p when Normalize + Log1p is on, or the View panel's Source layer), never raw counts; only the label was misleading. Display and the Expression settings now share one list of these options (lib/geneSetScoring.ts).
  • Fixed: number fields in many modals would not let a new first digit be typed. Most modals coerce each keystroke (Math.max(1, parseInt(v) || 1)) and showed the coerced value back, so clearing a lone 5 snapped the field to 1 and typing 8 gave 18. Every <input type="number"> (101 of them, in 30 files) is now components/NumberInput.tsx, which shows the typed text while the field has focus and the parent's value after blur; the parent still receives every change, so its clamping is unchanged. Checked in the browser on Expression → Settings → Top N per group: clear 5, type 8, the field reads 8.
  • Highly Variable Genes shows a preview: mean against normalized dispersion for every gene, with the genes the current settings select in colour (Analyze → Preprocess → Highly Variable Genes). It recomputes as the settings change (400 ms after the last edit) and draws the mean and dispersion cutoffs when they apply (no Top N, not seurat_v3). The flags come from the run's own scanpy call with inplace=False, on the cells the run would use, so the preview and the run cannot disagree: on the Grosswendt demo (700 cells, 21,133 genes, median-normalized and log1p, seurat, no Top N, min dispersion 1) both gave 1,287 genes. Genes with no dispersion are left off and counted; cell_ranger's infinite normalized dispersions (a bin with zero MAD, flagged by scanpy) are drawn as triangles at the top edge. With Detect within groups of set there is no single selection and the panel says so. POST /api/scanpy/highly_variable_genes/preview takes the run's parameters and writes nothing. When scanpy cannot bin the genes (cell_ranger on an unfiltered dataset, where thousands of genes share a mean of zero; the run fails the same way, and that is unchanged) the panel says to run Filter Genes first or use seurat instead of printing pandas' bin index.
  • PCA can scale genes first (Analyze → Cells → PCA → Scale genes), off by default. Scaling z-scores each gene (clipped at 10, as scanpy's tutorial does) on a copy of the PCA's genes and cells, so every gene weighs the same in the components; .X is unchanged. It is off by default following sc-best-practices ("Should you scale genes before PCA?"): unscaled, expression magnitude still counts as information, and gene selection does the work scaling would. scale on POST /api/scanpy/pca and run_pca; recorded in the analysis record, and a scaled PCA exports as the adaptor call (scanpy's pca has no such flag). Loadings of genes outside the PCA are NaN when scaled.
  • Save a gene set as a boolean .var column (a set's ⋯ menu in the Genes pane, or Gene Set Manager → Edit → Save as .var column…). True for the set's genes, so the file carries the set and every .var gene-column picker (PCA gene subset, marker genes, QC vars, Show only) can use it. The name defaults to the set's name made into an identifier; genes the dataset lacks are listed, not an error unless none are present; an existing boolean column is replaced only when asked, and a non-boolean one never. A directional set writes its ↑ genes unless the ↓ genes are ticked in too. POST /api/var/boolean_from_genes; recorded, and the notebook export reproduces it exactly (adata.var[name] = adata.var_names.isin([...])).
  • Dot plot background colour (Expression → Settings → Dots → Background). A colour picker, default the panel's #16213e. Text, grid lines and legends switch to dark ink when the colour is light, chosen by which of the two inks contrasts more with it (WCAG luminance), so a white background is readable without further settings. Save as figure carries it as the background param of the expression_dotplot figure (hex only; the backend refuses anything else), the Figures tab edits it, and its PNG and SVG exports paint it. Checked on the Grosswendt demo (700 cells, markers by celltype, top 3): white draws #333 labels on #d0d0d0 grid lines, and the SVG export's backing rect is #ffffff. The heatmap is unchanged.
  • Heatmap: choose which groups to show, as the dot plot already could (Expression → Settings → Cell Ordering, under a category ordering). Only the ticked groups' cells are drawn, in the column's order. The pick applies under Group by category, Category, then position and Category, then similarity, and is not sent under an ordering that ignores the column. groups on POST /api/heatmap/data (needs obs_column; an unknown label is a 400); a saved expression_heatmap figure records groups as an input and reports a label renamed away as a missing input, as the dot plot does.
  • The Expression tab's settings modal is now Expression Plot Settings (it was Configure Heatmap or Configure Dot Plot), and its empty-plot button reads Settings, like the toolbar's.
  • Analyze → Cells lists PCA, PCA Loadings, Neighbors, Leiden, DEG, UMAP, Diffusion map first, then Pseudotime, Combine Neighbors, stemFinder and CNV as before, with Downsample and Embedding from .obs last. Compare Cells is now DEG.
  • Default changed: Normalize Total scales each cell to the median total count, not 10,000 (Analyze → Preprocess → Normalize Total; the field is empty and reads median, and scanpy.normalize_total.target_sum in config.yaml is null). The median is scanpy's own default and keeps the counts on the dataset's scale; type 10000 for counts per 10k.
  • Default changed: the embedding is drawn on dark blue (#1a1a2e) with viridis for expression again. The shipped config.yaml had set white and reds since July, overriding the app's own defaults; a display: section in ~/.skopia/config.yaml still overrides both.
  • Default changed: 5 marker genes per group. Find Marker Genes (Analyze → Cells → DEG) starts at Top N 5, not 100 (marker_genes.top_n); that is the list the modal shows, the size of the sets Add to gene sets makes, and the Top N that Plot… carries to the Expression tab. Choosing a run in Expression → Settings without Plot… starts at 5, not 10 (heatmap.marker_top_n), as do new heatmap and dot plot figures (figures.*.marker_top_n). Enrichment on each group's markers keeps 100 genes per group under its own key, enrichment.marker_top_n, since 5 genes is too few for an overrepresentation test; a user config that set marker_genes.top_n no longer changes it.

  • Fixed: coloring a large dataset by a continuous column (Cells → Continuous → Color) left a blank page. The color scale and legend took the column's range with Math.min(...values), which passes one argument per cell; Chrome throws "Maximum call stack size exceeded" past about 125k of them, and inside render that unmounted the whole app. Measured: 120k values pass, 130k throw. lib/numericExtent.ts loops instead, and the same spread was replaced in the dual-pane legend, the figure panel and the cell-color function. Checked in the browser on a 200k-cell synthetic dataset and on a 191,425-spot E12.5 hindlimb section.

  • Fixed: spatial autocorrelation over every gene found no spatially variable genes. A gene with no counts has a NaN p-value, and squidpy hands the whole column to statsmodels' multipletests, which returns NaN for every gene if any input is NaN. On an E12.5 hindlimb section (191,425 spots, 39,812 genes, 3,700 of them empty) the run reported 0 spatially variable genes; the 300 highest-count genes run alone were all significant. The correction now runs over the finite p-values only, and empty genes keep NaN.
  • A progress strip for runs in the Analyze modal, with real progress for spatial autocorrelation. Every background run shows the elapsed time under the Run/Cancel button: a sweeping bar when the task reports nothing, a filling bar with a message and time left when it does. Spatial autocorrelation now reports one: it runs squidpy on about 20 chunks of genes (backend/skopia/spatial_autocorr.py) and applies the correction and squidpy's sort once over the joined table, so the analytic columns equal a single call's (pinned by a test for Moran's I and Geary's C). Chunking cost 1.5% (212 s against 209 s, 20k cells, 1,000 genes, 50 permutations, one job). Cancel still waits for the run to finish before discarding it.
  • Dot size for gene-set highlights (a set's 🖍 controls, and Genes → Color). A dot size slider, 1 to 4 times the point size, enlarges the cells a highlight layer marks, in 2D and 3D. It follows the layer's threshold rather than its opacity, so a layer at 0% opacity can still mark cells by size alone; a cell in several layers takes the largest size.
  • The header's version sits under the SKOPIA wordmark, aligned with its first letter.
  • A versioning policy, and a release script that checks against it. The README's Versioning section sets the semver rules for Skopia, what counts as breaking, and the changelog leads (**Fixed:, **Breaking:) that say each entry's kind. pixi run release and release.py bump now warn when the requested version does not fit the Unreleased entries (fixes only in a minor release, a feature in a patch, a breaking change in a minor after 1.0, a major with nothing breaking) or skips a number. Run against the history, it flags 0.5.0, a single fix three commits after 0.4.0, as what should have been 0.4.1, and names 0.6.0 for what is unreleased now.
  • Breaking: the app is now called Skopia. The Python package is skopia (from skopia.adaptor import DataAdaptor; import xcell no longer works), the environment variables are SKOPIA_DATA_PATH, SKOPIA_CONFIG_PATH and SKOPIA_BACKEND (the XCELL_* names are no longer read), and every registry the app writes into .uns is prefixed skopia_ instead of xcell_. Files saved by earlier versions keep working: the adaptor renames their xcell_* keys once, on load (_migrate_legacy_uns_keys), and the browser renames its xcell_* localStorage keys (recent files, last browse directory, export settings) at the first start. The header shows the Skopia lockup in place of the text title, and the tab has an icon. The repository moves to github.com/CahanLab/skopia; the old URL redirects.
  • Dot plot: choose the groups and how they are ordered (Expression → Settings → Group by). Under the grouping column, Groups to show lists the column's labels with a checkbox each (all on by default, an all button to reset); only the ticked groups' cells enter the plot, so the fractions and the cell count are those groups' alone. Group order is as given (the column's own order, or the ticked groups' order) or cluster groups: average-linkage clustering of the groups' mean-expression profiles with each gene standardised across groups first, leaves in optimal dendrogram order, so groups that express the same genes sit side by side; fewer than three groups stay as given. POST /api/dotplot/data takes groups (labels, in order; null = all) and group_ordering (as_given | cluster); a saved expression_dotplot figure records groups as an input (a label renamed away is reported as a missing input) and group_ordering as a param, tuned live in the Figures tab.
  • Fixed: renaming a label in the Cells pane left the embedding coloured and labelled by the old name. The colour column is only re-read when its name changes; a rename or merge keeps the name, so the plot and its category labels showed the previous values until the column was re-selected. Both now re-read the column after the change.
  • Fixed: a column converted to string came back categorical after File → Save. anndata writes every string column as a categorical (and refuses to write one with missing values any other way), so the export now records which .obs columns were strings in uns['skopia_string_columns'] and a reload turns them back; the record is dropped on load and rewritten from the live types at the next save.
  • Fixed: renaming a subset's leiden_<name> (or pseudotime) column dropped it from the subset tree. The registry keys those results by column name; a rename now re-keys the record, so the clustering stays listed under its subset and its cascade delete still finds it.
  • Fixed: text annotations are now in embedding snapshots and figure panels, drawn at their anchors with their style and background box (a snapshot thumbnail scales the font down with the pane); the Panels view draws them read-only in every panel.
  • Fixed: text annotations sat still during a quilt drag or rotate and jumped on release. They now follow the cells live, as the drawn shapes already did; a whole-embedding rotate moves every note, a quilt move only those over the moved cells.
  • Fixed: the .obs manager's merge-name draft was reset whenever the column list reloaded while typing.
  • .obs manager Export can write CSV as well as TSV (a format select beside Export; format: "csv" on POST /api/annotations/export).
  • Fixed: pixi install -e pyscn failed on Intel Macs with "can't find Rust compiler". gseapy, which PySingleCellNet depends on, publishes no Intel-Mac wheel, so the lock held its source tarball for osx-64. That platform now takes the prebuilt bioconda package (the pyscn environment only; bioconda is its lowest-priority channel and supplies nothing else). test_lock_wheels.py fails if any platform's lock goes back to building a PyPI package from source.

  • Combine pools one annotation scheme into one column by default (File → Combine datasets… → Columns to keep). A same-named label column whose vocabularies overlap across the inputs (intersection over every dataset divided by the union, at least 0.5) now defaults to one column, with the counts in the row (8/9 labels shared). Vocabularies made of cluster ids (0, C3) and columns whose types differ across datasets stay one per dataset, as every label column did before. The same labels under two names (celltype in one file, cell_type in the other) get a Same as choice in the column's select, listing the columns it could be pooled with and naming the likeliest in the hint; the result is one column under the target's name. On the API this is obs_merge_into: {source: target} on POST /api/combine, recorded in uns['skopia_combine']. Refused with a message: chains, a dataset holding both ends, labels pooled with numbers.

  • Merge columns in the .obs manager (Cells → .obs columns → tick two or more → Merge). Folds the ticked columns into a new one: per cell, the first column in .obs order with a value wins; '' and unassigned count as no value, so an annotation's gaps fill from the next column. The default name is the common prefix (cell_type__A + cell_type__B → cell_type), the sources stay unless keep the source columns is unticked, and the status says how many cells had a value in more than one column. Labels merge to a categorical, numbers to float (int when nothing is left empty); booleans and label-with-number are refused. One recorded step, replayed exactly in the exported notebook.

  • Transcription-factor lists shipped as gene-set bundles (Gene Panel → Import → Transcription factors (human) / (mouse)). One All TFs set per species plus folders that split it by DNA-binding domain (a gene with two domains is in both sets; families under 5 genes pooled), by motif evidence (human: known 1,314, inferred 104, likely TF with no motif 134) and by provenance (mouse); every set name carries the species, so both bundles can be loaded together. Human is the Codebook update of the Lambert census (Jolma et al. 2026, Nature, Supplementary Table 14): the 1,639 Lambert TFs minus the 83 re-assessed as unlikely, minus 4 with no Ensembl gene or symbol, 1,552 genes, with Lambert-era symbols updated through their Ensembl IDs (ARNTL is BMAL1, T is TBXT). Mouse has no curated census, so the list is MGI orthologs of the human census plus CIS-BP 3.10 mouse TFs with no human ortholog, 1,475 genes after dropping 3 absent from the shipped GENCODE table; its 16 CIS-BP-only genes whose human ortholog was never assessed sit in an Ortholog unassessed (review) set. Loaded like any bundle, the All TFs set is then a Show only choice for marker selections. Built by backend/skopia/data/build_tf_census.py from the tables under data/tf_census/ (in the repo, not the wheel); edit a table, run the build, never the JSON (test_tf_census_bundles.py pins the JSON to the build and every symbol to Ensembl). Survey of the sources: docs/measurements/2026-11-03-tf-annotation-sources.md.

  • The center panel's Heatmap tab is now Expression, since it draws dot plots as well as heatmaps.
  • Show only: restrict a marker selection to an annotation (Find Marker Genes → Advanced Filters; Expression → Settings → Rows). Keep only the top marker genes that are transcription factors, collagens, or carry any other annotation, without re-running the test: a Show only picker offers the Gene Panel's sets (up and down genes together) and the boolean .var columns, and the stored ranking is filtered to that list before the thresholds and Top N. Only genes already among a group's strongest markers (its stored top 500) can appear; a group whose annotated genes were not strong markers comes up short, the candidate counts and the cap warning say so, and the session's gene mask is not applied to the restriction. The restriction is a snapshot of the set: editing or deleting it later does not change a saved plot, and the picker shows <name> (saved) until something else is picked. Plot… carries it to the Expression tab; a saved heatmap or dot plot figure records it as the marker_restrict input, titles itself "markers in
  • Top marker genes as plot rows, selected without re-running the test (Analyze → Cells → Compare Cells; Expression → Settings → Rows). A marker run now stores its full ranking, the top 500 genes per group by default (marker_genes.store_top_n), with Wilcoxon score, log2 fold change, fraction of cells expressing in and out of the group, and raw and adjusted p, as a JSON string in uns['skopia_marker_genes'][markers_<column>]. Top N, the percent-detected and fold-change filters, an adjusted-p cutoff and the rank order (score or log2FC) are a read on that table: changing them in the Find Marker Genes modal re-selects without a second test (POST /api/marker_genes/runs/{key}/select), and the modal's Plot… hands the current selection to the Expression tab. The Expression tab's Settings gain a Rows choice, Gene sets or Top marker genes from any stored run, with the same controls, and gene sets can be added beside the marker groups. Runs can be listed, read and deleted (GET/DELETE /api/marker_genes/runs); the modal says when a group's stored ranking is at its cap and a filter may have lost candidates. Thresholds are no longer applied inside the run, so the run's list and its stored table agree; MarkerGenesRequest takes store_top_n and label. The notebook export names the stored key.
  • Scanpy-style dot plots (Expression → Settings → Plot → Dot plot; figure kind expression_dotplot). One dot per gene and group: area the fraction of the group's cells expressing the gene above a cutoff, color its mean expression over all cells (scanpy's default) or over the expressing cells, optionally scaled per gene; groups as rows and genes as columns unless Genes as rows; gene-set and marker-group brackets with a key; viridis, white – red or blue – white – red; a vmax and a dot-size cap. Drawn as SVG, so a figure exports as vector or PNG. POST /api/dotplot/data takes the heatmap's genes / gene_set_groups / markers rows and a categorical column. Both the expression heatmap and the dot plot figure take the marker selection as params (marker_top_n, marker_min_pct_in, …), tuned live in the Figures tab; a figure whose run was deleted or re-made says so instead of drawing other genes. Design note: docs/superpowers/specs/2026-11-03-marker-selection-dotplot-design.md.

0.5.0 - 2026-10-30

  • Fixed: the analysis record's report start could only move forward. Start report here set the report to begin after the last recorded step, so pressing it in a finished session left every step outside the report, greyed out, with no way back short of Clear, and an export then wrote an empty document. Each step now has Start here, which begins the report at that step; Include all steps puts every step back; a Report starts here marker shows the boundary; the old button is renamed Report new steps only; and an export whose report covers none of the recorded steps is refused with that explanation rather than written empty. PUT /api/record/report_start {index}.

0.4.0 - 2026-10-30

  • Add menu replaces Draw, and text labels on embeddings (toolbar → Add). The toolbar's Draw button is now Add, its menu grouped as Shape (Lasso, Polygon), Line (Pencil, Smooth Curve, Segmented Line) and Text. In Text mode a click on the plot places a label and a click on a label opens an editor for its text (multi-line), size, color, bold, italic, alignment, rotation, and an optional background box with color and opacity; a drag moves it. Positions are in the embedding's data coordinates (sizes in screen pixels), so labels stay on their cells under pan and zoom and travel with Adjust's rotate, flip and quilt moves (only the anchor moves; labels stay upright). A label belongs to the embedding and column pair it was placed on, is stored per dataset in uns['skopia_text_annotations_json'], and is restored on load, so exports carry it; deleting a cell subset with its derived embeddings drops the labels on them. The next label starts in the last one's style. GET/POST /api/text_annotations. Labels are not yet drawn into snapshots or the Figures system. Design note: docs/superpowers/specs/2026-10-30-add-menu-pca-hits-obs-manager-design.md.
  • PCA Loadings: gene-set hits (Analyze → Cells → PCA Loadings). A gene field above the loadings table (comma, semicolon, space or newline separated; or filled from a Gene Panel set, up and down genes together, via From gene set…) marks each listed gene that appears in a PC's displayed top-N positive or negative list: accent chip in the list, an accent bar on the row, and a Hits column as total (pos+/neg−). Matching ignores case, so a human-cased set still hits mouse symbols. Order PCs: Most gene-set hits sorts by total hits, ties and zero-hit PCs by PC number; the checked PCs for a PC subset are keyed by PC number, so reordering does not change them. A summary line gives how many of the genes appear in the top N of at least one PC and how many PCs have hits, and a muted line lists the genes in no displayed list (they may load just below the top N). Computed in the browser over the table as shown (lib/pcaLoadingHits.ts); no backend change. The gene field clears on a dataset switch and survives a PCA re-run.
  • .obs manager (Cells panel → ⚙ .obs). A table of every .obs column with its kind (categorical, boolean, integer, float, string, other), pandas dtype, unique and missing counts, and a preview: the three most frequent values, or min · median · max over the finite values. Sort by name, type, unique or missing; filter by name and by kind. The colour-by column, saved-subset membership columns, tool prefixes (UCell_, leiden, subset_, …) and stored palettes are marked. Tick columns, shift-click for a range or tick all shown, then Delete (one recorded step; the confirm dialog names any saved subset that goes with its column, and colour palettes go too) or Export (TSV with cell ids, through the existing annotations export). Per column: Rename (moves <col>_colors; refuses a taken name and a saved subset's column), Duplicate, and Convert to categorical, string (missing stays missing), numeric (refused with a count and an example of a value that does not parse) or boolean (columns with at most two values and none missing; true/false, yes/no, 1/0 read themselves, otherwise you pick which value is True). Every operation drops a converted column's palette, refreshes the schema and the Cells panel, and has a codegen entry that replays it exactly in the notebook export. GET /api/obs/columns, POST /api/obs/delete_columns, /api/obs/rename_column, /api/obs/duplicate_column, /api/obs/convert_column (column names in the body, so a name containing / works). Note that AnnData stores string columns as categoricals when writing h5ad, so a conversion to string lasts only for the session.
  • Filter Cells: mitochondrial fraction, and cutoffs at ± k MAD (Analyze → Preprocess → Filter Cells). A third histogram shows each cell's percentage of counts from mitochondrial genes, with draggable Min/Max % mito cutoffs bound to two new thresholds (min_pct_mt, max_pct_mt). Mitochondrial means a boolean .var['mt'] column when one exists, else gene names starting mt- in either case; the panel says which and how many, and says so when neither applies. Each histogram has a ± MAD box: typing k places both cutoffs at median ± k × MAD (unscaled, as in scipy and the sc-best-practices QC chapter) on the axis as drawn — the log axis for counts and genes, linear for the percentage — and a cutoff that would fall outside the data is left unset. The box is a shortcut, not a parameter: it fills the same thresholds the lines and the inputs set, and clears itself when one is changed by hand. The notebook export reproduces a mitochondrial threshold as the same per-cell percentage over the recorded gene set, since scanpy's filter_cells has no such option. GET /api/scanpy/filter_cells/qc adds pct_mt and mt_source.
  • Filter Genes: threshold histograms (Analyze → Preprocess → Filter Genes). The same panel as Filter Cells, per gene: total counts and cells expressing, with draggable cutoffs for Min/Max counts and Min cells / Max cells and a live count of the genes that pass. The cells chart is drawn in cells while Min cells stays a percentage of the dataset; a dragged cutoff converts through the same rounding the request uses, so the line shows the count scanpy will be given. GET /api/scanpy/filter_genes/qc.
  • Exclude Genes: patterns preset by species (Analyze → Preprocess → Exclude Genes). When the gene names say human, the pattern field opens as ^MT-, ^ENS, ^RPS, ^RPL, ^LINC instead of the mouse ^mt-, ^Gm\d+, ^Rps, ^Rpl. Only the stock default is replaced: a value from the user config, or an edit, stays.
  • Heatmap: order cells by similarity (Heatmap → Configure → Cell Ordering, and the expression-heatmap figure). By similarity (clustered) lays the columns out in dendrogram leaf order of an average-linkage clustering of the cells on the selected genes, each gene scaled to its own range so none dominates the distance, before the cells are binned; Category, then similarity does the same inside each category block. Above 5,000 cells (heatmap.SIMILARITY_EXACT_MAX_CELLS) the cells are first collapsed to 500 k-means centroids, the centroids are clustered, and each centroid's cells are laid out along the axis to the next one; the footer says cells clustered via centroids when that happened (about 4 s at 60k cells × 30 genes). The response carries cell_ordering_method (exact, centroids, or null for the other orderings). A figure whose default ordering is Category, then similarity but has no column degrades to By similarity; an explicit one is refused (400), like the other category orderings.
  • Heatmap: order genes by similarity (Heatmap → Configure → Gene Ordering, and the expression-heatmap figure). By similarity (clustered) lays the rows out in dendrogram leaf order of an average-linkage clustering of each gene's normalised profile, so genes with the same shape sit together; inside each gene set when sets are shown, like By peak position. An unknown ordering is now refused (400) rather than silently drawn as provided.

0.3.0 - 2026-10-14

  • CNV inference and clone calling (Analyze → Cells → CNV inference). An inferCNV-style analysis for tumor data: log expression relative to reference (normal) cells you tick from a categorical column, clipped at ±3, averaged in windows of 100 genes every 10 along each chromosome, centred per cell, with inferCNV's dynamic noise threshold. Clones come from Leiden on the CNV profile or Ward linkage cut into a fixed number, named by rising CNV burden (clone_1 is the quietest); the result table shows each clone's size, burden, share of the reference cells and dominant input group. Gene positions come from shipped GENCODE tables (human GRCh38, mouse GRCm39, backend/skopia/data/gene_positions_*.tsv.gz, built by build_gene_positions.py) matched by Ensembl ID or symbol, or from two .var columns. Writes obsm['X_<key>'], a registered per-chromosome score matrix X_<key>_chrom, <key>_score and <key>_clone (unassigned outside the cell mask), and uns['skopia_cnv'][key]. With several reference categories a gene within the range of their means counts as normal (infercnvpy's bounds rule); X and Y are excluded by default. Hierarchical clustering is refused above 20,000 cells.
  • CNV heatmap figure (new figure kind cnv_heatmap): cells binned within each group, or one mean row per group, × genome windows with chromosome separators, diverging colours, PNG export. Heatmap figure… in the modal saves one grouped by clone.
  • Pure skopia/cnv.py (no new dependencies); prepare_cnv background task; GET /api/cnv/status, POST /api/cnv, GET /api/cnv/results; codegen entry so the notebook export replays it.
  • Benchmarked against copy-number truth (docs/measurements/2026-10-13-cnv-benchmark.md, harness in backend/benchmarks/cnv/): the SNU601 and NUGC4 gastric lines with scWGS, the MM199 myeloma and BCC06 carcinoma samples with WES, a four-patient BCC mix for clone recovery and a PBMC diploid control, from Schmid et al. 2025 (Nat Commun). Four changes came out of it: clones are called on the un-thresholded window matrix (patient ARI 0.40 → 0.98), the expression floor drops from 0.1 to 0.02 mean log expression (max F1 up on every dataset), the Leiden resolution default is 0.5 (1.0 cut 9k cells into 24 clones), a reference category needs 50 cells to set the multi-reference bounds (a 44-cell doublet cluster erased every per-cell event in MM199: tumor-vs-normal AUROC 0.46 → 0.92), and immunoglobulin / TCR / MHC genes are excluded by default. Profile accuracy matches or beats infercnvpy on all four truth sets.

  • A developmental GO slim, shipped as curated bundles (Genes → Sets → Import). Four new bundles beside the signaling pathways: Developmental GO slim, coarse and fine, each for mouse and human. The coarse bundle is 32 sets, one per major developmental process or organ system on two axes — mechanism (pattern specification, cell fate commitment, stem cell maintenance, gastrulation, blastocyst, epithelial morphogenesis, mesenchyme, migration, proliferation, growth, developmental apoptosis, the signaling pathways, ECM, adhesion, chromatin) and anatomy (nervous, neural crest, circulatory, hemopoiesis, skeletal, muscle, renal, respiratory, digestive, gland, epidermis, sensory, craniofacial, reproductive, limb, placenta, connective tissue) — sized for enrichment (30 to 2,296 mouse genes). The fine bundle nests 200 narrower terms under those as folders (chondrocyte differentiation under skeletal; left/right pattern formation under pattern specification; canonical and non-canonical Wnt, BMP, TGF-β, activin, nodal, Notch, FGF, Hedgehog, retinoic acid, Hippo, ephrin, EGF, PDGF, VEGF and IGF under signaling), sized for scoring cells (1 to 694 genes; 25 terms have fewer than 20 mouse genes and are kept for enrichment). A set is the GO term's annotated genes with descendants included, the same closure as the GO library; by GO's convention regulation of annotations do not propagate, so Ptch1 and Hhip are absent from the Hedgehog set and Dkk1 from Wnt unless annotated to the pathway itself. Human sets come from goa_human directly, not by ortholog mapping. The table is backend/skopia/data/dev_goslim.tsv (cross=x marks a fine term placed under a coarse term it does not descend from in GO: osteoblast differentiation under skeletal, liver under digestive) and build_dev_goslim.py regenerates the bundles from it, refusing a wrong, obsolete or misnamed id, an unflagged cross-link, or a duplicate, and printing every size and each sibling pair with Jaccard above 0.5 (somitogenesis ~ somite development 0.82, mesonephros ~ ureteric bud 0.93 are the closest). Built from GO releases/2026-07-26 and the 2026-01-05 GAFs. docs/dev-goslim.md records the derivation for users of the lists: source files and versions, the closure rule and what it excludes, the carve parameters (carve_dev_goslim_candidates.py, 40–350 mouse genes, Jaccard < 0.5, 14 per root), every curation decision, the 32 coarse terms with their sizes, the known redundancies and gaps, and how to regenerate. Design note: docs/superpowers/specs/2026-10-08-dev-goslim-design.md; 30 backend tests.

  • GO slims as importable libraries (Genes → Sets → Library → Gene Ontology). The Gene Ontology source now lists, beside GO annotations, three slim libraries: the GO Consortium's generic slim (140 terms), the Alliance of Genome Resources AGR slim (53 terms) for human and mouse, and MGI's mouse slim (45 terms) for mouse. A slim is a subset: tag on terms inside go-basic.obo, so each library is built from the ontology and GAF already on disk — one set per slim term with ancestors included and no size cap (the ~2,000-gene terms are the point of a slim) — and only downloads the two files if they are not there; refetching GO annotations is still what refreshes them. MGI's own GO-slim page defines its categories with OR/EXCLUDING combinations that, as the page says, standard tools cannot apply, so the mouse slim here is the one MGI distributes through GO. On mouse the generic slim gives 133 sets (7 of its terms have no annotated mouse gene). Catalogues that are code rather than a download (GO, MGI GXD, OmniPath) are no longer served from the cached catalogue file, which would have hidden a library added in a newer build for up to the 7-day TTL. go_semantic.slim_sets; 7 backend tests.

0.2.0 - 2026-10-05

Added

  • Releases, and a record of which build did what. pixi run release X.Y.Z prepares a release locally: on a clean main it runs the backend and frontend suites, sets the version in all five files that state it (including package-lock.json's two copies, which nothing checked before), moves the changelog's Unreleased section under a dated heading with comparison links, then commits and creates an annotated tag. It stops before the push. Pushing the tag runs .github/workflows/release.yml, which checks the tag against the files and publishes the GitHub release with that changelog section as its notes. A section longer than GitHub's 125,000-character limit is cut after a whole entry, with a link to the full changelog (today's Unreleased is 222,000 characters). pixi run version prints the version and fails if the files disagree. Every analysis-record step now records the skopia build that ran it: 0.2.0 at a release, 0.2.0+g<commit> between releases, plus .dirty with uncommitted changes. Exported h5ad files carry uns['skopia_provenance']. A notebook's header names the builds that recorded its steps, and its metadata the build that rendered it. GET / reports the build. The script is scripts/release.py, standard library only, and the build logic is backend/skopia/provenance.py; 36 backend tests. The README has a Releases section.
  • Diffusion maps and diffusion pseudotime on any graph (Analyze → Cells → Diffusion map / Pseudotime (DPT)). Diffusion map computes the diffusion components (Haghverdi et al. 2015) of any connectivity graph — the expression kNN, the spatial graph, a Combine Neighbors result, or a subset's own graph — with UMAP's graph picker, naming (X_diffmap, X_diffmap_spatial, X_diffmap_<subset>) and subset scoping. The computation is scanpy's, run on a throwaway AnnData holding only the graph, so on a symmetric connected kNN it is bit-identical to sc.tl.diffmap; what skopia adds is for the graphs that are not a scanpy kNN: cells with no edges (a radius spatial graph, a subset's slice) get no coordinates instead of scanpy's silent placement at 0, as do pieces of fewer than 10 cells; an asymmetric graph (squidpy's kNN spatial graph) is symmetrised as (W + Wᵀ)/2 before eigsh; a disconnected graph is mapped piece by piece (exact for a block-diagonal matrix, where ARPACK misses repeats of the eigenvalue 1) and reported with its sizes; a graph in more pieces than components is refused at once, where ARPACK used to stall for up to 100 s and fail; and a bipartite graph's −1 eigenvalues (two-cell pieces, trees, 4-neighbour grids) no longer push informative components out of scanpy's largest-magnitude selection. The plot opens on the first informative pair (DC1 × DC2, past every stationary component) and the axis pickers say DC0…. Pseudotime (DPT) opens a tool that runs sc.tl.dpt on a chosen map from a chosen root: the most potent cell by stemFinder (lowest stemfinder, or highest diffometer; offered when a score exists), a numeric column's lowest or highest cell, the centre of a cell group, the current selection, or a tip of a diffusion component. A group's or selection's root is the cell nearest its centre in DPT's own metric. Cells the root cannot reach get no pseudotime (scanpy gives inf). Output dpt_pseudotime is named after its map, a re-run overwrites it and recolours, and the record logs the resolved root cell so the notebook (xa.run_diffmap(...), xa.run_dpt(...)) replays the same root. Each map's graph and eigenvalues are kept in uns['skopia_diffmaps'] (and scanpy's uns['diffmap_evals'] / uns['iroot'] for the default map), so DPT also runs on an X_diffmap scanpy wrote. Both join the subset tree (chips, cascade delete). POST /api/scanpy/diffmap, GET /api/scanpy/diffmaps, POST /api/scanpy/dpt. Pure backend/skopia/diffusion.py; 58 backend tests, 22 frontend. Design note: docs/superpowers/specs/2026-09-30-diffmap-dpt-design.md.
  • Tune a gene-set highlight from its row (Genes → Sets → 🖍). Clicking 🖍 now adds the layer and opens its controls under the row — the same ones as Color → Highlight: colour, threshold mode (≥ / ≤ / between), the score histogram with its draggable cutoff, and opacity — so a highlight can be set without leaving the Sets tab. On a highlighted set, 🖍 opens and closes the controls, and their × removes the layer (a second click no longer removes it outright, so a tuned threshold is never one misclick from lost). The slider that was labelled Intensity is now opacity in both places, which is what it sets: how strongly the highlight colour covers the cells' own. The layer's histogram now fits the width it is given. Dragging a control inside a Manual folder no longer drags the folder instead.
  • One-click highlight overlay from a gene-set row (Genes → Sets → 🖍). The new icon beside 🎨 does what Color → Highlight → + Gene set does — overlays the set's score on the current colouring as a highlight layer, with the same defaults (intensity 0.85, above threshold) — without leaving the Sets tab. The icon is ringed in the layer's colour while the set is shown, and a second click removes it; threshold, colour and intensity stay adjustable under Color → Highlight. A set edited since it was added reads as not shown (the layer holds the old genes); a set listing a gene twice still matches, and a click clears every layer of the set. A directional set is scored on its ↑ genes, as in the Color tab, and the tooltip says so. New layers take the first palette colour not already on screen, chosen once the score arrives, in both places — counting layers repeated a colour after a removal, and two adds in flight took the same one. Both paths now refuse a set none of whose genes are in the dataset (or all masked), or whose score is the same in every cell: an above threshold on a flat score passed every cell and tinted the whole plot. Pure lib/highlightLayers.ts (17 tests).
  • Differentiation scores from PyStemFinder (Analyze → Cells → Differentiation (stemFinder)). PyStemFinder (Noller & Cahan, 2024) estimates how far each cell has progressed through differentiation from the heterogeneity of cell cycle gene expression in its kNN neighbourhood. The tool writes stemfinder (lower = less differentiated, oriented like pseudotime) and stemfinder_raw, diffometer, and optionally the baselines the R package compares against — mean cell-cycle expression (stemfinder_cc_mean) and the number of expressed transcription factors (stemfinder_n_TFs) — then colours by the first score. Markers default to the species' S + G2M genes (species guessed from the gene names; matched case-insensitively), or any Gene-panel set. skopia prepares what PyStemFinder expects from .X or a layer: counts are normalized to 1e4 over every gene and log1p'd, log-scale data is used as is, and the markers are scaled per gene for the default gini method; the log-normalized metrics are refused on z-scored input. The neighbourhood is an exact kNN graph with the method's k = √n built on a PC embedding for the run and discarded — seconds at 60k cells, where sc.pp.neighbors spent a minute and a half on connectivities stemFinder never reads — or any existing graph, through its *_distances; a cell the mask leaves without neighbours gets no score rather than PyStemFinder's "fully differentiated" 0. The result warns about an expression scale it could not tell, markers that are highly variable (they shaped the PCA), and small neighbourhoods. The cell mask scopes everything — scaling, graph and √n — and leaves NaN outside; a column suffix (defaulting to a saved subset's name) keeps runs apart; Summarize by ranks a categorical column's groups by median score. On the same preprocessing skopia's scores equal a direct PyStemFinder run exactly. GET /api/stemfinder/status, POST /api/stemfinder (task); the notebook emits xa.prepare_stemfinder(...). Pure backend/skopia/stemfinder.py follows the pyscn.py optional-dependency pattern; pystemfinder>=0.5 joins the default pixi environment (its own dependencies were already there). 44 backend tests (24 skip without the package), 17 frontend. Design note: docs/superpowers/specs/2026-09-30-stemfinder-design.md.
  • Gene Set Manager (Genes → Sets → Manage sets…). One window for tidying a crowded Gene pane.
  • Delete many at once. Every category, folder and set has a checkbox. A folder's box takes the folder and its contents, ticking every set in a folder ticks the folder, and with the filter box in use (set name, folder name, or a gene the set contains) every box — and Tick all matches — takes only what is shown, so a filtered delete never removes a set you could not see. Delete ticked asks once for everything: clearing out the 23 imported signalling pathways is Tick all, untick what to keep, Delete.
  • Merge any number of sets. The Merge tab takes every ticked set and keeps genes in any of them (union, the default), in all of them, or in at least k of them. It previews the count and the first genes, suggests a name, files the result in any folder or a new one, and can delete the sources. Directional sets merge their down genes by the same rule.
  • Type or paste genes. The New set tab takes symbols separated by spaces, commas, semicolons, tabs or new lines, and strips quotes, bullets and list numbers. It checks them against the dataset's genes as you type: matches that differ only by case are stored in the dataset's spelling (sox9 → Sox9), and unknown symbols are listed and dropped unless you keep them. Down genes make a directional set. The Manual category's + and a folder's + now open this tab with the destination filled in, instead of making an empty set to drag genes into (an empty set is still allowed).
  • Edit. Click a set's name, or pick Edit genes… from its ⋯, to rename it and edit its genes as text. Genes the current dataset lacks are kept, since a set is not tied to one dataset. Duplicate is also offered.
  • Organise by hand. + New folder sits above the tree. Double-click a folder or set name (or its ✎) to rename it in place. Drag a set onto a folder to move it there (onto a category header for its top level; across categories too), or onto another set to merge them. The set dropped on keeps its name and place, becomes the union (down genes included), and the dragged set is deleted. A ticked set carries every ticked set with it. The row under the pointer says which will happen (move here / merge into), a closed folder opens after a moment's hover, and the status line offers Undo until the next change. Ticks and the Edit tab follow a moved set, and a folder emptied by a move is unticked so Delete cannot take it.
  • Pure lib/geneSetManager.ts (63 tests); the store gains replaceGeneSetCategories.
  • Clear all gene sets (File menu, Genes ⋯, and the manager) empties the Gene pane after a confirm that states what goes. It offers Download a backup (JSON) first, in the Import modal's format (folders and down genes included). File → Export → gene sets now carries genesDown and folder too, so exports re-import as they were.
  • File → New session… unloads every dataset and reloads skopia, ready for a new analysis.
  • The confirm lists the datasets, links to Export first…, and can also delete all gene sets (off by default, since sets outlive datasets).
  • Backend: POST /api/session/reset ({clear_gene_sets}) cancels running background tasks (TaskManager.cancel_all) so a result computed on a dropped dataset is never applied, and drops every slot.
  • An empty backend is now a clean state: startup no longer asks for a schema that is not there (no red No data loaded for slot 'primary'), the Genes pane's gene-ID and similar-genes checks wait for a dataset, and the empty centre panel has a Load a dataset… button.
  • The version under the title (v0.1.0; the tooltip adds the commit the dev server started from). main.py reads skopia.__version__, and test_version.py keeps package.json, pyproject.toml and pixi.toml in step with it.
  • Design note: docs/superpowers/specs/2026-09-28-gene-set-manager-and-reset-design.md.
  • The composition barplot and the expression heatmap are figure kinds too. Both tabs gain Save as figure: the barplot becomes a composition_barplot record (columns, the active named subset or the frozen mask indices, order / share-of / normalise / min-cells / show-values), the heatmap an expression_heatmap record (gene sets, obs column, line, cells; cell and gene ordering, aggregation, bins). The Figures tab renders them with the same components the tabs use (the barplot's SVG and the heatmap's canvas were extracted into components/figures/), edits them through the generic params form (the barplot's Share of lists the live column-B categories), exports the barplot as SVG or PNG and the heatmap as PNG (it is a canvas), and attaches either to the record. figure_data runs the existing crosstab and heatmap computations — nothing numerical changed. Design note: docs/superpowers/specs/2026-09-26-figures-and-batch-enrichment-design.md (Part C).
  • Figures: a saved, reproducible home for non-interactive plots — starting with enrichment heatmaps and networks. A new Figures tab (the multi-panel embedding compositor moves to Panels) lists figure records stored in uns["skopia_figures"]: kind + inputs (stored result keys) + display params + provenance. A figure is data and a spec, not pixels: the plotted table comes from xa.figure_data(id) on the backend, the browser draws it as SVG, and the notebook export carries the spec and the data call so any figure can be regenerated. Two kinds ship: enrichment heatmap (gene sets × groups in the PySingleCellNet convention — cells above the padj threshold are 0, rows are the union of each group's top-N positive and negative sets; NES or signed −log10 padj; optional collapse of redundant rows by member-gene Jaccard with the absorbed sets listed; peak-column or hierarchical ordering; diverging colour scale) and enrichment network (groups and gene sets as nodes, enrichment edges coloured by sign, optional dashed set–set overlap edges, force-directed or two-column layout). Create one from a batch enrichment result's Heatmap figure… / Network figure… buttons or from New figure…; edit params with a live preview and an explicit Save (each edit is a recorded step); Export SVG / PNG (1–4×); Attach to record puts a PNG in the analysis record linked to the figure's own step, and the record shows an open link back; Duplicate, Delete. Deleting a figure's input result keeps the figure listed with a clear message rather than losing its provenance. POST/GET/PUT/DELETE /api/figures[/{id}], POST /api/figures/{id}/data (409 when an input is gone), POST /api/figures/{id}/attach; defaults under figures: in config.yaml. Pure backend/skopia/enrichment_figures.py. Design note: docs/superpowers/specs/2026-09-26-figures-and-batch-enrichment-design.md (Part B).
  • Enrichment for every group of a column in one run (Compare Cells → Enrichment). The Enrichment tool's GSEA tab has an All groups (one vs rest) option and the Overlap tab a Marker genes of each group in a column… query; Compare Cells, the Marker Genes modal and the Diff Exp modal gain an Enrichment… hand-off that opens the tool pre-set to the checked groups (or to group 1 vs group 2). A batch stores one ordinary result per group (gsea_<column>_<group>_vs_rest, ora_<column>_<group>_markers) plus a collection (gsea_<column>_batch, ora_<column>_batch) listing them, with the marker lists kept inside the ORA collection so it stays self-contained; a group with fewer than two cells on either side is skipped and named rather than failing the run. The results view shows one chip per group with its significant count, the table for the chosen group, and Add to gene sets files one folder per group. One analysis-record step per batch (xa.prepare_gsea_batch(...), xa.run_overlap_enrichment_batch(...)); POST /api/enrichment/gsea_batch (task) and /ora_batch; GET /api/enrichment/results/{key} on a collection returns its members expanded. Design note: docs/superpowers/specs/2026-09-26-figures-and-batch-enrichment-design.md (Part A).
  • Gene-set enrichment: overlap (ORA) and preranked GSEA. A new Enrichment tool (⋯ → Enrichment (overlap)… on a gene-set row, Genes panel menu → Enrichment analysis…, or Analyze → Genes → Gene-set Enrichment) tests a gene list or a ranked contrast against the libraries already cached by the Gene set library (MSigDB, GO, Enrichr, OmniPath, MGI) and against the user's own Gene Panel folders. Overlap is the hypergeometric test with Benjamini–Hochberg across sets, in a universe of the dataset's genes after the gene mask and an optional boolean .var column; symbols match case-insensitively. GSEA ranks genes by a group-vs-rest / group-vs-group Wilcoxon or t statistic (or log2 fold change), optionally inside a saved cell subset, or by a PCA loading, and runs the Subramanian weighted running sum with a gene-permutation null shared across set sizes (one vectorised ES evaluation per size class — whole GO in seconds); directional sets are tested as set and set (down). Results table with padj filter, search and inline bars; an expanded GSEA row draws the running score, hit rug and ranking-metric strip and lists the leading edge; Add to gene sets files overlap / leading-edge genes into a new Enrichment category; Copy TSV and Download SVG. Results persist as JSON under uns["skopia_enrichment"], are listed under Previous runs, and are recorded in the analysis record and notebook (xa.run_overlap_enrichment(...), xa.prepare_gsea(...)). Pure backend/skopia/enrichment.py (no gseapy; scipy + numpy), POST /api/enrichment/overlap, POST /api/enrichment/gsea (task), GET/DELETE /api/enrichment/results[/{key}]; enrichment: defaults in config.yaml. 16 backend tests, 8 frontend. Design note: docs/superpowers/specs/2026-09-26-enrichment-design.md.
  • Developmental signalling pathways as bundled gene sets, laid out by role. Import → Library now offers Developmental signalling pathways (mouse) and (human): 23 pathways — Wnt (canonical), Wnt/PCP, BMP, TGFβ/Activin/Nodal, FGF, Hedgehog, Notch, retinoic acid, Hippo/YAP, JAK-STAT, EGF/ErbB, PDGF, VEGF, IGF/insulin, HGF/MET, GDNF/RET, Eph/ephrin, semaphorin/plexin, Slit/Robo, netrin, endothelin, prostaglandin, hypoxia/HIF — each loading as a folder whose sets are the pathway's genes by role, in a fixed order: ligands, receptors, modulators, effectors, inhibitors, targets (the transcriptional readouts: Axin2/Lef1/Sp5 for Wnt, Id1-4 for BMP, Ptch1/Gli1/Hhip for Hedgehog, Hes/Hey for Notch, Spry/Dusp6/Etv4-5 for FGF, Cyp26a1/Rarb for RA, …). 116 sets and 808 genes per species. The mouse table in skopia/data/build_dev_signaling.py is the source; human is derived with explicit ortholog overrides (Fgf15 → FGF19, Ins2 → INS, Car9 → CA9, Gh → GH1, T → TBXT, Il6ra → IL6R, Il4ra → IL4R), and every symbol is checked against the bundled Ensembl tables by the build and by 10 tests, so a typo cannot ship.
  • Heatmap: pick a whole folder, grouped by role. The heatmap's gene-set list now nests sets under their folder with a folder-level checkbox (indeterminate when only some are picked), so one click lays a pathway out ligands → receptors → … whatever order the boxes were ticked. When sets from several folders are mixed, each row group is labelled "Wnt (canonical) · ligands" so equal role names stay apart in the colour bar and legend.
  • The subset tree: nested sub-clustering recorded in the AnnData, with each subset's embeddings and what is drawn on them. Patrick's workflow is recursive — cluster, subset a cluster, re-run HVG → PCA → (drop PCs) → kNN → Leiden → UMAP inside it, repeat — and nothing in the AnnData ecosystem records that hierarchy. uns["skopia_cell_subsets"] now does: a subset's parent (inferred at creation as the smallest saved subset containing every one of its cells, or given explicitly), its origin (the embedding it was saved on), and a derived record that each scoped step writes at run time — the key it produced and the parameters it ran with, with UMAPs and Leiden columns keyed by output so a run over another graph sits beside the first. The listing merges that record with name-based detection for older files, reports only keys that still exist, and adds every embedding the subset owns plus the shapes and territory types drawn on those embeddings. Design note: docs/superpowers/specs/2026-09-20-subset-tree-design.md.
  • Cells panel. Subsets are a tree: rows indent under their parent, and the badges become chips — one per embedding (click to show it), one per Leiden column (click to colour by it; its ⋯ offers Refine ‹parent's clustering› with this…, which opens Transfer Labels with the column pre-picked as the source), and N shapes / N territories chips that switch to the embedding they were drawn on. Deleting a subset "+ results" now names everything that goes.
  • Deleting with results cascades. Dropping a subset's X_umap_<name> also drops the shapes and territory types drawn on it (their geometry; a territory's .obs columns stay), and its PC subsets. The response lists dropped_lines and dropped_territories.
  • PCA Loadings and PC subsets on a subset. With a saved subset active, PCA Loadings reads PCs_<name> / uns["pca_<name>"], and a PC subset made there is X_pca_<name>_<suffix> with its loadings and variance ratios under the subset's keys, recorded in the registry and offered by the Neighbors PC-source picker. A dataset PCA re-run leaves them alone; a subset PCA re-run clears that subset's own. ?cell_subset= on GET /api/scanpy/pca_loadings and /pca_subsets, and a cell_subset field on the POST.
  • Backend: parent / origin on POST /api/cell_subsets; the notebook emits xa.create_cell_subset(…, parent='chondro') and xa.create_pca_subset(…, cell_subset='chondro'). Deleting a parent moves its children up to its parent. 40 backend tests in test_subset_tree.py, 10 frontend in subsetTree.test.ts.
  • Drawn shapes and lines persist with the dataset. They lived only in the browser and reached uns["skopia_lines_json"] at export; a reload lost them. Every change now syncs (debounced) to the backend, which writes the full shape — id, embedding, axes, points, smoothing, draw type, closed, visibility, stroke and fill — into uns["skopia_lines_json"], reads it back on load (tolerating the old export shape), and GET /api/lines returns it. The browser hydrates each dataset's shapes once per load and never syncs before that, so an empty store cannot wipe a file's shapes.
  • Delete an .obs column (Cells panel). Delete appears beside Hide on hover for categorical and continuous rows, and on hidden rows, with an inline confirm. The backend drops the column and its uns["<col>_colors"], removes the subset entry if the column was a saved subset's, and records the step (the notebook emits del adata.obs['…']). DELETE /api/obs/{column}; the browser clears colour-by, the label overlay and hidden state if they named the column. 7 tests.

  • Three more annotation sources in the Gene set library (Genes → Library).

  • OmniPath. CollecTRI regulons: one signed set per transcription factor — activated targets as the set, repressed targets as its down genes — so an imported regulon is a directional set UCell scores as TF activity. Ligand–receptor pairs: the receptors of each ligand and the ligands of each receptor, from CellPhoneDB, CellChatDB, CellTalkDB, ICELLNET, connectomeDB2020, Cellinker and Baccin2019 as OmniPath curates them; complexes contribute every subunit. Mouse and human. UniProt accessions that OmniPath prints where a symbol is missing are dropped.
  • MGI GXD. One library per Theiler stage (TS1–TS28, labelled with the embryonic day): the genes the Gene Expression Database has seen detected in each anatomical structure at that stage, one set per structure, with the assay mix in the description. Mouse only; a whole stage is ~35 MB and about ten seconds.
  • Gene Ontology. Fetches go-basic.obo and the species GAF from the GO Consortium and offers every term with 5–500 genes as a set, ancestors included. Fetching it is also what switches on the gene map's new channel below.
  • Library names sort numerically (TS1, TS2 … TS10), and a directional library set keeps its down genes through search, overlap and import.
  • GO semantic similarity as a gene map channel (Genes → gene set → ⋯ → Gene map…). The annotation channel counts every shared set alike, so two genes sharing "biological process" look as related as two sharing "chondrocyte differentiation". The new GO semantic channel closes each gene's annotations over the ontology, weights every term by information content, and compares genes with SimGIC (Σ IC of shared ancestors over Σ IC of the union) — one sparse matrix product, so thousands of genes are instant. Aspect (BP/MF/CC) and weight in the modal; go_weight / go_aspect in config.yaml; the summary reports how many genes were annotated over how many terms. New pure backend/skopia/go_semantic.py (7 tests) and 5 gene-map tests; 11 source tests. Design note: docs/superpowers/specs/2026-09-19-annotation-sources-omnipath-mgi-go-design.md.
  • The composition barplot honours the cell mask. The crosstab takes the mask's indices in a POST body (POST /api/obs/crosstab) and the toolbar says 300 of 1,000 cells (mask); Reset Mask counts everything again.

Changed

  • The gene mask now scopes every operation that reports genes, not just the Gene Panel. It was a browse-and-search filter: the panel said a gene was hidden while the heatmap drew it as a row, Marker Genes returned it, and a line-association run tested it. The rule is now one sentence — the mask is the visible gene universe for anything that reports or displays genes — and it covers the heatmap, Diff Exp, Marker Genes, single- and multi-line association, gene NMF and meta-programs, the gene map, gene PCA and gene neighbours, gene-set clustering, spatial autocorrelation, and ligand–receptor analysis. Where an operation has its own gene-subset dropdown the two intersect, and a subset the mask hides entirely stops the run with a message instead of testing nothing. Three operations deliberately still read the whole .var axis, because a session-only view must not silently change what gets written into the file: the scanpy chain (Filter Genes → HVG → PCA → Neighbors → UMAP → Leiden), Merge Spots, and the Localize reference bundle. The heatmap toolbar reads · 3 hidden by gene mask and the line-association result says how many genes the mask left out; every gene-subset summary carries n_hidden_by_gene_mask. Cluster Gene Set's Restrict to active gene mask checkbox now defaults to checked, matching everything else. Implementation: _resolve_gene_mask intersects with the mask by default and takes apply_visible_mask=False for the three opt-outs. 15 tests in test_gene_mask_scope.py.

Fixed

  • A diffusion map zoomed out on the first scroll and then would not zoom in. The plot clamped deck.gl's zoom (log2 of pixels per data unit) to a fixed −10…10, which suits UMAP's tens of units. Diffusion components span a fraction of a unit and fit at about 11, above the ceiling, so the first wheel or drag clamped the view out to 10 and nothing could zoom back in. The limits are now the fitted zoom ± 10 in the main plot, the 3D plot and figure panels. The fit also ignores cells with no coordinates (it used to count them at 0), and a view with no extent opens at zoom 0 instead of Infinity.
  • Cells with no coordinates sat at the origin. On a subset's embedding the cells outside the subset have no coordinates. The plot's position buffer stored them as 0, so all of them were drawn as one dot at (0, 0), and a lasso around the origin selected every one. They are no longer drawn or selectable.
  • Deleting a subset with its results could delete the dataset's own. A subset's graph is <name>_connectivities with scanpy's entry at uns[<name>], and keys the record did not list were claimed by name. So deleting a subset named spatial took squidpy's spatial_connectivities / spatial_distances, uns['spatial'] (where Visium keeps its images), and the X_umap_spatial / leiden_spatial a run over the spatial graph writes. A subset now owns a key only if it holds values for the subset's cells alone (no graph edge leaving it, NaN embeddings and unassigned labels outside it), recorded or not, and uns[<name>] goes only when it is the entry for that graph. A new subset may not take a name whose keys the dataset already uses (or spatial, neighbors, pca, umap, leiden, hvg, which it writes later). A scoped run on an older subset with such a name is refused rather than overwriting.
  • stemFinder suffix raw wrote over the raw score. stemfinder is a prefix of stemfinder_raw, _cc_mean and _n_TFs, so suffix raw wrote stemFinder's score to stemfinder_raw: it overwrote an unsuffixed run's raw score, and Pseudotime (DPT) read it as higher = less differentiated and rooted at the most differentiated cell. A suffix that makes a column read as another score's (raw…, cc_mean…, n_TFs… with stemFinder selected) is now refused, and the modal says so before Run.
  • Marker genes and the heatmap now honour the cell mask. Both ran on every cell whatever the mask said, so markers were ranked against cells the user had put out of scope and the heatmap drew them. Marker genes now compares each group with the rest of the active cells (active_cell_indices on POST /api/marker-genes; the record notes the selection). The modal says it is scoped, shows each group's count inside the mask ("1 of 333 cells"), dims groups the mask empties, and names the gene-set folder after the scope ("zone markers (668 cells)" or the saved subset's name). A checked group with no active cells is left out rather than rejected, and a group with one active cell gets no markers instead of failing the run — scanpy refuses the whole call over a single-cell group. Results say which cells they came from and are cleared when the mask changes (the modal never unmounts, so reopening it used to show markers for the old cells under the new scope note); Run needs two checked groups with two active cells each, and a group with one active cell says it was not tested. The exported notebook replays the selection (active_cell_indices=SELECTIONS['step_N']) instead of warning that it runs on every cell — ActionSpec.replays_selection marks steps whose code does that. The Heatmap tab draws its own restriction (a gene clustering's cells) narrowed by the mask, re-draws when the mask changes (only the latest request lands; renaming the mask as a subset does not re-draw), says so in the toolbar and the settings, and Save as figure records what it drew (the saved subset's name when the mask is one). 15 backend tests, 14 frontend.
  • Gene set library: the header checkbox selects every set the search returned, not just the 50 on screen. The set list is paged, and both the header box and Import worked on the current page only. Ticking sets on page 1 and importing from page 3 silently dropped the page-1 picks, and the button's count covered only the page in view. Picks now persist across pages, and the footer reads 467 selected (417 not on this page). The header box fetches every match with its overlap, 1,000 at a time with a progress count, applies the "≥ N present" filter, and ticks them all: the 11,859-set mouse GO library takes about two seconds on the E11.5 hindlimb. An import of more than 100 sets lands as a collapsed folder, because the Genes pane draws every set of an open folder; importing all 11,857 GO sets stays responsive. New helpers in lib/geneSetLibrary.ts (collectAllMatching, headerTickState, picks as a name → row map), 5 tests; addFolderToCategory takes { expanded: false }.
  • "Select cells by expression" could only label cells once. Labelling from a gene set worked the first time; opening the modal on a second gene set showed the first set's "Labeled N cells high, M cells low" footer, and with it only Open Diff Exp and Close — the Apply button lives in the other branch of that footer, so a second annotation could not be created at all, and Open Diff Exp would have compared the previous set's cells under the new set's title. The modal is mounted unconditionally in App and hides itself by returning null after its hooks, so closing it never unmounts it and nothing reset the apply status. An outcome is now recorded against the run that produced it — the source object the modal was opened with, plus the inputs that defined the run — and is shown only while both still match, so reopening (on another gene set, or on the same one) starts clean and moving the threshold after a successful run brings Apply back instead of leaving a dead end. Two things that leaked the same way go with it: the annotation name follows the new gene set again even after the previous name was hand-edited, and the high/low labels return to their defaults rather than carrying the last set's wording over. New lib/selectByExpression.ts with 14 tests.

Fixed

  • The heatmap's line-based cell orderings always failed with "Unknown error". By line position, By distance from line and Category, then position each called the adaptor's projection helper with the embedding's name where it expects the coordinate array, and read the result as a list of dicts where it returns a (positions, distances) pair — so every run raised a TypeError the route turned into a bare 500. The three orderings have never worked since the heatmap was written; there were no tests over them. They now project against the two .obsm columns the line was actually drawn on (dimX/dimY, not necessarily 0/1), sort the cells in the current subset, and leave the order untouched when the named line is gone. 8 tests in test_heatmap_line_ordering.py.
  • Line association: "Max genes/direction" is now an optional cap, and truncates by significance. It was mandatory at 50, so a run that found 3,320 associated genes reported 100 of them (50 per direction) and said nothing about the rest. The field is blank by default — every gene past the FDR threshold is returned — and a number in it caps each direction, or each module when clustering. When it does cap, it keeps the highest-scoring genes: module lists are ordered by peak position along the line, and truncating that order used to keep whichever genes peaked earliest, biasing the result to one end of the line. A module's n_genes now counts the genes actually returned rather than the module's full size. top_n: null in config.yaml (it was 50); null on POST /api/lines/association and /lines/multi-association. 9 backend tests, 6 frontend.
  • Marker genes on a dataset without highly_variable failed with "Column 'highly_variable' not found in .var". The modal defaults its Genes dropdown to highly_variable when the dataset has that column and to "All genes" otherwise, but the Run callback did not list that choice among its dependencies, so it kept whichever value it had captured last — the previous dataset's highly_variable, or the previous dropdown choice on the same one — while the dropdown showed something else. The request is now built by a tested helper from the current choice, and changing the dropdown takes effect on the next Run.
  • A PC subset made on a saved subset did not appear in the Neighbors PC-source picker. Selecting Neighbors refreshed the PC-subset list without the subset scope, and since the dataset's list no longer includes subset-owned keys, the X_pca_<name>_<suffix> just created vanished from the dropdown. Both refreshes now carry the scope, the store keeps one owner-tagged list, and the picker offers the active subset's PCA and PC subsets first, then the dataset's. The PCA Loadings list shows only the current scope's.
  • After analysing a subset, the other cells could not be brought back. The Analyze modal switches the plot to the subset's new UMAP, where the cells outside the subset have no coordinates and are simply not drawn; Reset Mask then cleared the mask but the plot stayed there, so half the dataset looked gone for good. Any plot whose embedding cannot show every cell now says so — "500 of 1,000 cells have no coordinates in X_umap_chondro — it was computed on a subset" — with a Show all cells on … button that goes back to the embedding the subset was drawn on (for a child drawn on its parent's UMAP, one level up), and Reset Mask does the same switch itself when the current embedding would leave cells invisible. The hint written for this yesterday was never rendered.
  • A subset's PCA was listed as a PC subset of the dataset. X_pca_chondro shares the X_pca_<suffix> shape, so the dataset's PC-subset list showed it with nothing dropped. Keys under a saved subset's prefix are now the subset's own and never appear there.
  • The embedding picker could name a key the schema no longer had. After deleting a subset with its results while its UMAP was on screen, the picker kept pointing at the vanished key. setSchema now re-picks (spatial › UMAP › PCA › first) when the selected embedding is gone, as the split pane already did.
  • Named cell subsets — sub-cluster a population without losing the dataset's own results. Masking cells and running HVG → PCA → Neighbors → UMAP → Leiden used to write over X_pca, X_umap, the kNN graph and leiden, with NaN rows and unassigned for the masked cells; and because the mask lived only in the browser, a reload or Reset Mask left those cells invisible with nothing to restore them (the "I can never unmask them" bug). A mask can now be saved as a subset — obs["subset_<name>"] plus a registry in uns["skopia_cell_subsets"] — and the five chain operations run on it write to keys suffixed with its name: highly_variable__<name>, X_pca_<name>, <name>_connectivities, X_umap_<name>, leiden_<name>. Each step defaults to the previous step's subset output (PCA to the subset's HVGs, Neighbors to its PCA, UMAP and Leiden to its graph), so the sub-clustering workflow is mask → name → run the chain, and the dataset's own results are never touched.
  • Cells panel. The mask bar gains a name field and Save as subset; a new Subsets section lists every saved subset with its cell count, badges for what has been computed on it, Activate (the mask comes back after a reload — the unmask that was missing) and a delete that can also drop the results.
  • Analyze modal. On a saved subset the banner names what the run writes and what it spares; on an unsaved mask it asks for a name inline and saves the subset before running. The graph picker defaults to the subset's own graph, the PC source to its own PCA, and the output name is pre-filled with the suffixed name. The output always carries the subset's name whatever graph is chosen, so a subset run can never land on leiden or X_umap.
  • Backend: create_cell_subset / list_cell_subsets / get_cell_subset_indices / delete_cell_subset on the adaptor, GET|POST /api/cell_subsets, GET /api/cell_subsets/{name}/indices, DELETE /api/cell_subsets/{name}?drop_derived=, and cell_subset on the five scanpy routes and on /scanpy/prerequisites/{action}. Scoped steps export as xa.run_pca(..., cell_subset=…) in the notebook. 41 backend tests, 14 frontend. Design note: docs/superpowers/specs/2026-09-19-named-cell-subsets-design.md.
  • PCA silently intersected an explicit gene subset with highly_variable. scanpy's mask_var defaults to that column whenever it exists, so PCA on spatially_variable (or a subset's own HVG column) used only the genes that were also pooled HVGs, and failed outright when none were. The explicit-subset path now passes mask_var=None; the exported notebook emits the same.
  • PCA asked for more components than the HVG mask allowed. The component clamp looked at every gene while scanpy used only the HVGs, so a 76-gene dataset with 40 HVGs requested 50 components and arpack refused. Clamped against the genes actually used.
  • Category labels on the plot no longer collide. "Show labels on plot" placed every label at its cluster's median, which on a spatial embedding puts all of them in the middle of the tissue on top of each other. Labels are now laid out so no two overlap: the biggest clusters keep their centroid, smaller ones are pushed to the nearest free spot (a thin leader line points back at the centroid), and anything that still cannot fit is hidden rather than drawn over another label — it appears as you zoom in. The layout re-runs on every pan and zoom.
  • Snapshot panes shrink the font to fit. A pinned snapshot now picks the largest font (down to 7 px) at which every label fits without overlap for its current size, so resizing a pane no longer piles the labels up; below 60 px there are no labels at all. On the E11.5 hindlimb coloured by its 32 Seurat clusters, a 240 × 170 pane shows all 32.
  • Label Font Size slider in Display settings (8–24 px, default 13; display.label_font_size in config). Manual drag-to-place was considered and left out: the automatic layout removes the need, and hand positions would not survive a pan, zoom or re-projection. New pure frontend/src/lib/labelLayout.ts (7 tests: anchors kept when free, priority by cluster size, bounds, hiding under a shift budget, determinism, font fitting).
  • What is this gene? — an ⓘ on every gene row (MyGene.info). Search results, gene-set members and a directional set's down genes each carry an ⓘ beside the copy button. It opens a card with the gene's full name, aliases, the RefSeq summary, GO terms ordered by evidence strength (experimental first, codes shown, expandable), InterPro domains, pathway membership, the human or mouse ortholog, and links out to NCBI, Ensembl, MGI or HGNC, and UniProt. Mouse genes rarely have a RefSeq summary of their own; when HomoloGene names a human ortholog its summary is shown and labelled as borrowed (Sox9 reads SOX9's, H2-Ab1 reads HLA-DQB1's).
  • Fetched once per machine. Annotations are cached in ~/.cache/skopia/gene_annotations.sqlite by species and the dataset's own spelling; Ensembl-id datasets are looked up by id. Genes MyGene does not know are cached as not found so a hover never re-queries them. Genes panel → ⋯ → Fetch gene annotations for all genes… warms the cache for a whole dataset as a background task (the 12,236-gene E11.5 hindlimb took about 90 s, after which every card opens in a few milliseconds).
  • New pure backend/skopia/gene_annotations.py (7 tests: hit parsing incl. duplicate-hit disambiguation and evidence upgrade, ortholog summary fill, batching by scope under MyGene's 1,000 cap, cache round trip and refresh, adaptor species guess, routes and the prefetch task); POST /api/gene_annotations, GET /api/gene_annotations/{symbol}, GET /api/gene_annotations/status, POST /api/gene_annotations/prefetch; frontend/src/lib/geneAnnotation.ts (3 tests). Verified in the browser on the hindlimb: Col1a1's card from a search row, Col11a1's from a set row, and the bulk prefetch.
  • Gene map (gene-set row → ⋯ → Map genes…, or Genes panel ⋯ → Gene map… for any gene subset). Genes as points. A gene–gene similarity is built from up to three channels with weights you set — expression (correlation across cells, bicor by default, optionally on a smoothed layer or a cell selection), annotation (cosine similarity of which cached library sets each gene belongs to — GO, Reactome, the matrisome categories, cell-type markers, whichever libraries you have fetched) and STRING (the combined score of every edge among the genes, queried live). Leiden on its kNN graph gives modules; UMAP on the precomputed distance gives the layout.
  • Map view: hover for the gene, its module and how many sets annotate it; drag a lasso and save the enclosed genes as a gene set. Similarity view: the full matrix as a clustered heatmap with module boxes (modules are contiguous blocks, dendrogram order within each) and a hover readout of any pair. Modules view: save one module or all of them under Gene Clusters.
  • The map lives in uns['skopia_gene_maps'][key] with its similarity matrix (float32, up to 3,000 genes) and is served by GET /api/gene_map/{key}. A library named for the annotation channel must already be cached; naming one that is not is a 400 before the task starts. New pure gene_similarity.py (11 tests: exact channel values on hand-built memberships and edges, weighted combination, planted-block module recovery, UMAP/MDS shapes, contiguous heatmap order, adaptor state, routes incl. the {columns, operation} subset spec, codegen), frontend/src/lib/genePlot.ts (5 tests). Config namespace gene_map:. Verified in the browser on the E11.5 hindlimb with the 160-gene NABA_CORE_MATRISOME set and all three channels (expression 40%, two libraries 40% — every gene annotated across 641 sets — STRING 20% with 1,807 edges): four modules of 63/58/20/19 genes, a hover on Col2a1, a 40-gene lasso saved as a set, and all four modules saved as gene sets.
  • Decompose a gene set into expression programs (gene-set row → ⋯ → Decompose into programs…). Genes that share a name need not share an expression pattern: the collagens are fibrillar, basement-membrane and cartilage programs under one label, and a mean or UCell score flattens them into one number. The modal first measures that — the eigen-spectrum of the set's correlation matrix, judged against the Marchenko–Pastur noise edge — and says whether one pattern carries the set or several stand above noise (with a suggested k). Then PCA or NMF on the cells × set-genes submatrix writes per-cell program scores as a score matrix (.obsm[key], so each program is a colour pill and the matrix doubles as an embedding), per-gene loadings in .varm, and one gene set per program; PCA programs are directional (up and down lists), exactly the format UCell scores.
  • Why the noise edge and not the Kaiser rule. At single-cell sparsity every pairwise correlation is tiny (mean |r| 0.009 for the collagens on the 24k-cell hindlimb) and dozens of noise eigenvalues sit just above 1, so "eigenvalues > 1" saturates at the cap. The largest eigenvalue independent genes produce by chance is (1 + √(g/n))²; only what clears it counts. On the hindlimb that gives 2 collagen patterns: PC1 the fibrillar collagens (Col1a1, Col1a2, Col3a1, Col5a1, Col5a2) and PC2 the basement-membrane collagens (Col4a1, Col4a2, Col15a1, Col18a1) against the fibrillar ones.
  • A smoothed layer can be decomposed instead of .X, which matters on sparse spots. New pure gene_set_decomposition.py and gene_coexpression.set_coherence (12 tests: planted two-pattern recovery for both methods, .obsm/.varm/registry state, scope, overwrite, readers, routes, codegen); POST /api/gene_sets/{coherence,decompose}, GET /api/gene_sets/decompositions[/{key}]; frontend/src/lib/geneSetDecomposition.ts (6 tests). Config namespace gene_set_decomposition:.
  • Cluster cells on a gene set (gene-set row → ⋯ → Cluster cells on this set…). PCA → neighbours → Leiden → UMAP on the cells × set-genes submatrix, so "what states does this tissue take with respect to these genes?" gets its own clustering without disturbing the dataset's X_pca, graph or leiden. Everything lands under suffixed keys (X_pca_<key>, <key>_connectivities, leiden_<key>, X_umap_<key>); the graph is registered the way scanpy does it, so the existing Leiden route can re-cluster it at another resolution through the graph picker; cells outside the chosen scope are labelled unassigned. Genes are z-scored first so a highly expressed collagen does not own PC1 by magnitude alone, and PCs and neighbours are clamped to what the set allows rather than failing. The results panel offers Color by clusters and Show UMAP. Default resolution is 0.3: a gene-set PCA fragments easily (33 collagen genes at 1.0 gave 100 clusters on 24k cells). DataAdaptor.prepare_cluster_cells_by_gene_set (6 tests including planted-population recovery, the stored graph re-clustered by run_leiden, and codegen), POST /api/gene_sets/cluster_cells. Verified in the browser on the E11.5 hindlimb: NABA_COLLAGENS over 24,172 cells produced a UMAP and clustering that became the active view in one click.
  • Cluster genes hands off to the Heatmap tab, on the same cells. The results panel now stays open for every method and offers Show heatmap: one row band per cluster, restricted to the cells the clustering ran on. A lasso selection travels as explicit indices, the toolbar says so ("3,000 selected cells"), and Heatmap Settings lets you drop the restriction. The Heatmap tab never sent cell_indices before, although the backend has accepted them all along.
  • Gene set library (Genes panel → Library, or ⋯ → Gene set library…). Browse and import gene sets from MSigDB (every collection, human and mouse, newest release), Enrichr (228 libraries: GO, Reactome, KEGG, WikiPathways, PanglaoDB, CellMarker, Tabula Muris, …) and STRING (interaction partners of seed genes). A library is downloaded once into ~/.cache/skopia/gene_set_sources and searched locally from then on, by set name or by member gene.
  • Every set is checked against the loaded dataset before import. The table shows how many members are present, how many of those are highly_variable / spatially_variable (any boolean .var column), and a threshold filter hides the rest — so "matrisome sets with at least ten HVGs in this tissue" is one query. Names match exactly first, then case-insensitively (a human-symbol library on mouse data, flagged Aa), and the imported set carries the dataset's own spelling and only the genes that exist in it.
  • Provenance travels with the set. An imported set records its source, library and version; the row tooltip shows it, and the browser marks sets already imported from that library.
  • Species is guessed from the data (Ensembl prefixes, else symbol case) and can be overridden. Enrichr libraries are tagged with their own species, so a human GO library still works on mouse data.
  • New pure backend/skopia/gene_set_sources.py (source adapters, cache, search; 21 tests), DataAdaptor.gene_set_overlap / guess_species (7), routes (7), frontend/src/lib/geneSetLibrary.ts (8). Config namespace gene_set_sources: (cache dir, catalogue TTL, STRING defaults). Verified in the browser on the 24,172-cell E11.5 hindlimb: the MSigDB mouse curated collection fetched live (984 sets), NABA_COLLAGENS 33 of 44 present with 19 highly variable, three matrisome sets imported in mouse spelling; STRING partners of Col1a1 and Sox9 imported with an unknown seed reported; PanglaoDB "Chondrocytes" 116 of 146 matched case-insensitively. Design and decisions: docs/superpowers/specs/2026-09-17-gene-annotation-resources-design.md.
  • Copy a gene symbol from the Genes pane. Every gene row — search and browse results, the members of a gene set, and a directional set's down genes — has a small ⧉ button that copies the bare symbol to the clipboard and flashes ✓. It is muted until the row is hovered but always present, because hover-only controls are hard to find in a long list. The click is isolated from the row, so copying never colours by expression or starts a drag. Where the async Clipboard API is unavailable (plain http on a LAN address) it falls back to the legacy select-and-copy path. New frontend/src/lib/clipboard.ts (3 tests); verified in the browser on all three lists against the real Clipboard API.
  • Downsample cells (Analyze → Cells → Downsample, and a Downsample… button on any selection). Keep a random subset of a group of cells — a count or a percent — and make it the selection. The sample is an ordinary selection, so Mask, Delete, Invert and Set Active apply to it like any lasso: thin a dominant cluster by lassoing it, downsampling, inverting, then deleting or masking the rest, leaving every other cluster intact.
  • The pool defaults to what is selected. Downsampling a whole dataset is the rare case; the common one is a cluster that swamps everything else. With nothing selected the pool is the active (unmasked) cells, then all cells.
  • Sampling is uniform, without replacement, and seeded. Blank draws a seed and reports it, so a sample can be reproduced. A target that would not thin the pool is refused rather than silently selecting everything.
  • Pure frontend/src/lib/downsample.ts (19 tests); no backend involvement. Verified in the browser on the toy dataset: 400 cells to 50 with seed 7, identical on a second run, Invert to 950 and Mask leaving 50 active; 10% of 1,000 selects 100.
  • Merge Spots: putting a large cell back together from the spots it covers (Analyze → Spatial → Merge Spots). A spot is a patch of tissue, not a cell. Where the cell is much larger than the spot — a hypertrophic chondrocyte against a Visium HD bin — one cell is spread over several spots, each holding a fraction of its transcripts, so every spot looks shallow and none is a usable profile of the cell that is actually there. Lasso the region, set a cell diameter, and neighbouring spots agglomerate until their footprint reaches one cell, with their counts summed.
  • The result is a new dataset in its own tab, never an edit. Merging creates rows that never existed, so every embedding, clustering and DE table computed on the originals would be stale — and there is no aggregation that is right for an embedding. The source stays open and comparable beside it.
  • Geometry decides which spots join; similarity only vetoes. The spots most worth merging are the low-count ones, which are exactly the spots whose profiles are least able to say whether they should merge — ranking candidate pairs by a correlation between two 40-count profiles gives a different grouping on every run. So the merge is driven by the diameter cap, which is stable and means something biologically, and correlation enters only as a floor that blocks a join across a clear boundary. The veto reads CPM+log1p profiles even though the merge sums raw counts: on raw counts any two spots agree, because both are dominated by the same few high expressors, and the veto never fires.
  • The veto's genes are yours to choose — a .var flag, a combination, or a gene set from the Gene Panel, through the same picker the line-association tools use. Correlation is computed on those genes' expression, not on a set score.
  • Preview before you commit, because min_correlation needs real data. The default run is a dry one: same route, same code path, no dataset created. It reports the measured spot pitch, the size distribution of the groups, how many pairs the veto blocked, and where the threshold sits in the distribution of candidate correlations — which is the number that says whether the veto is earning its place or is inert.
  • The merged dataset carries no derived numbers at all. Numeric and QC .obs are dropped rather than averaged or recomputed, and .obsm keeps only the spatial key holding the new centroids: a mean of per-spot scores is an approximation the summed counts cannot justify, and a UMAP from the original spots would still render for a merged row while meaning nothing. What survives is categoricals by majority vote, plus merged_n_spots, merge_group and merge_purity — the last being how a merge that crossed a boundary the veto missed becomes visible.
  • New pure module backend/skopia/spot_merge.py (28 tests), DataAdaptor.merge_spots (14), POST /api/spots/merge (8), and frontend/src/lib/spotMerge.ts (6). Verified in the browser on the bundled toy dataset: a 111-spot region merged to 40 spots at a 90 µm diameter, producing a 929-spot sibling (1,000 − 111 + 40) while the source stayed at 1,000; raising the veto to 0.9 blocked 71 pairs and collapsed the merge to 108 spots, with the preview correctly reporting that the threshold sat outside the bulk of the distribution. Design and decisions: docs/superpowers/specs/2026-08-28-st-spot-merging-design.md.
  • Find Associated Genes can run on a gene set (Shapes → Line Tools → Gene Association, and the multi-line version). The gene filter took boolean .var columns only — highly_variable, a species flag, whatever preprocessing left behind. A curated signature had no way in, which is exactly the case where restricting changes the answer: testing 40 genes rather than 20,000 corrects the FDR over 40, so a real gradient that dies under transcriptome-wide correction survives. Every set in the Gene Panel is now a pill beside the column pills, and several combine under the same AND/OR toggle. Verified in the browser on the bundled toy dataset: a 7-gene set with 4 absent genes tested 3, two sets unioned tested 13, two .var columns OR'd tested 56 — on the single line and on two lines pooled.
  • Genes the set names but the dataset lacks are reported, not dropped. Cross-species sets, older symbol vintages and earlier gene filtering all leave holes, and a run that quietly tested 3 of 7 genes reads exactly like one that tested all 7. The result now carries the subset it resolved to, so the modal leads with the count actually tested and says which names went missing.
  • Gene sets and .var columns are mutually exclusive. Narrowing a curated signature by highly_variable throws away the genes you came to test — and the backend cannot express the mix in any case, so clicking one kind clears the other rather than pretending.
  • Fixed: selecting two or more .var columns failed with HTTP 422. The request model took a column name or a gene list but not the {columns, operation} dict the UI sends the moment a second pill lights up, so the AND/OR toggle had never worked on either association route. A bad subset is now a 400 raised before the background task starts, which puts "No genes found matching AND of ['is_mesen', 'is_prim']" in the modal instead of failing a task after it has closed.
  • New frontend/src/lib/geneSubset.ts (16 tests) and a shared GeneSubsetPicker, replacing the subset UI both line modals had duplicated verbatim; 16 backend tests.
  • Stacked barplots (the Barplot tab). What is each group made of? One bar per category of one .obs column, split by the proportions of another — clusters by territory, clusters by section, cell type by sample. Bars can be proportions (every bar the same height, so composition is comparable across groups of very different sizes) or cell counts (sizes stay visible).
  • Colours come from the data. A column with uns['<column>_colors'] is drawn in exactly those colours, scanpy's convention, so a territory is the same red here as it is on the spatial plot. Anything without stored colours gets the app's generated palette.
  • Ordering is where the plot answers a question. Bars sort by the dataset's own category order, by name (numeric-aware, so cluster 9 comes before cluster 10), by size, or — the useful one — by how much of each bar is a category you pick. Sorting 26 clusters by their share of one section turns a wall of bars into a gradient. Groups below a cell-count threshold can be dropped, and the header says how many were.
  • Every cell is accounted for. Cells with no value for the stacking column are counted into an explicit (none) block rather than dropped: a bar that silently sums to 0.9 looks exactly like one that sums to 1. Territories leave a cell blank whenever it has no coordinate, which is common and not an error.
  • New GET /api/obs/crosstab and DataAdaptor.crosstab() (15 backend tests). A continuous column is refused with an explanation rather than binned behind your back. The config is per-dataset, like every other thing that names an .obs column.
  • The workspace comes back. A refresh used to leave you with one dataset. The backend still held the others — the frontend only ever asked for the active slot — so they occupied memory while being invisible and unreachable. On startup skopia now asks what is loaded and restores every one of them, along with the tab order, any names you typed, whether you were tiled, and the pane sizes you dragged. Only the arrangement is stored locally; the datasets come from the backend, which already had them.
  • Panes grid up once a row would be too thin. Two or three datasets stay side by side, as before. Four or more square off — 4 becomes 2×2, 6 becomes 2×3, 9 becomes 3×3 — which for four datasets is the difference between four 210px slivers and four 420×357 panes. Dividers run between whole columns and rows, so a drag resizes a track and every pane in it, and both axes now drag: measured in the browser, +120px on a column divider moved the boundary exactly 120px and −80px on a row divider exactly 80px, with the rest of the grid untouched.
  • Tabs drag to reorder, and double-click to rename. Reordering the tabs reorders the panes, because tab order is pane order. A name you type replaces the filename until you clear it; Escape abandons the edit.
  • Every visible pane loads its own coordinates. Only the active dataset ever fetched them, which was invisible while tiling was something you turned on by hand — but a restored tiled workspace comes back with every pane on screen, and all but one would have read "No embedding loaded" until you clicked its tab.
  • More than two datasets, with tabs (above the plot, once a second one is loaded). skopia held exactly two datasets, called Primary and Secondary, chosen from a two-option dropdown. It now holds as many as you load, each named after its file, each a tab: click to make it the one the panels act on, × to close it, + to open another. Split tiles every loaded dataset side by side rather than exactly two. Verified end to end with three at once — a 1,000-cell toy, a 24,172-spot E11.5 hindlimb, and a 4,281-cell 10x .h5 — loaded, tiled, resized, and closed through the UI, with the store and GET /api/datasets agreeing at every step.
  • The backend never needed changing. It has always kept adaptors in a dict keyed by an arbitrary string, and DELETE /api/datasets/{slot} has existed all along with nothing calling it. The two-dataset ceiling was a frontend type and a pane written out twice, both removed in the groundwork below.
  • Panes resize by dragging the divider between them, which is now a real element rather than the border the left pane used to draw on its own edge. A drag trades width between exactly the two panes it separates, so the rest of the row does not move — measured in the browser: dragging 100px took one pane from 277px to 376px and its neighbour to 179px while the third stayed at 277px. Double-click a divider for equal widths. Neither pane can be squeezed below 120px.
  • Datasets are named by their file, not by their slot: E11.5_hindlimbs_102424_skopia_qced rather than "Secondary". Slot keys stay internal — primary has to keep its name because appendDataset() omits ?dataset= for it — and a freed key is reused rather than climbing forever.
  • Closing a dataset asks first and frees the backend's copy. Everything computed on it in that session goes with it, which reloading the file does not bring back. The last loaded dataset cannot be closed; closing the one you were looking at lands you on its neighbour. With one dataset the tab strip disappears, since there is nothing to switch between.
  • Design and the decisions behind it: docs/superpowers/specs/2026-08-22-n-dataset-ui-design.md.
  • Territories: hand-drawn regions that travel with the data (Analyze → Spatial → Define Territories, then Assign Territories). Define Sections already lets you lasso a region, name it and label the cells — but it throws the polygon away, so the boundary cannot be edited, re-applied, visualized, or carried anywhere. Territories make the geometry the artifact: named regions saved in uns['skopia_territories_json'], drawn over the spatial plot, used to annotate cells by occupancy, and transferable onto dissociated cells through Localize. Verified on the real three-section E11.5 hindlimb: assignment labelled 9,145 cells in the section that was drawn on (3,233 proximal / 5,912 distal) and left 15,027 in the two that weren't — 7,981 + 7,046, exactly their cell counts.
  • You draw the dividing cuts; skopia derives the regions between them. That one decision is what makes neighbouring territories share a boundary exactly: a cut is a single object referenced by both of its neighbours, so dragging its vertices moves both in the same frame. Overlaps and gaps are not detected and repaired — they cannot be represented. Cuts are arbitrary freehand or click-placed curves (the existing draw tools, with smoothing), and a closed cut is an island, which is how a region like the AER is drawn inside distal. Ends are extended along their own direction to the boundary, so a cut that stops short of the tissue edge still divides.
  • Names attach to points, not to regions. Naming a region drops an anchor inside it, so after you move a boundary each region takes the name of whichever anchor it now contains — labels survive editing with no bookkeeping. The section's outer boundary is a padded bounding box of that section's cells, frozen when you start: recomputing it would let a later cell filter silently shift a saved boundary.
  • A territory is a multi-polygon. Sections sit side by side in one coordinate space, so "proximal" is drawn once per section and stays one label. Each cut is filed against the section it was drawn across, not whichever the panel had selected — on a side-by-side slide those differ constantly, and a cut filed against the wrong section divides nothing while looking like a drawing failure.
  • Assignment writes one .obs column per type (territory_prox-dist), plus an optional combined column crossing two or more (territory_prox-dist__ant-post, values proximal|anterior). The combined column is text only — nothing needs grid geometry, so none is built. Two empty states are kept distinct on purpose: blank means the cell has no coordinate, unassigned means it has one and sits outside every territory.
  • Localize can import the reference's boundaries and assign in one run. The geometry is copied in against the predicted embedding — geometry drawn on the reference's coordinates is only meaningful over the query's predicted ones — and stamped imported:<file>@<date> so a later reader can tell borrowed regions from drawn ones. Every cell that got a coordinate is labelled; cells that could not be placed are left blank, with no confidence filter, since localize_confidence already sits beside the result. Verified by localizing 47,272 forelimb cells onto the hindlimb reference: 7,415 proximal, 9,088 distal.
  • New pure module backend/skopia/territories.py (shapely noding + polygonize, 18 tests) and frontend/src/lib/territoryGeometry.ts (19 tests); POST /api/territories/faces is deliberately stateless, since the drawing panel calls it on every edit. Design and plan: docs/superpowers/specs/2026-08-21-territories-design.md.
  • Smooth: choose what happens after averaging (Analyze → Preprocess → Smooth → "After averaging"). Averaging does not commute with the log, so which matrix you smooth changes what the stored numbers mean, not just their scale. Smoothing a log-normalized matrix averages logs, and the mean of logs is not the log of the mean: measured on E11.5 limb ST data, a smoothed log layer sits 70–83% below log1p of the smoothed expression, the gap widening with expression level. The ordering survives — so a heatmap still looks right — but the values are no longer on the scale they claim, and anything comparing them against unsmoothed values or a threshold is wrong by roughly 5×. That was skopia's default path, since Smooth defaults to .X and .X is usually log-normalized.
  • The new option applies none (unchanged), cp10k, or lognorm to the smoothed matrix, which makes the recommended pipeline — average counts, normalize, then log — a single step. It was not expressible in skopia at all before: Normalize Total and Log1p can only write .X, never a layer.
  • Held-out molecular cross-validation says counts win. Binomial-thin the counts, smooth one half, score the other by Poisson deviance (Batson & Royer 2019); the spatial graph comes from coordinates alone so it cannot leak. On 25,934 spots × 2,000 genes sampled evenly across the expression range, smoothing is worth 34–67% of the deviance, and among transforms counts → smooth → normalize wins at every setting, its margin widening as smoothing strengthens (+0.6% over log at k=10×1, +3.1% at k=20×2, where sqrt is 13% worse). Averaging counts weights each neighbour by its depth, which is the Poisson-optimal weighting; the theoretical worry that this imports a depth gradient does not materialise — the counts advantage grows in neighbourhoods with more heterogeneous depth. The one exception: on the lowest-expressed third of genes, log and sqrt smoothing are marginally better.
  • The panel says which case you are in, reading the source matrix's detected scale: a warning with the numbers when it is on a log scale, confirmation when it is counts. The layer's provenance now records the transform too, so a smoothed layer can still say what it holds a month later. Full measurement, including the Localize half: docs/measurements/2026-08-21-smoothing-transform.md.
  • Localize: pick the expression matrix on each side (Analyze → Spatial → Localize → "Source matrix"). The backend has always accepted a layer per side; nothing surfaced it, so every run read .X on both. Reference and query are chosen independently — a spatial reference smoothed over its own spatial graph, matched against an unsmoothed dissociated query, is the case worth running — and each picker is labelled with the scale skopia infers for that matrix, with the badge that explains the call.
  • Smoothing the reference is worth much more than the transform used to smooth it. Held out 3,000 spots of an E11.5 hindlimb as a stand-in query and predicted them from the other 22,934, with the smoothing graph built on reference spots only so no held-out counts leak in. Smoothing roughly triples the share of query spots placed within 10% of the tissue radius (2.3% → 7.9%), with returns flattening after about k=20 × 2 steps. Whether the reference was smoothed on counts or on an already-log layer lands within noise, because Localize z-scores each dataset per gene and absorbs the difference. Absolute accuracy is low on this tissue — limb mesenchyme is largely homogeneous, so most cells genuinely cannot be placed — which is why the comparison is relative.
  • Cross-validate deliberately overrides the layer to the reference's: it holds out part of the reference and predicts it from the rest, so it is the control for "would smoothing this reference help my tissue".
  • New advice fires only where the choice bites — a scale mismatch when the transform is none, z-scoring a linear count matrix (heavy tails let a few cells dominate each gene), and the fact that rank makes the log-versus-linear choice irrelevant. Confirmed the last one by measurement: with transform='rank', raw counts and log-normalized give bit-identical predictions.
  • Neighborhood: a clustered heatmap, and results you can take away (Analyze → Spatial → Neighborhood). The types × types matrix arrived in the label column's own category order, which scatters co-locating types wherever the alphabet puts them and hides the block structure the analysis exists to show. Types are now ordered by hierarchical clustering of their neighborhood profiles, with a dendrogram over the shared row/column order. On a real 32-cluster E11.5 hindlimb the blocks are immediately readable.
  • The clustering parameters are surfaced, preset. Distance and linkage change what the blocks look like, so the choice belongs to the user — but it arrives as correlation distance (compares profile shape, ignores abundance) with average linkage, clustered on the enrichment matrix, and can be switched back to input order. Ordering is held by the modal rather than the results view, so toggling Enrichment/Composition no longer reshuffles the heatmap under you.
  • Three exports, all in the order shown: the full statistics table as long-form CSV (one row per ordered pair, with composition, expected, pair count, z, log2FC, p and q — the shape R and pandas want), the displayed matrix as CSV, and the figure as a standalone SVG that opens in Illustrator.
  • New tested libs: hclust.ts (Lance-Williams agglomerative clustering with the cheap half of optimal leaf ordering), neighborhoodExport.ts (RFC-4180 quoting, so a cell type called "Fibro, distal" does not shift every column), svgExport.ts.
  • Sort a gene set's genes (Gene Panel → a set's ⋯ → "Sort genes A→Z"). Case-insensitive and numeric-aware, so Hoxd2 precedes Hoxd10 — lexicographic order gets gene families visibly wrong, and families are most of what these sets hold. A pure reorder: membership is preserved and a directional set's DOWN list is sorted alongside its UP list.
  • Highly variable genes, per data split (Analyze → Preprocess → Highly Variable Genes → "Detect within groups of"). Pooled HVG detection on a multi-sample dataset finds genes that vary between samples as readily as genes that vary within them, so a batch effect scores as biology. Point this at a categorical .obs column — sample, section, donor — and detection runs inside each group separately, writing highly_variable__<group> per group, with optional union (variable in any group) and intersection (variable in every group) columns. On three real E11.5 hindlimb sections: 4,000 HVGs each, union 7,530, intersection 1,030 — only a quarter of each section's variable genes are variable in all three, which is the number that should decide whether you feed pooled HVGs into a multi-sample analysis. The intersection is the conservative input for NMF meta-programs; the union is the inclusive one for integration.
  • The pooled highly_variable column is never touched by a split run, and no pooled column is invented if none existed — every gene-subset dropdown in skopia points at that name, and quietly redefining it would change what unrelated analyses mean. The new columns appear alongside it in the Gene Panel's .var columns list, each one materializable as a gene set.
  • Groups below min_cells_per_group (default 10) are skipped and named in the result rather than contributing a noisy answer; .obs categories no cell uses any more are ignored; and subset=True together with a split is refused outright, since there is no honest single gene set to subset to — run the split, then subset on the union or intersection.
  • The result says what happened instead of "Completed successfully": "HVGs per section: A 4,000, B 4,000, C 4,000 · union 7,530, intersection 1,030. Pooled highly_variable left unchanged."

Fixed

  • 10x matrices whose gene list is a gzipped genes.tsv.gz would not load. GEO keeps Cell Ranger v2 output as it was submitted — GSM…_matrix.mtx.gz, GSM…_barcodes.tsv.gz, GSM…_genes.tsv.gz — and scanpy's read_10x_mtx recognises exactly two layouts by file name: uncompressed matrix.mtx + genes.tsv (v2) or gzipped matrix.mtx.gz + features.tsv.gz (v3+). A gzipped genes.tsv.gz fits neither, so scanpy went looking for a features.tsv.gz that did not exist and the load died with FileNotFoundError. skopia now reads the three files itself: each file's compression and the genes/features name no longer have to agree, and the feature file's column count says which vintage it is. Applies to prefixed GEO trios and to CellRanger folders alike, and keeps scanpy's conventions (symbols as var_names, ids in var['gene_ids'], only Gene Expression rows from a v3 features file) so gene names match earlier loads. Verified on GSM5059814 and GSM5059815 (E11.5 whole limb, 5,595 and 5,761 cells × 28,001 genes); 5 new tests in test_load_10x_mex.py cover gzipped v2, mixed compression, the legacy folder, and v3 feature-type filtering.
  • Closing the dataset you loaded first broke the rest of the session. Every request came back 503 No data loaded for slot 'primary' while two datasets sat healthy in the backend — the message reading as "nothing is loaded" when the truth was "you asked for the wrong one". activeSlot starts life as the literal string primary; nothing on the restore path ever moved it, and appendDataset() omits ?dataset= for primary, so "no slot named" and "primary" are the same request on the wire. The whole app addressed a slot that was not there.
  • The active slot is now repaired against the backend's own list, after the tab order is restored and in a finally, so a failed restore still releases the app. It trusts that list rather than the store, because primary's schema arrives on its own path and the store briefly shows it as unloaded when it is not.
  • Startup fetches wait until the slot is known. They fired on mount, before the restore's round-trip could answer, and GenePanel's var-identifier fetch runs once — a 503 there left gene-symbol switching empty for the rest of the session. Measured on a real page load with no primary: 8 failed requests before, 0 after, with the identifier columns populated either way.
  • A 503 for a missing slot now names the slots that are loaded. "No data loaded for slot 'primary'. Loaded: slot3, slot4." — the version without that list is what sent this bug's first diagnosis down the wrong path.
  • Verified in-browser across three arrangements: no primary (repairs to the first loaded slot), primary alone (unchanged), and primary plus two others (unchanged, all three restored) — zero failed requests in each.
  • Localize could not be pointed at the datasets you meant. With two spatial and two dissociated datasets loaded, Reference was pinned to whichever spatial dataset was loaded first and the second pair was unreachable. Reference and Query were read-only text; the only control was a swap button that, whenever the query had no coordinates, silently did nothing at all — it set a preference assignRoles then discarded, and it rendered whenever two spatial datasets existed rather than when swapping could actually succeed. Both roles are now dropdowns: Reference lists the datasets that have coordinates, Query lists everything else. Today's derivation stays as the default, so the two-dataset case needs no clicks.
  • The default query is dissociated cells, not the other tissue. Loading spatial, spatial, dissociated, dissociated used to make the second spatial dataset the query — the one arrangement where the derived pair is never what was meant.
  • Roles were written for a two-slot world (localizeRoles.ts still says so) and were not revisited when N datasets shipped on 2026-08-22.
  • Localize reported "No dataset is loaded" with datasets loaded, once you closed the one you had loaded first. GET /api/localize/suggest resolved the query adaptor on its first line, and an unnamed query means the literal slot primary — precisely the key freed by closing the first-loaded dataset. The call 503'd, the slot list never populated, and the modal blamed the arrangement. The reference list is now built before any query is resolved, and suggested_k is null rather than guessed when there is no query to take a root of. Nothing loaded at all is still a 503, like every other route.
  • Reproduced and verified end to end on four datasets: picking the second pair and running wrote .obsm['X_spatial_pred'] into that pair's dissociated dataset and left the first pair's untouched; after closing the first pair and hard-refreshing, the modal came back on the remaining pair instead of claiming nothing was loaded.
  • Not fixed, and worth knowing: get_adaptor(None) resolves to the literal slot primary for all 136 routes that take dataset=None, so closing your first-loaded dataset still 503s any caller that names no slot — observed on /api/schema, /api/var/boolean_columns, /api/var/identifier_columns, and /api/scanpy/prerequisites/find_similar_genes (which polls every 5s).
  • Heatmap group labels are readable again, and its legends move. The cluster labels under a heatmap were truncated by the width of the column they sat under, which left two or three characters each once a heatmap had thirty clusters — and then drew them running up and to the right, over the matrix and across each other. They now run down-left into the space reserved for them, ending at the group they name, sized by the room that space actually has; a group too narrow to hold a line of text is left to its separator line rather than smeared over its neighbours. Both legends — the colour scale and the gene-set key — are now the same draggable, collapsible panels as the scatter plot's, and remember where you put them.
  • A third dataset was given the built-in display defaults, not yours. applyConfigDefaults wrote the display: section of the user config into the slots named primary and secondary, so any dataset beyond the second silently ignored your configured point size, colormap and the rest. It now writes to every loaded slot.
  • Five more pieces of state stopped following you between datasets. The Compare fix below named the pattern; this is the audit that went looking for the rest of it. The one that returned a wrong answer rather than an empty one is which principal components you are looking at: the chosen .obsm columns were stored per embedding name, and X_pca is a name both datasets have. Choose PC3 vs PC5 on one dataset and the other was silently projected the same way — or asked for a column its own X_pca does not have. Also now per-dataset: the Marker Genes column, the ticked category checkboxes in the Cell Manager (two datasets both having a leiden with categories 0,1,2 is the ordinary case, so ticks carried across look deliberate rather than stale), and the line-association table, which is a statement about one line drawn on one dataset in the same way the DE table is.
  • The invariant is now checked rather than remembered. The flat top-level store fields are a cache of the active dataset's state; a field present in both that the sync function forgets keeps showing the previous dataset's answer and looks entirely normal doing it — no type error, no crash. The test now derives the set of mirrored fields from the two objects themselves and asserts every one follows a slot switch, so adding a field forces the question. What stays global is written down beside the declaration with the reason each is safe: a label column that only draws when the coloring matches it, a line id that matches nothing elsewhere, a figure that composes panels across datasets on purpose.
  • Compare works on the secondary dataset. Three separate features named "Compare" kept dataset-scoped state in global store fields, so switching the active slot carried the previous dataset's state along with it.
  • Differential expression ran on the wrong cells, silently. Comparison groups are cell indices into one matrix. Set them on a 4,212-cell primary, switch to a 9,145-cell secondary, and the Comparison bar stayed populated with the Compare button live — every index still in range for the larger matrix, so the run returned a confident answer about arbitrary secondary cells rather than an error. In the other direction the indices ran off the end of the smaller dataset. Groups, and the DE table they produce, now belong to the dataset they were drawn on.
  • The ◫ Compare split view died on a slot switch and could not be revived. The second pane's embedding is a dataset-local name, so pointing it at something only the primary has — neighborhood_composition, a derived X_pca_noPC1_2_3_4_7 — and switching slots left the pane blank. Toggling Compare off and on did not help, because the stale name was non-null and only a null one was ever re-picked; and the pane's own embedding picker renders inside the pane, so there was no control left to fix it with. Each dataset now remembers its own second embedding, and a name the active dataset does not have is replaced with one it does.
  • Compare Cells kept a column that only the other dataset had. ScanpyModal renders null when closed rather than unmounting, so its column pick and ticked categories survived a slot switch, and handleCompareRun closed over a stale activeSlot.
  • comparison, diffExpResult, secondEmbedding and secondEmbeddingData moved into DatasetState and travel through syncFlatFields like every other per-dataset field. Why this class of bug is worth naming, and what it implies for loading more than two datasets: docs/measurements/2026-08-22-more-than-two-datasets.md.
  • Layer scale detection no longer 500s on deep raw counts. GET /api/scanpy/layers failed with "Out of range float values are not JSON compliant" on a real counts dataset, and because every layer picker swallows that failure and falls back to a bare .X, the symptom was a silently missing scale description rather than an error. The classifier's "could this be log-transformed?" check undoes log1p and looks for constant row sums; its overflow guard was elementwise, but the row sums overflow far sooner and the squares inside the standard deviation sooner still. The guard is now tied to what a log scale can actually look like (log1p of a millionfold count is under 14), so past that the hypothesis is refuted and the check is skipped rather than computed into infinity.
  • A stored gene-set payload missing a category no longer takes down the Gene panel. The backend gene-set store round-trips whatever the frontend last sent without interpreting it, so a payload written by an older build can arrive without a category that exists now. Hydration assigned it straight over geneSetCategories, and the panel — which walks a fixed category order — then read .geneSets off undefined and crashed, along with MultiContourModal, with no error boundary above either. Hydration now merges onto the defaults instead.
  • New boolean .var columns appear without a page reload. The Gene Panel's .var columns list fetched once on mount and never again, so any column written after load — highly variable genes, spatial autocorrelation, Add boolean column — stayed invisible until the tab was reloaded. It now re-fetches whenever the schema is replaced, which is the refresh every one of those operations already triggers.
  • Combine: choose which columns survive, and what happens to a collision (File → Combine datasets…). Combining used to keep whatever .obs columns every input happened to share, merged into one column each, and take .var from the first dataset — silently. The dangerous case is a name collision that is not a value collision: two datasets each carrying seurat_clusters from independent clusterings, where cluster 3 in one has nothing to do with cluster 3 in the other. Pooling those into one column invents a comparison nobody made. Every .obs and .var column is now listed before you commit, with which datasets carry it and what will happen to it: one column (values pooled), one per dataset (name__label, empty for the other datasets' cells), or drop. Verified on two real E11.5 limb sections — hindlimb and forelimb, 71,444 cells combined — where the picker kept seurat_clusters and SCT_snn_res.0.2 apart as __hind/__fore while merging nCount_RNA, percent.mt and log_umi, exactly as it should.
  • The defaults are the safe reading, and they say why. A per-cell measurement means the same thing in every dataset, so it merges; a categorical, a string, or a low-cardinality integer (≤50 distinct values — clusters stored as ints are still clusters) does not, so it stays apart. A column only one dataset has can't collide, so it merges under its own name. Each suggestion carries the sentence explaining it, shown on hover, and any column you move off its suggestion is outlined in amber.
  • .var is decided by comparing values, not guessing. Genes are the intersection, so the same column in two datasets annotates the same genes — which means skopia can just check. Identical everywhere (gene_symbol, name) → one copy; disagreeing (highly_variable, moranI) → one per dataset. The comparison is made over the shared genes only, since the rest are dropped by the combine anyway and disagreement outside the intersection is not a reason to split a column.
  • Reading the columns does not read the matrices. POST /api/combine/columns opens each h5ad backed and takes .obs/.var alone — 0.25 s for a 47,272 × 36,596 and a 24,172 × 12,236 dataset, so the picker is populated before you have finished reading the file list.
  • Split names never overwrite an existing column (a dataset that already has x__A keeps it; the split of x becomes x__A_1), sample is always written whatever the policy says, and the resolved policy — including every default skopia filled in — is recorded in uns['skopia_combine'], so the combined object says what was done to it. A policy naming a column no input has is a 400 rather than a silent no-op, because a typo that quietly drops a column is how you lose one without noticing.
  • NMF meta-programs: the gene programs that recur across samples (Analyze → Genes → NMF Meta-Programs). The multi-sample half of GeneNMF — multiNMF + getMetaPrograms. A single factorization cannot tell a real gene program from a batch effect, because it only ever saw one pooled matrix. This factorizes each sample separately at every rank in a sweep (default k=4–9), then clusters all the resulting programs by gene-weight similarity into consensus meta-programs, and scores each by sample coverage — how many samples it turned up in independently. On three real E11.5 hindlimb sections, 3 samples × 6 ranks = 117 factorizations in 1.9 s, consolidated into 8 meta-programs: clean primitive erythroid (Hbb-bh1/Hba-x/Slc25a37/Slc4a1/Hemgn), ECM (Col1a1/Col1a2/Postn/Lum/Dcn), chondro-myogenic (Sox9/Col2a1/Myog/Tnnt1), and a distal Hoxd11/Hoxd13/Grem1/Cyp26b1/Hand2/Lmx1b program at 1/3 coverage — present in one section only, because the sections cut at different proximodistal levels. Each meta-program becomes a gene set plus a per-cell score in obsm[key], registered as a score matrix so it colors like any pill; "Save all as gene sets" sends them to the Gene Panel. POST /api/gene_nmf/meta/run (202 + task), GET /api/gene_nmf/meta/{result,runs,columns}; 51 backend tests.
  • A similarity heatmap that shows whether a consensus is real. GeneNMF's plotMetaPrograms: every program against every other in dendrogram leaf order, each meta-program outlined as a block on the diagonal (canvas, so 117×117 renders instantly). A bright tight block is a genuine consensus; a dim one that bleeds into its neighbours is not — and the run's silhouette says the same thing numerically. On the limb data MP6 came back at silhouette −0.05, and the heatmap shows exactly why: a diffuse middle region where 30 programs cluster only because they had nowhere else to go. The UI labels that meta-program as a leftover cluster rather than pretending it is a finding. A composition tab counts each sample's programs per meta-program, so a row concentrated in one column reads as sample-specific at a glance.
  • These defaults are the opposite of the single-sample tool's, and the measurement is why. The single-sample path had to drop specificity_weight from GeneNMF's 5.0 to 1.0 because on one factorization the exponent piles a program's whole mass on one gene. That reasoning does not carry over: the meta-program consensus averages gene weights across every program in a cluster before the cutoff, which is precisely the smoothing the single-sample path lacks. So 5.0 survives here — but only paired with weight_explained raised 0.5 → 0.8, since after weighting the surviving genes hold most of the mass. Measured across the full grid on three real sections: (5.0, 0.5) kills two of eight meta-programs and leaves the rest holding ~7 genes; (5.0, 0.8) keeps all eight at usable size with the best marker purity of any setting tried (0.72 against 0.56 at spec 1.0). Full grid: docs/measurements/2026-08-19-gene-nmf-metaprogram-defaults.md.
  • Specificity is scored within a factorization, not across the study — "how exclusive is this gene among this model's own factors". Pooling would make a gene's score depend on how many samples happened to be included, penalizing exactly the recurrent programs the tool exists to find, and penalizing them harder with every sample added. Likewise the consensus takes an outlier-trimmed mean across a cluster's programs, so one runaway program cannot carry a gene into the meta-program (3σ trimming can only fire at ≥12 programs per cluster, since max |z| is (n−1)/√n — the tests pin both rules where the planted fixture cannot reach them).
  • Empty .obs categories are ignored, samples below min_cells are skipped and reported by name, and a rank larger than a sample's cell or gene count is dropped rather than failing the whole sweep.
  • NMF gene programs: the overlapping states clustering can't separate (Analyze → Genes → NMF Programs). Gene clustering partitions — one gene, one module, one cell, one cluster — which is the wrong shape for cycling, hypoxia or interferon response, states that ride on top of cell identity and share genes with it. This factorizes expression into k additive non-negative programs (X ≈ H · Wᵀ): a gene can carry weight in several programs, and each cell mixes them. Each program comes back as a ranked gene set and a per-cell usage score written to obsm[key] and registered as a score matrix, so a program is colorable as a pill exactly like a UCell score, and the matrix doubles as a k-dimensional embedding. "Save all as gene sets" drops the programs into the Gene Panel as a folder, ready for scoring, contouring or spatial work. Gene loadings persist to varm[key_loadings] the way PCA stores varm['PCs']; the full run (params, gene sets, weights, metrics) goes to uns['skopia_gene_nmf'][key] as plain dicts so it survives an h5ad round trip, and reopening the tool shows the stored run rather than recomputing. A Python port of the single-sample path of GeneNMF (Andreatta & Carmona) — runNMF + getNMFgenes — in backend/skopia/gene_nmf.py, pure NumPy/SciPy, 34 tests. Verified in the browser on a real 24,172-cell × 12,236-gene E11.5 hindlimb section: at k=12 it recovers the distal Hoxd13/Hoxd11/Grem1/Cyp26b1 domain, a Sox9/Col2a1/Shox2 chondrogenic condensation, Col1a1/Col1a2/Postn connective tissue, a Mki67/Cenpe/Birc5 cell-cycle program, primitive erythroid Hba/Hbb, and proximal Meis1/Pbx1/Hoxc10.
  • It is roughly as fast as the C++ it is ported from. The kernel is fast-HALS (Cichocki & Phan), and its two sparse products per iteration are ~95% of the runtime — SciPy releases the GIL inside them, so they are split across a thread pool over disjoint row blocks: 250k cells × 2k genes at k=20 in 8.8s, against 48s for scikit-learn's mu and 377s for its default cd solver, at an equal or better residual (on the real limb data, 0.90687 vs sklearn cd's 0.90670, in 2.5s vs 6.5s). Row blocking is exact rather than approximate — the same rows reduce in the same order whatever the thread count — so a run is reproducible bit-for-bit across machines, which a seeded factorization has to be. Sparse input is never densified; a 250k-cell matrix would be 4 GB dense.
  • The scaling convention is load-bearing, not cosmetic. Output follows RcppML's L1 diagonalization (A ≈ W·diag(d)·H, columns of W on the unit simplex, factors sorted by decreasing weight) because the gene-selection step compares each gene's loading across programs — an unnormalized factor would look artificially specific and hijack every program.
  • The specificity weight defaults to 1.0, where GeneNMF uses 5.0, and that difference is the whole feature working or not. The weighting scores each gene by spec^w, where spec is the largest share any one program takes of that gene's loading. On real data almost nothing is exclusive — measured specificity percentiles on the limb run were [0.16, 0.21, 0.27, 0.36, 0.57] — so at w=5 the spread becomes ~600×, one gene ends up holding 60–98% of each program, and the cumulative-weight cutoff then keeps nothing: 4 of 12 programs survived, median 4 genes. GeneNMF gets away with 5 because it only ever applies this to the averaged consensus of many programs (getMetaPrograms), which smooths the distribution first; the single-sample path has no such averaging. At w=1, 11–12 of 12 survive and the programs are visibly sharper than with no weighting at all (the distal factor leads with Hoxd13/Hoxd11 rather than Stip1/Sulf2). Measurements and the full sweep: docs/measurements/2026-08-19-gene-nmf-specificity-weight.md.
  • The source transform follows the layer's detected scale. Every other gene-expression path in skopia defaults to normalize_total + log1p, which on a matrix that is already logged silently factorizes log(1 + log(1 + counts)) — and NMF is more sensitive to that than coloring is, because the extra compression flattens exactly the high-expression differences the factors are built from. The tool reads the scale skopia already detects and picks the default from it, saying so inline ("This matrix is already on a log scale, so it is fed to NMF as-is"); a raw counts layer still gets log1p. Pure, tested module (src/lib/nmfTransform.ts, 9 cases).
  • Multi-sample meta-programs (multiNMF/getMetaPrograms) are deliberately not here yet — that is GeneNMF's other half, for finding programs recurrent across samples and across k, and it is worth doing only once the single-sample programs prove useful on real data.
  • Combine accepts every format Load does (File → Combine datasets…). Combine used to demand .h5ad of every input while File → Load happily opened 10x .h5, Visium HD feature_slice.h5, Seurat .rds, 10x CellRanger matrix folders, and GEO-style *_matrix.mtx(.gz) file trios — so combining a fresh CellRanger run with an existing h5ad meant a manual conversion first. The constructor's format-sniffing now lives in one shared load_dataset_file() used by both paths, so every loadable format combines, in any mixture, with the same spatial-vs-concat behavior as before. .rds inputs go through the same R-based conversion as Load. Default sample labels are the bare dataset name (folder name, trio prefix, or filename without extension — demoB.h5 → demoB). The file picker in Combine mode now accepts all of these too, and the 8 new backend tests build real 10x .h5 and matrix-folder fixtures to pin the loader (combine_h5ads is now honestly named combine_datasets). Verified in the browser by combining an .h5ad with a CellRanger .h5 into one 500-cell dataset.
  • Cell-type neighborhoods: who lives next to whom, and is it more than chance? (Analyze → Spatial → Neighborhood). For a chosen categorical column (clusters, cell types), builds a spatial kNN graph (default k=10, Schürch-style windows; radius mode available), computes each cell's neighbor-type fractions, and tests every pair of types for co-location against a label-shuffling permutation null (histoCAT / squidpy nhood_enrichment-style, so enrichment can't be driven by a type merely being abundant) — z-scores, empirical two-sided p-values, and BH q-values, 1000 permutations in seconds even on large data (O(edges) pair-counting per permutation). Results render as a types × types heatmap with two views: Enrichment (z) — dark-neutral at z=0, coral = together more than chance, blue = less, dot = q < 0.05 — and Composition — what fraction of a type's neighbors each other type is (rows sum to 100%; directional, so an infiltrating type reads differently from its host). Hover any cell for z, q, observed vs expected %, and pair counts; axis swatches reuse the exact cluster colors from the scatter plot. Per-cell fractions persist to obsm['neighborhood_composition'] and register as a score matrix, so "fraction of muscle in this cell's neighborhood" becomes a colorable pill like any score — the intended workflow for annotating ambiguous mesenchymal clusters by company kept. With a section column, edges never cross sections and labels shuffle within them. Pure module (backend/skopia/neighborhood.py, 13 tests with a planted checkerboard geometry whose answer is known), adaptor + routes (12 tests), pure viz helpers (src/lib/neighborhoodViz.ts, 11 cases); full flow verified in the browser on the 6-type toy dataset, including prior-result reuse on reopen.
  • Compare: two embeddings of the same dataset, side by side (◫ Compare in the toolbar). One dataset, two geometries: the tissue on the left, the expression manifold on the right — or any pair of embeddings, each pane with its own camera and its own embedding picker. The second pane defaults to the complement of what you're looking at (spatial shown → UMAP offered, and vice versa). Selection is one selection: lasso a cluster in the UMAP pane and those same cells light up at their tissue positions in the spatial pane, and the other way round — verified in the browser with a 211-cell lasso crossing panes. Coloring, expression overlays, and highlights are shared the same way, because the cells are the same cells. The µm scale bar knows which pane shows real coordinates and appears only there. Draw and Adjust act on the first pane's embedding and are inert in the second — a line drawn on a UMAP must never render on the tissue. Distinct from the existing dual-dataset Split, which shows two datasets; Compare shows one dataset twice. The default-companion choice is a pure, tested module (src/lib/pickSecondEmbedding.ts, 4 cases).
  • Combine works on any datasets that share genes, not only spatial sections (File → Combine datasets…). The combiner used to demand obsm['X_spatial'] of every input — stricter than the rest of the app, which also accepts the spatial convention and an explicit uns['skopia_spatial_key'] — and refused everything else. It now chooses by what the inputs carry: all spatial → the existing side-by-side section layout; anything else → plain row concatenation with no geometry invented, keeping the .obsm arrays every input shares (a common X_pca, say) so the combined dataset opens with a usable view instead of a blank one. Either way: gene intersection, a sample categorical column, collision-safe cell names, and uns['skopia_combine'] recording the mode and labels. Endpoint is now POST /api/combine (/api/combine_spatial remains as an alias); the previously untested combiner gained 7 backend tests pinning both modes, the widened spatial detection, gene intersection, and the mixed-input case (which concatenates rather than pretending geometry).
  • A µm scale bar for spatial data (Display → Scale Bar). The h5ad format carries no units — Curio Seeker writes µm, plain Visium writes full-res image pixels, a Localize map inherits its reference — so skopia asks rather than guesses: Display → "µm per coordinate unit" declares the physical size of one unit of the dataset's spatial coordinates (for Curio Seeker and Visium HD, enter 1), stored per dataset in uns['skopia_spatial_scale'] so it survives export and reload. Once known, a bar renders bottom-right over the plot: always a round physical length (1/2/5 × 10ⁿ µm, labeled in µm or mm), resized as you zoom. It appears only on the designated spatial embedding — a UMAP has no physical scale, and neither does a coordinate array that merely looks spatial. Visium HD datasets need no setup: the loader builds its coordinates in µm and records bin_size_um, which is recognized automatically. Bar sizing is a pure, tested module (src/lib/scaleBar.ts, 4 cases); the setting round-trips through GET/PUT /api/spatial_scale (10 backend cases) and lands in the analysis record, since every µm in an exported figure means what this setting says.
  • Filter Cells shows the distributions it thresholds (Analyze → Preprocess → Filter Cells). Two histograms — total counts per cell and genes per cell — appear above the numeric inputs, with draggable red cutoffs bound to the same four thresholds, a log₁₀(1+x) axis toggle (on by default; count distributions are unreadable linear), axis labels in data units either way, and a live "876 of 1,000 cells pass the current thresholds" line computed with exactly the backend's mask semantics (inclusive bounds, AND of everything set). Dragging a cutoff to the axis end clears that threshold. After a run the histograms refetch, so what you see is always the current dataset. Per-cell metrics come from a new GET /api/scanpy/filter_cells/qc; mapping and pass-count logic are a pure, tested module (src/lib/filterCellsQc.ts, 7 cases).
  • Combining thresholds used to be an error, and now works. sc.pp.filter_cells accepts exactly one threshold per call, and the adaptor passed everything to one call — so the shipped default (Min genes = 25) plus any other threshold was a 400: "Only provide one of the optional parameters…". The adaptor now computes the keep-mask itself (same inclusive semantics scanpy applies, pinned by a test against scanpy's own result) and the exported notebook emits one sc.pp.filter_cells call per threshold, which is what makes those sequential calls both runnable and equivalent.

Changed

  • A dataset slot is a name now, not one of two positions. Nothing visible changes — the UI still offers Primary and Secondary — but the two-dataset ceiling was never architectural. The backend has always kept its adaptors in a dict keyed by an arbitrary string, and five datasets load into a stock backend with no code change at all; the limit lived entirely in a frontend type ('primary' | 'secondary') and a side-by-side layout written out twice, once per slot. The layout is now one <DatasetPane slot={…}> rendered from a list, the type is a plain string, and otherSlot() — "the one that isn't this one", a question with no answer once a third dataset exists — is replaced by mirroring onto every other loaded slot.
  • Widening the type costs the typo check, so every lookup that can now miss was made a quiet no-op. Writing the tests first found both ways it went wrong: activating a slot that holds nothing threw, and patching one minted a dataset object holding a single field — the second being the dangerous one, since it fails later and somewhere else. Activating an absent slot now leaves the flat fields pointed at the dataset actually on screen, and a patch for an absent slot is dropped, which is also what should happen when a fetch outlives the dataset it was for.
  • Verified against both of a real session's datasets — a 4,212-cell dissociated primary and a 9,145-cell spatial secondary: two panes, each with its own embedding picker offering its own embeddings (5 and 3), and colouring by Meis2 mirrors onto the other dataset as a re-fetch, so each pane keeps its own values and its own legend scale (0–3.95 and 0–1.95) rather than borrowing its neighbour's numbers. Measurements and what remains for an N-slot UI: docs/measurements/2026-08-22-more-than-two-datasets.md.
  • UMAP and Leiden preselect the expression kNN graph (Analyze → Cells). The kNN-graph dropdown used to sit on an implicit empty option labeled "Expression neighbors (default)", which named no actual graph and, on datasets carrying obsp['connectivities'] without a uns['neighbors'] entry (h5ads made elsewhere), failed the prerequisite check outright. When the expression graph exists it is now preselected by key, so the dropdown says exactly what will run — Expression neighbors (connectivities, 21,198 edges) — and the run goes through the explicit-graph path that works regardless of uns. Output names are unchanged (X_umap, leiden): the expression graph carries no suffix. A hand-made choice, including clearing back to the empty option (now honestly labeled "Dataset default graph"), is never overridden. Spatial-only datasets are left alone — silently clustering the spatial graph would answer a different question. Decision logic is a pure, tested module (src/lib/graphChoice.ts, 4 cases).
  • File → Export writes where you choose. Every export streamed a browser download under a fixed name, so an h5ad landed in Downloads as skopia_export.h5ad whatever dataset it came from — export three variants and you had skopia_export.h5ad, skopia_export (1).h5ad and skopia_export (2).h5ad with no way to tell them apart. You now pick the folder and the name, and skopia writes the file there. Verified end to end: a real export reported Wrote /Users/pcahan/Downloads/toy_spatial_skopia.h5ad (672.6 kB) and read back in Python at the right shape with its annotation columns intact.
  • The name is proposed from the dataset, not from a constant. toy_spatial.h5ad offers toy_spatial_skopia.h5ad, toy_spatial_annotations.tsv, toy_spatial_gene_sets.json, so two exports of different datasets cannot collide by default.
  • An overwrite is visible before the button, not after it. The picker watches the entries of the folder it is showing, so a name that already exists there says so in amber while the decision is still yours. This writes to your own filesystem; discovering a collision afterwards is not good enough.
  • For a large h5ad it also stops a pointless round trip. The file used to be written to a server temp file, streamed through the browser, and written again — to a directory you did not pick. It is now written once, where you asked.
  • Downloading is still there, per format. Streaming to the browser is the right thing when the backend is not on the machine you are sitting at, and GET /api/export/h5ad is a URL that works today, so neither was removed.
  • Rejected: the native OS save sheet. showSaveFilePicker is the most literally "typical" dialog and is Chrome/Edge only, so Safari and Firefox would have needed this path as their fallback regardless — two code paths for every export format, to reach the same place.
  • composeSavePath now takes the extension it should append rather than hardcoding .pkl, with a list meaning append the first, accept any so .pickle stays a valid pickle. There is deliberately no default: a silent fallback is exactly how an h5ad ends up named .pkl.
  • PyscnModal was deliberately not refactored onto the shared picker, and the spec records why: serving it would mean adding footer and onError props to a component that otherwise needs neither, which is evidence the two uses are not the same thing — and it has no UI tests to refactor against.
  • A deep path is readable, and you can filter the folder you are in (File → Load…). Research data lives deep: a real path from this project's own test runs is eleven segments and 140 characters. The breadcrumb scrolled horizontally and anchored left, so what you saw was /Users/pcahan/CahanLab Dro… — and the one segment that matters, the folder you are actually in, was off the end. It now elides the middle and never the ends: the tail is where you are, the head is how you get back out, and the part in between is traversal nobody reads. Fixed height, no scrolling, and a … opens the rest in place. It also says Home rather than /Users/pcahan — the browser already knows your shortcuts, so a path underneath one is named in terms of it. Home › … › skopia › h5ad_empty_removed › best_per_stage in place of the full 140 characters.
  • A filter box narrows the current folder as you type, because the fastest way to a file whose folder you can already see is to type three letters of its name. Substring rather than prefix — dataset filenames carry their identity in the middle: a date, a stage, a sample id.
  • The path logic is a pure, tested module (src/lib/pathCrumbs.ts, 12 cases) rather than JSX arithmetic.
  • Filter Genes asks for a share of cells, not a count (Analyze → Preprocess → Filter Genes). Min cells was absolute, so the same setting meant something different on 2,000 cells and on 200,000. It is now a percentage defaulting to 0.1% — a gene has to appear in one cell per thousand — with the count it works out to shown beside the field, because that count is what scanpy is given and what the analysis record will say. The conversion happens in the UI so the recorded parameter, and the exported notebook, carry the exact number that ran.
  • The config key was renamed to min_cells_pct on purpose. docs/config.example.yaml shipped min_cells: 3, meaning three cells; under the same name that value would have been read as three percent — 6,000 cells on a 200,000-cell dataset. Renaming means an old key is ignored rather than silently reinterpreted. Update it to min_cells_pct to set your own default.
  • injective runs on datasets it used to refuse. Solving the assignment exactly means holding the whole query × reference similarity matrix in memory, so the estimator capped itself and refused past it — a 50,000-cell query against a 20,000-spot reference is a billion entries. Above the size where the exact solver is affordable it now assigns over each cell's 128 best candidate spots instead of every spot. A case that was refused outright — 15,000 cells against 30,000 spots, 450 M entries, 5.4 GB dense — completes in 6 seconds with every cell on its own spot.
  • The approximation is invisible where it matters. Measured on the E11.5 limb pair (2,683 × 9,773): the candidate solution's total similarity is 0.18% below the exact optimum with 87% of cells on the identical spot, and the Map quality panel cannot separate them — area 0.99 against 1.00, all 2,683 spots distinct either way, skin pattern +0.285 against +0.298 on a metric that moved between 0.285 and 0.365 across variants whose objective differed by 15%. Mean similarity, which is what the objective actually optimizes, converges to the exact value. The run reports assignment: exact | candidate and the modal says so outright, because a near-optimal answer must never be readable as an exact one.
  • Feasibility had to be constructed, not hoped for. A plain top-c candidate graph had no full matching at all on that pair for every c ≤ 64: many query cells rank the same well-recovered spots highest, so their candidate sets overlap and Hall's condition fails — which is the very pile-up injective exists to remove. Seeding the graph with a greedy injective assignment makes a full matching a theorem rather than luck, and the optimizer can only improve on it.
  • Two construction traps worth naming, both measured while building this. Assembling the sparse matrix with duplicate (row, col) pairs sums them, so every seed edge that is also a candidate had its cost doubled and the solver avoided exactly the edges it should prefer — 12% of the objective, presenting as a worse algorithm rather than a bug. And a stored cost of exactly zero reads as "no edge" to the matcher, which would silently delete the best edge in the graph.
  • The old ceiling was also mis-documented. It claimed 1e8 float32 entries was 400 MB; scipy converts its input to float64 internally, so the real peak was 12 bytes per entry (measured: +210 MB on top of a 105 MB array), or ~1.2 GB. The dense path is now capped by what already works — the limb pair runs dense today and still does, bit-identically.
  • A second memory wall, fixed while there. The similarity block was a fixed 2,048 rows regardless of reference size — 820 MB against a 100,000-spot reference, for every aggregation rather than only the assigning one. The chunk now shrinks so the block stays bounded.

Fixed

  • A task that runs longer than five minutes is no longer reported as lost at the moment it succeeds. The background-task reaper measured a result's age from the task's creation, so any run whose runtime exceeded the 300 s TTL was deleted from the registry at the first status poll after it finished — the UI got 404, showed "Lost connection to task: Task not found", and never refreshed the schema, so the results that apply_fn had just written were invisible. Transport-aggregation Localize exceeds five minutes at real dataset sizes (reproduced at 20k × 40k cells / 22k shared genes: 397 s, applied successfully, reported lost), which is why that aggregation seemed to fail every long run while weighted_mean (~90 s) never did. Terminal tasks now stamp finished_at and the TTL runs from there.
  • When the backend restarts mid-task, the UI now says that, immediately. The task registry lives in the backend process, and uvicorn --reload replaces that process on any .py edit — including edits made by a Claude session working in the repo, or a file-sync touch. Every poll after the restart can only 404, yet the poller burned three silent retries and then blamed the connection. A 404 now ends the poll on the spot with the actual story: "The backend restarted while this task was running, so the task was lost… Re-run the operation." Genuinely transient failures (a proxy blip, a brief outage) now get 8 consecutive polls of tolerance instead of 3, so a hiccup no longer abandons a task that is still running server-side. The retry semantics moved to a pure, tested module (src/lib/taskPolling.ts, 6 cases).
  • Unexpected token '<', "<!doctype "... is not valid JSON now names the server that answered. Another project's dev server on :8000 — skopia's backend port, and an ordinary default that anything might take — answers /api/* with its own SPA shell at HTTP 200. A 200 passes every if (!response.ok) guard in the frontend, so the first thing to fail is response.json(), and the message it produces names the parser rather than the port collision that caused it. The vite proxy already translates ECONNREFUSED/ETIMEDOUT into an actionable line, but those cover the backend being absent; nothing covered the port being taken, which is the case that produces a confusing message rather than an obvious one.
  • A successful reply that is not JSON is treated as identification, not as data. It cannot have come from skopia's backend, so the reply is read for its <title> and reported as who answered: A server calling itself "Lab Manager" answered skopia's API with HTML instead of JSON — something other than skopia's backend is listening on port 8000, with the lsof line that finds it. Naming the intruder is the whole diagnostic; without it the symptom is indistinguishable from a corrupt response.
  • The header is checked before the body is touched, so the ordinary path pays nothing and the response is still unread when the caller calls .json(). Applied to fetchJson and to the load/browse/schema paths in App.tsx and FileBrowser.tsx — those call fetch directly, which is why this surfaced both at launch and on File → Load.
  • Two limits worth stating. On launch the message reaches the console only, because that path has no error surface and the panel says "No data loaded" as it would for any empty start; on File → Load it renders in the dialog where the parse error used to be. And the port in the message is the SKOPIA_BACKEND default of 8000 rather than the configured target, so it is a hint on an overridden backend and exact on a default one.
  • Pure, unit-tested module (src/lib/foreignServer.ts, 10 cases) — three of them asserting it stays silent on ordinary JSON, since a guard that fires on valid responses would be worse than the bug.
  • A predicted map can now be used by the spatial tools. After Localize produced coordinates, Analyze → Spatial → Spatial Neighbors refused to run: "Requires: HAS_SPATIAL to be computed first" — on a dataset that had coordinates, sitting in .obsm['X_spatial_pred']. Auto-detection looked for spatial or X_spatial and nothing else, so Spatial Neighbors, Contour, Define Sections and Ligand-Receptor were all closed to the output of the tool that exists to create them. Naming the array explicitly did not help either: prepare_spatial_neighbors already accepted spatial_key=, but check_prerequisites ran first and refused it — the same shape as the UMAP/Leiden graph_key gate.
  • Which array is spatial is now an explicit, remembered choice (uns['skopia_spatial_key']), honoured ahead of the two conventional names, with auto-detection unchanged as the fallback. One setting re-points all four tools and the 13 places that read the key; switching between two predicted maps switches every spatial analysis with it. A stored key whose array no longer exists falls back rather than stranding the dataset, since .uns survives a save and the .obsm it names may not.
  • Not a wider auto-detect, deliberately. A query localized under several settings carries several predicted maps, so detection would have to guess which analysis was meant. Keeping the choice explicit is also what lets the UI state the thing that matters: these coordinates were predicted, and every neighbourhood statistic computed over them inherits the map's error — which, measured on an E11.5 limb, is substantial even for the best estimator available.
  • The picker lives in the refusal. The prerequisite warning that used to be a dead end now lists the usable arrays, defaults to a predicted map, marks which are predictions, and counts cells left unplaced by a confidence threshold — those cannot take part in a spatial graph, and that belongs in front of the choice rather than behind a strange result.
  • Spatial Neighbors failed whenever Coord Type was left at its default. The dropdown offers an empty "auto-detect" entry, and the empty string was sent to the backend rather than omitted, so squidpy rejected it: *"Invalid option ` forCoordType"*. This affected every run from the modal, on measured coordinates too. Aselectoffering''among its options now omits the parameter so the backend default applies, matching what theobs_column_select` path beside it already did.

Added

  • Official gene symbols for a dataset that only has Ensembl ids (Genes → ⋯ → Add gene symbols…). A dataset whose .var holds ENSMUSG00000051951 rather than Xkr4 is intact and unusable by a human: gene search finds nothing, imported gene sets match nothing, the Localize gene basis cannot be curated, and every panel that names a gene is unreadable. The fix used to be leaving skopia, mapping the ids in a script, and re-saving the file. It is now one action, offline, in about a second. Measured on a real Visium HD mouse embryo dataset: 32,285 of 32,285 ids mapped, none left over, and Shh went from finding nothing to finding Shh.
  • The tables ship with skopia rather than being fetched. 80,273 human ids and 82,066 mouse, ~1 MB gzipped, built from GENCODE by a script committed beside them. Shipped for three reasons that a live API cannot offer: it works on a laptop with no network, it returns instantly rather than a round trip per session, and it is deterministic — the same dataset maps the same way in a year.
  • Two GENCODE releases per species, newest winning. A single current release misses retired ids, and datasets in the wild are usually older than the current annotation: 10x's refdata-gex-2020-A, still one of the most widely used references anywhere, is GENCODE v32/M23. The tables merge v32 with v50 and M23 with M39. That is why the real Visium HD dataset maps at 100% rather than leaving a tail of unmatched ids.
  • The species is detected, not asked. Ensembl encodes it in the prefix, so the panel reports mouse rather than making the user say it. Detection is by majority, because a real dataset can carry a handful of spike-ins. A dataset that is neither human nor mouse is refused by name — "these look like zebrafish Ensembl ids" — since guessing would produce a column of unmapped ids that looks like it worked.
  • The cost is shown before the action. How many ids map, how many do not, how many symbols are used by more than one id, and five worked examples, all before anything is written — the same contract as the gene-overlap panel in Localize. It is also how the feature says you do not need this: a dataset whose names are already symbols, or which already carries a symbol column, is told so and pointed at the Gene IDs picker.
  • Unmapped ids keep their id, and duplicate symbols are not a refusal. A blank would break the >90%-unique test that makes a column offerable as an identifier and would make those genes unaddressable — worse than an ugly label. Several ids legitimately share a symbol (35 of them in the Visium HD dataset); unlike rename_genes, where a collision means the user typed too broad a pattern, here it is a fact about the annotation with nothing to correct, so it is counted and reported.
  • It reuses the gene-identifier machinery rather than adding a second one. The mapping writes .var['gene_symbol'], which get_var_identifier_columns already picks up and the Gene IDs: dropdown already offers; ticking "use symbols as gene names" calls the existing swap_var_index, so there is still exactly one implementation of the cache invalidation and gene-mask regeneration that operation needs. Building a parallel rename path would have duplicated the part that is easy to get wrong.
  • Two bugs the tests missed and a real run caught. Writing the column as a Categorical made the promoted .var index categorical, which AnnData warns about and is a hazard on save — it is written as plain strings, with a test pinning it. And the displaced ids landed in a column called _prev_index, so the picker offered a meaningless label as the way back; the outgoing index is now named ensembl_id first.
  • package-data also gained data/*.csv, which lr_pairs.csv already needed and never had. The editable install used throughout development hides both that and the new tables.
  • transport — the first Localize estimator that fills the tissue and keeps the gradient (Analyze → Spatial → Localize). Every other aggregation sits at one end of a single trade-off. On the E11.5 limb pair (2,683 cells against 9,773 spots), weighted_mean covers 8.6% of the tissue with the epidermis at −0.256 and the distal markers at −0.532 — both inverted, placed where those populations are not — while best_match holds 49.6% of the area by putting all 2,683 cells onto twenty-two spots. Entropic optimal transport solves for all cells at once subject to the tissue being occupied, so it moves along that frontier instead of sitting at an end of it. Measured at the shipped default: area 0.437 over 1,774 distinct spots, with all three marker patterns positive and both inversions reversed — epidermis −0.256 → +0.271, distal −0.532 → +0.353 — and axis fidelity better than best_match on both axes, including the proximal axis where best_match is itself inverted.
  • ε is the dial, and it is measured in units the data cannot shift. Sinkhorn forms exp(−C/ε), so ε trades against the spread of the cost matrix rather than its absolute scale; the transform and metric you pick move the effective ε across 3.5× while the useful tuning range spans only 2.5×. The preprocessing would otherwise move the dial further than the dial travels. The cost is normalized, so ε means the same thing under none+cosine as under zscore+correlation, and one default survives both.
  • Which spread is the subtle part, and getting it wrong destroyed the map. Entropic OT is invariant to C_ij → C_ij + a_i + b_j — both offsets are absorbed into the potentials, so neither can move the coupling. The first implementation divided by the global standard deviation, which counts them. On this pair the column effect alone was 98% of the global spread (0.0808 of 0.0827, against a double-centred 0.0134): reference spots that are better recovered and so similar to everything, the same artifact that makes best_match pile up. That inflated the scale 6.2×, so every run converged in ten iterations to a near-uniform coupling and the map collapsed to 0.5% of the tissue at every ε tried. Double-centring before measuring the spread is the fix, and the test that asserts the coupling is unchanged under per-cell and per-spot offsets is the one that would have caught it.
  • The default is ε=0.05, and 0.03 was rejected despite scoring higher. 0.03 reaches area 0.477 with the best marker patterns in the sweep, and does not meet its convergence tolerance in 400 iterations (final marginal error 4.4e-3, 44× the tolerance). A default whose marginals were never satisfied would contradict the reference-side marginal that is the whole reason to use this method. max_iterations moves 200 → 300 alongside it, because at 200 the new default would not converge either. The full sweep is in docs/superpowers/measurements/2026-08-11-transport-epsilon-sweep.md.
  • Pattern fidelity is not readable on a collapsed map, and the sweep shows why: the epidermis scores +0.783 at ε=2.0, the highest number in the table, on a map covering 0.4% of the tissue across 72 distinct spots — every cell falls in a handful of bins and the correlation measures almost nothing. Read pattern together with area, never alone.
  • Log-domain always. The naive kernel form does not fail on the kernel entries but on the scaling vectors, and it fails at exactly the small ε where this estimator is worth using — at ε=0.002 the kernel reaches exp(−1200) and flushes to exactly zero. One stable path is worth more than the 2–3× per-iteration saving of a form that breaks where it is needed.
  • Convergence is measured on the row marginal, not the column. The column potential is updated last, so immediately afterwards the column marginal holds to machine precision however far from converged the coupling is: measuring it reported 1.7e-15 on the second iteration and stopped there, with the rows still wrong by 5.7e-4. Only the un-enforced marginal carries information. Every run reports its iteration count and final marginal error, because a run that spent its budget has not satisfied the constraint that justifies the method.
  • Confidence now comes from the posterior. Each row of the coupling is a spatial posterior — the honest output for a cell that genuinely could be in several places — so confidence is that posterior's spatial spread, the same quantity the k-NN path already computes over its k neighbours. Row entropy was the alternative and is rejected: it is not in spatial units, so a transport run's confidence could not be read against any other run's, and comparing runs is what Map quality exists for.
  • Dense while affordable, spatially-stratified subsample above it, and the run says which. The limb pair is 26.2M entries and stays dense. Above the ceiling the reference is binned and sampled with at least one spot per occupied bin, because uniform sampling thins a sparse extremity in proportion to its density and the column marginal would then enforce occupancy of a tissue missing a limb. Runtime is 203 s at the default on that pair, as a cancellable background task with per-iteration progress.
  • It is offered, not preferred. weighted_mean remains the default aggregation; changing that needs its own evidence on more than one dataset. The composition assumption behind the reference-side marginal is stated in the panel rather than left implicit: forcing the tissue to be occupied asserts that the query's composition matches it, and dissociation biases which cell types survive.
  • Backend: skopia/transport.py (normalize_cost, sinkhorn_log, barycentric_projection, posterior_spread, stratified_subsample), 21 unit cases. Frontend: the ε control and its guidance in LocalizeModal, five new cases in localizeAdvice.
  • A Localize estimator that gives every cell its own spot, and a warning the default has earned (Analyze → Spatial → Localize). Phase 1 made the failure measurable; this acts on what it measured. Two independent pieces.
  • injective — best match solved as a set rather than one cell at a time. best_match takes each cell's single best spot independently, so a spot that correlates well with everything — better recovered, less noisy — absorbs many cells. Optimal assignment maximizes total similarity subject to distinct spots, via scipy.optimize.linear_sum_assignment. On the E11.5 limb pair (2,683 cells, 9,773 spots): 2,683 distinct spots out of 2,683, up from 1,522 for greedy, in about a second. The cost is a few percent of mean similarity.
  • It is not better, it is elsewhere on the same frontier, and the UI says so. Filling the tissue and carrying a gradient are the two ends of one trade-off. Measured on that pair: weighted_mean area 0.17 with the epidermis at −0.16 — inverted — while any single-location estimator holds area 1.00 with the gradients gone. injective fixes pile-up, not placement; its axis correlations are greedy best_match's to within noise. Presenting it as strictly better would be exactly the failure Phase 1 was built to prevent, so the panel, the guide and the Avoid list all state the trade rather than implying a winner.
  • Off by default, and refused rather than fudged. Injectivity asserts that the query's composition matches the tissue's; dissociation biases which cell types survive, so forcing one-to-one pushes over-represented types into locations they do not belong. It needs at least one spot per cell — the option is disabled when the query outnumbers the reference, and the same check runs in prepare_localize so an impossible run is a readable 400 rather than a background task that dies a minute in. It also materializes the whole query × reference similarity matrix, which the chunked top-k path never does, so there is an explicit size ceiling instead of an out-of-memory kill.
  • The default's failure is now stated before the run, not after. For every gene set curated in the Gene panel, POST /api/localize/reference_geometry asks the reference alone where the mean of that population's own positions falls. If the population forms a ring or hugs the tissue edge, that mean is a place none of its cells occupy — the mean of a ring is its hole — and weighted mean sends every query cell of the type there. On the limb reference: skin 0.88, blood 0.70, cartilage 0.18, muscle 0.00. The modal names the ones at risk while the parameters are still being chosen.
  • Two formulations were built and thrown away, both of which look right. Counting how many of the cells around that mean are population members is correct in every case and far too noisy — 8 expected among 40 neighbours, so it fires on an ordinary scattered population about 1 seed in 60, and a user with a dozen gene sets would see a spurious warning most sessions. Scoring the mean rank of the tissue there fixes the variance and introduces a worse bug: it depends on how much tissue the population covers, saturating near 0.25 for a population covering a quarter of the reference, so the warning never fires. What ships compares the mean's distance from the population against the population's own spacing — scale-free, and blind to the background entirely.
  • The real data corrected the design twice, and neither correction came from a test. Taking a fixed top fraction as "the population" was silent on the very case it was built for: skin markers are detected in only 7% of limb spots, so the top 20% is mostly interior tissue with trace expression, the population fills the bud, and the risk reads 0.14 on a map already measured as inverted. Each fraction is now scored and the worst reported, with the fraction that produced it — at the top 2%, the epidermis proper, the same reference scores 0.88. Separately, averaging over 25 neighbours walks a quarter of the way around a thin band and hides its hole; at 5 a one-cell-wide perimeter scores 0.79 where 25 gives 0.38.
  • Backend: injective_assignment / injective_feasibility in localize.py, mean_collapse_risk in localize_metrics.py, localize_reference_geometry on the adaptor, POST /api/localize/reference_geometry. Frontend: adviseParameters moves to a pure, unit-tested src/lib/localizeAdvice.ts (17 cases, several asserting it stays silent — advice that fires on ordinary settings trains the user to ignore it).
  • Map quality — scoring a Localize map instead of eyeballing it (Analyze → Spatial → Localize). On a real E11.5 mouse limb pair the default settings inverted the tissue's most basic anatomy — the epidermis, the outermost tissue in the embryo, was predicted into the middle of the bud — and nothing in the tool said so. The confidence score was working (mean 0.19 correctly reported that the matched neighbours were scattered), but "the map looks wrong" was not actionable: eight saved parameter variants existed on that dataset with no way to rank them. Map quality scores every predicted embedding in the query against the reference, so they can be compared rather than argued about.
  • Four metrics, each answering a question a user actually asks. Spatial pattern fidelity — does this cell type land where it lives? The headline number, and the one that catches the inversion: it goes negative when a type is placed where it is not, which is a different kind of wrong from merely weak. Axis fidelity — are the gradients real? Reported as "x of y possible" against what the reference itself achieves, because an attenuated correlation means nothing without its ceiling, and the direction is derived from the reference so the user never declares which way is distal. Dispersion — does the map fill the tissue, with cells pushed outside it counted separately, since a rescale can reach the right area by ejecting cells. Occupancy — distinct spots used, maximum on any one, and the effective number from the assignment entropy, which catches a better-recovered spot absorbing many cells even when the distinct count looks fine.
  • Everything is rank-based, and not for style. The reference is spot-resolved and the query is dissociated cells, so their expression scales are not comparable; and an estimator that shrinks the map changes the coordinate scale without changing what it claims. Ranking both sides makes every metric invariant to any monotone rescale — an affine rescale of the predictions provably cannot change a rank correlation, so a metric that moved under one would be measuring the wrong thing. That invariance is what makes maps from different settings comparable at all.
  • One formulation had to be thrown away. Comparing marker-weighted densities is the obvious approach and it is confounded: both maps then carry the same "where are there cells at all" signal, which dominates. Measured on synthetic geometry, two unrelated markers scored +0.33 and a fully inverted one only −0.07. Dividing the weighted sum by the cell count per bin isolates "is this marker high here", and the same three cases become +0.99 / −0.99 / ~0.
  • What it says about the limb pair. weighted_mean (k=50): area 0.15, epidermis −0.11 — inverted — but the proximodistal gradient largely intact (0.24 of a 0.34 ceiling). best_match: area 1.00, epidermis +0.29 — rim recovered — and the gradients gone (0.05 of 0.34). The two settings fail in opposite directions, which is the frontier the metrics exist to make visible: averaging preserves the gradient and collapses the extent; any single-location choice preserves the extent and keeps no gradient.
  • Backend: new pure module backend/skopia/localize_metrics.py (arrays in, dicts out, no adaptor import), evaluate_localization_maps on the adaptor, and POST /api/localize/evaluate_map which scores several embeddings per call because the numbers are only meaningful comparatively. A gene set with no genes present in both datasets is reported in skipped_gene_sets rather than failing the run.
  • Contour explains its parameters, and checks them against your data (Analyze → Spatial → Contour). The tool asks for six numbers before it will do anything, and each one carried a tooltip that restated its label. Two of them were prefilled from a data-aware suggestion and then never mentioned again, so editing one left the sane range with nothing on screen to say so. The modal now raises advice against the current settings on both phases, and a collapsible Show how to choose these gives starting recipes per platform, the trade-offs, and an Avoid list.
  • The coupling the form was hiding. Sigma is measured in grid pixels, and a pixel is extent / grid_res, so the physical smoothing radius is sigma × extent / grid_res — doubling the grid resolution halves the actual smoothing. suggest_smooth_sigma solves for a radius of about two spot spacings, but the moment the grid is edited on its own that quietly stops holding and the bands break into speckle for reasons nothing on screen explains. Change the grid now and the tool says what the smoothing just became and what σ would restore it ("moving the grid to 80 changed the smoothing from 2 to 1.25 spot spacings without you touching σ; σ 1.7 would restore the original width").
  • Everything is phrased in spot spacings, not as disagreement with a suggested number the user never chose — under 1 the Gaussian never reaches the neighbouring spot; over about 6 it spans a whole zone and adjacent tissues merge; a grid many pixels finer than the sampling is interpolating detail rather than measuring it. That framing also keeps the thresholds honest: suggest_grid_res has a floor of 50, so on any dataset under ~2500 spots the suggestion itself puts two or three grid pixels between adjacent spots, and a naive threshold would fire on its own defaults.
  • It reads the detected scale of .X (from the existing layer_scale verdict on /scanpy/layers, no new endpoint) and says so when Log transform disagrees — off on raw counts, on over an already-logged matrix, or on over z-scored values where log1p of a negative is not a number the score can use. The route models default log_transform to True and the modal defaults it to False; rather than change a default that would alter results for anyone relying on it, the advice makes the current state legible.
  • Review phase too: a cutoff selecting no spots, or more than half of them (a module high everywhere wins overlaps by size rather than by signal), two modules broad enough that most assignments come from the neighbour vote rather than the contours under review, and a profile_k reaching past the local neighbourhood. Plus, before the run rather than after it: multi-set contouring without X_pca, and a gene set small enough that the module score is essentially one gene's spatial field.
  • The guide states the other thing the form hides: bands are equal-width, not equal-count. Thresholds are linspace(0, vmax, levels + 2)[1:-1], so on a skewed field the top band holds few spots — the shape of the field, not weak expression — and more levels only subdivide the choice of cutoff.
  • Backend: suggest_contour_params additionally returns n_spots, median_spacing and extent, which suggest_smooth_sigma already computed and discarded. Frontend: pure contourAdvice.ts (adviseContour, adviseModules, sectionColumnCandidates), unit-tested directly — 30 cases, including one per rule staying silent, since advice that fires on its own defaults is noise.
  • UMAP and Leiden can run on any neighbor graph (Analyze → Cells → UMAP / Leiden). Both read obsp['connectivities'] and nothing else, so the spatial graph was unreachable and a Combine Neighbors result could only be used by overwriting the expression graph in place — losing it, and leaving no trace of which graph produced the current X_umap. Both now take a kNN graph picker listing every connectivity graph in the dataset, and name their output after it (X_umap_spatial, leiden_spatial), so an expression map and a spatially-informed one sit side by side. The name is editable and re-prefills when you change graph unless you have typed over it. The unlocked analysis is spatial domain detection — clustering spots by who they sit next to, which finds contiguous regions of tissue rather than cell types (measured on the bundled toy: 10 domains at 0.97 mean agreement among each spot's six nearest neighbours, against ~0.1 for random labels).
  • It works on a dataset that has no PCA and no expression graph at all — Visium plus Spatial Neighbors, which is precisely the case the feature exists for. Both tools listed neighbors as a prerequisite, meaning obsp['connectivities']; naming a graph explicitly supplies its own, so that gate is bypassed rather than blocking a run the backend now accepts.
  • scanpy needed repairing to accept these graphs. sc.tl.umap has no obsp= parameter — it reads uns[neighbors_key] — and neither graph skopia produces can be handed to it as it stands: squidpy's uns['spatial_neighbors'] has no params['method'], which tl.umap reads unguarded (KeyError), and combine_neighbor_graphs writes only the matrix while NeighborsView requires distances_key to be present (the matrix it names is never read — UMAP uses connectivities only). The adaptor synthesizes a complete entry, starting from any real one pointing at that graph so squidpy's recorded n_neighbors survives into the export rather than being replaced by an invention, and deletes it in a finally so a failed run cannot leave a fabricated neighbors entry for the next tool to find. Leiden needs none of this; sc.tl.leiden takes obsp= directly.
  • One silent side effect was worth the whole exercise. With no representation named, scanpy falls through to _get_pca_or_small_x, which — when X_pca is absent and the dataset has more than 50 genes — runs sc.pp.pca and writes X_pca + uns['pca'] into the object, behind a warning. That would put an embedding into the AnnData that no recorded step created, so the Analysis Record's exported notebook would not reproduce the state it claims to. Passing use_rep='X' takes the branch that simply reads .X, and costs nothing: for method='umap' the matrix is not what drives the layout. The recorded step carries the entry that was really installed, so the exported notebook avoids the same trap; verified by executing the emitted cells on a fresh AnnData and confirming identical names and no X_pca on either side.
  • Backend: graph_key / key_added on run_umap, graph_key on run_leiden, _umap_neighbors_meta for the synthesis, a suffix field on /api/scanpy/neighbor_graphs so the frontend and backend derive names from one rule. Both methods' cell-selection paths sliced a hardcoded ['connectivities', 'distances']; they now slice the graph the run actually uses.
  • Localize — predict spatial coordinates for dissociated cells (Analyze → Spatial → Localize). Load a spatial dataset into one slot and an scRNA-seq dataset into the other, and every cell in the scRNA-seq data gets a predicted position: its k nearest transcriptional neighbours among the spatially-resolved cells vote on where it came from. The result is a new embedding (.obsm['X_spatial_pred']), so the whole existing stack — colouring, contours, spatial neighbours, ligand-receptor — then applies to a dataset that never had coordinates. Parameters are all interpretable: k, the gene subset, the similarity metric, the expression transform, and how the neighbours' coordinates are combined. This is the first feature that spans two dataset slots.
  • The failure mode it is built around. Averaging the coordinates of k transcriptionally-similar cells is only meaningful if those cells are spatially co-located. A cell type dispersed through the tissue — immune cells, fibroblasts — has neighbours scattered everywhere, and their centroid lands in the middle of the tissue, possibly somewhere that type never occurs. A type sitting in two distant patches is worse: the mean lands squarely in the gap. Both produce a smooth, convincing, entirely wrong map, and nothing about the coordinate itself gives it away. So every prediction carries two independent scores, both written to .obs and neither optional: _similarity (does this cell resemble anything in the reference at all — a cell type absent from the spatial data is still placed somewhere) and _confidence (do its neighbours agree on a location — the weighted spatial spread of the k neighbours normalized by the reference tissue's own radius, so 1 means they sat on one spot and 0 means they were as scattered as the whole tissue). Cells below a chosen min_confidence get NaN coordinates rather than a fabricated point; the default places everything and flags it, because silently dropping cells is its own kind of lie.
  • Aggregation. weighted_mean (the classic estimator), median (robust to a few scattered neighbours), best_match (snaps to a real reference cell, so a prediction never lands somewhere the tissue does not exist) and densest — which averages only the tightest cluster among the neighbours. densest is the answer to bimodality: it lands the cell in one of the two patches rather than in the empty gap between them. It cannot say which patch — two patches sharing an expression program are indistinguishable to anything reading expression — and does not pretend to; on the bundled benchmark it picks correctly about half the time, which is why the default stays the mean and the confidence score (near zero for such cells either way) is what says not to trust the choice.
  • Choosing which genes similarity is computed over. A Similarity basis picker offers every shared gene, any boolean .var flag on the reference (spatially_variable from Spatial Autocorrelation, highly_variable, …), or any gene set curated in the Gene panel. The reference owns the choice because it is the dataset that can show which genes carry positional signal. The gene-overlap preview recomputes as you change it, so narrowing the basis immediately shows what it costs in shared genes. How much it helps depends on the panel: on whole-transcriptome data, restricting to spatially variable genes removes thousands of genes that say nothing about position; on an already-targeted panel, expect little change (measured on the bundled benchmark: 40 highly-variable genes score 32.7 against 33.0 for all 120).
  • Guidance about the parameters, in the tool. The panel raises warnings against the current selection rather than listing caveats nobody reads — none + euclidean across platforms (sequencing depth becomes the strongest signal), a k above a tenth of the reference (every prediction drifts to the tissue centre), densest with too few neighbours to cluster, best_match (where k no longer affects the coordinate, only the confidence score). A collapsible reference gives three concrete starting recipes and states each parameter's trade-off, including the one that matters most: a smoother map is what this method produces when it is failing, so tune against the accuracy check rather than against the picture.
  • Cross-platform by default. The transform is applied to each dataset independently, which is what removes platform-level per-gene capture efficiency: zscore (default), rank (Spearman-equivalent, robust to any monotone difference), log1p, none. Gene overlap is computed by name and reported with a severity band before anything runs — the same reasoning as the PySingleCellNet coverage check — and refused outright below ten shared genes, since a map from a handful of genes still looks smooth and means nothing. A multi-section reference is handled by assigning each cell the weighted-majority section among its neighbours and drawing coordinates only from that one, so a position is never averaged across the gap between cuts.
  • Accuracy you can check before trusting it. A Check accuracy button holds out a fifth of the reference and predicts it from the rest with the same parameters, where ground truth is exact. It reports median error next to two baselines — predicting the tissue centroid, and predicting at random — because an error reported alone is unfalsifiable: on a compact tissue the centroid baseline is deceptively strong, and the panel says so outright when the method fails to beat it. Also reported: the fraction landing within 5/10/25% of the tissue diameter, a structure correlation (do cells predicted near each other actually sit near each other?), a per-cell-type breakdown, and the correlation between confidence and actual error — the design's own falsification test, since a confidence score that does not predict error is decoration. The check is labelled as an upper bound, since both halves come from one platform and the real cross-platform mapping is worse.
  • A benchmark with exact ground truth ships with it. toy_localize_spatial.h5ad + toy_localize_scrna.h5ad (generator: python -m skopia.data.generate_toy_localize), a matched pair whose true coordinates are kept in .obsm['spatial_true']. The tissue is built to defeat the method: four region-restricted programs are the easy case, while Immune is dispersed with no positional signal, Bipolar sits in two distant patches sharing one program, and Circulating exists only in the query. The two files differ in depth, dropout and per-gene capture, so the transform matters the way it does across real platforms. Measured on it: median error 32.8 against a 66.7 centroid and 86.8 random baseline; per type, the four localizable programs land at 21–24 and the three unlocalizable ones at 64–79; confidence tracks error at r=−0.66; and of 900 query cells, 386 score below 0.2 confidence where 388 are unlocalizable by construction — the score identifies almost exactly the right cells.
  • Backend: new pure module backend/skopia/localize.py (projection, four aggregations, evaluate_localization, cross_validate_localization); spatial_reference_bundle on the reference adaptor and prepare_localize / prepare_localize_cross_validation / evaluate_localization on the query; GET /localize/suggest + POST /localize/prepare / /cross_validate / /evaluate. Frontend LocalizeModal. Because two datasets are involved, the reference exports plain arrays rather than letting a route reach into its AnnData.
  • Analysis record — export a GUI session as a runnable Jupyter notebook or Markdown (File → Analysis record…). Reproducibility is the standing objection to GUI analysis: you click through thirty operations and nothing about that path is publishable, re-runnable, or legible six months later. Every mutating operation is now recorded — the load, its parameters, its result — and the record exports as a notebook whose code cells re-execute the analysis, or as a Markdown methods supplement. Steps carry the user's own annotations plus a generated one-line summary built from the real numbers ("Leiden clustering at resolution 1.0 → 12 clusters in .obs['leiden']"), and figures captured from the plot (◧ Figure) become inline outputs in the notebook and linked PNGs beside the Markdown.
  • The document says how much of itself actually re-runs. The tempting version of this feature emits a tidy notebook that looks authoritative; that version is worse than nothing, because a methods supplement describing an analysis nobody ran is a citation-grade error. So each step carries a fidelity: exact — the emitted line is the library call the adaptor really makes (run_normalize_total with no active selection literally executes sc.pp.normalize_total(self.adata, **kwargs), which is why it earns the label); skopia — reproducible only by calling skopia's own Python API, which the notebook sets up by wrapping the AnnData in a DataAdaptor, including a runner for the two-phase prepare_* operations; manual — described in prose and not pretended to be code. The header states the split in numbers, and an action with no translation still exports as prose with its parameters rather than vanishing. A test scans adaptor.py for every _log_action name and fails if any lacks a translation, so a new operation cannot silently degrade an export.
  • Operations that ran on a cell selection say so. Ten adaptor methods accept active_cell_indices and none of them recorded it, so Leiden on a 4,000-cell lasso was logged indistinguishably from Leiden on all 40,000. The selection is now recorded (and preserved verbatim, up to 50,000 indices, in a _selections.json sidecar) and every affected step is flagged in the panel and in the exported document. We deliberately do not generate subset + write-back code: each of those methods has different write-back semantics — UMAP writes NaN for inactive cells, Leiden writes 'unassigned', normalize_total splices sparse data rows — and generated code that is subtly wrong is exactly the failure this feature exists to prevent. The emitted call runs on the whole dataset and says as much.
  • Recording is always on; what you control is the report. A record button users forget to press loses the analysis outright, and logging already cost nothing, so the recorder accumulates from load. Start report here marks where the story begins without discarding anything earlier.
  • The record travels with the data. It is written into uns['skopia_analysis_record'] as a JSON string (h5ad copes badly with deeply nested heterogeneous dicts) minus figure payloads, so an exported .h5ad carries its own provenance and re-opening it continues the history rather than starting a second one. Export writes server-side into a folder you pick with the file browser — a notebook has to live next to the data to re-read it.
  • Sixteen operations that recorded nothing now do: label renames and merges, hand-painted annotation, QC metrics, differential expression, both gene-set scorers, the .var-side edits (gene renaming, boolean flags, per-pattern and per-species count sums, identifier swap), obs-derived embeddings, and the ligand-receptor analysis itself — finalize_ligrec logged only the .obs columns it wrote, never the radius, permutations or threshold that produced them. The load is recorded too, distinguishing h5ad / 10x h5 / 10x mtx / in-memory, so a dataset built in memory is reported as not reproducible instead of pretending a file exists.
  • Backend: new pure modules backend/skopia/analysis_record.py (the model and its uns round-trip), codegen.py (one ActionSpec per action: label, summary, code, fidelity) and notebook_export.py (nbformat-4 and Markdown emitters); /api/record routes for reading, annotating, marking and exporting. Frontend AnalysisRecordPanel, plus figure capture on the plot which re-renders the stored snapshot points into an offscreen 2D canvas — deck.gl does not set preserveDrawingBuffer, so reading back the live WebGL canvas is not reliable.
  • Cell type classification with PySingleCellNet (toolbar → Cell Typing). An optional integration with PySingleCellNet, which classifies cells by voting a random forest over top-scoring gene pairs ("is gene A above gene B in this cell?"). Two tabs. Classify takes a pickled classifier, and before running anything reports what it is (classes, gene pairs, trees, training parameters) and — the part that matters — how much of its gene set this dataset actually has. PySCN reindexes a query onto the classifier's genes with fill_value=0, so missing genes silently become zeros and a badly-matched query still returns confident-looking scores; coverage is shown with a severity band (ok / warn / error) and the missing symbols listed. A pure ACTB/Actb casing mismatch is detected as such and offers a one-click case-insensitive match rather than reporting 0% overlap. Train builds a classifier from a categorical .obs column — balancing cells per type, normalizing, and selecting HVGs on a private copy, so the loaded dataset is never modified — writes the pickle, and hands it straight to the Classify tab. Both run as cancellable background tasks with live progress.
  • Results land in the slots skopia already knows how to draw: <key>_class_argmax (the call, a categorical whose colors come from the classifier's own ctColors via uns['<column>_colors']), <key>_class_score (the winning vote proportion, i.e. the call's confidence), and optionally <key>_class_type — Singular / Ambiguous / None / Rand, following PySCN's categorize_classification rules with self-calibrated per-class thresholds (comp_ct_thresh). PySCN splits the multi-class case into Intermediate and Hybrid using a cell-type relatedness graph skopia does not have, so those cells are reported as Ambiguous rather than guessed at. The full cells × classes score matrix goes to .obsm['<key>_score'] and is registered in uns['skopia_score_matrices'], so the existing ◈ score matrix pills in the Genes panel colour by any single class and the embedding picker can plot two classes against each other. The run is recorded in uns['pyscn'][<key>]; re-running under a different prefix keeps both results side by side.
  • Training adapts to the scale the reference is already on. Many public references are distributed only as log-normalized values, and running normalize_total + log1p over those again yields log1p(scale(log1p(x))). Training now detects the source scale (via the expression-scale detection above) and applies only the preprocessing still owed — everything for raw counts, log1p alone for linear-normalized data, nothing for already-logged data — picking the HVG flavor to match, and never labelling a log-valued matrix as counts for seurat_v3 to consume. A Scale of that matrix dropdown shows what was detected and overrides it, since detection is a heuristic; the result panel states exactly what was applied. A z-scored source is refused outright. Worth being precise about the blast radius, which is smaller than it looks: the top-scoring-pair features are bit-identical under a double log, because normalize_total and log1p are per-cell monotone and the transform only compares two genes within one cell (pinned by a test). What the double transform corrupts is gene selection — rank_genes_groups, the PCA/dendrogram used to find similar cell types, and HVG.
  • The package is optional. Nothing imports it at module scope; when it is absent the panel shows install instructions instead of failing, and classifier inspection still works (it only needs scikit-learn) so a classifier can be checked against the data before committing to the install. pixi install -e pyscn provides it reproducibly.
  • Two failure modes of the upstream library are handled rather than passed through. skopia narrows the query to exactly the classifier's genes before handing it over, so the dense intermediate PySCN builds is proportional to the classifier (a few hundred columns) rather than to the dataset — the difference between megabytes and tens of gigabytes on a large query — and prediction is chunked over cells. And because PySCN encodes each gene pair as the string geneA_geneB and decodes it with split("_"), gene symbols containing an underscore cannot be represented: training now excludes them and says how many, refuses with an explanation when too few remain, and loading a classifier trained on such symbols fails with a clear message instead of an opaque pandas KeyError at prediction time.
  • Backend: new module backend/skopia/pyscn.py, pyscn_status / pyscn_inspect_classifier / prepare_pyscn_classify / prepare_pyscn_train on the adaptor, and GET /pyscn/status + POST /pyscn/inspect_classifier + /pyscn/classify + /pyscn/train routes; frontend PyscnModal.
  • Expression scale detection — "is this layer raw counts or already normalized?" Every readable matrix (.X and each adata.layers key) is now classified from its own values as raw counts, normalized (linear), log-normalized, log-transformed, scaled / z-scored, or binary. Files arrive from collaborators and public repositories with no record of what was done to them, and guessing wrong is not cosmetic: normalize_total on already-normalized data is a no-op that looks fine, UCell ranks and PySCN's gene-pair transform assume a per-cell monotone scale, and z-scored input breaks anything expecting non-negative values. The signals, in the order they discriminate: negatives (only centering produces them), integrality (counts are integers), constant row sums (normalize_total fixes the library size), constant expm1 row sums (the same check after undoing log1p, which identifies the scanpy-default scale), and dynamic range as a fallback for the common case where genes were subset after normalizing and the row-sum signal is gone. Alongside the inference it reports recorded provenance, which is fact rather than guess: adata.uns['log1p'] from scanpy, the counts layer skopia snapshots at load time, and skopia's own normalize_total / log1p / scale / smooth history.
  • Surfaced unobtrusively: the verdict rides inline in the existing Source dropdown labels (.X (default) — log-normalized), and a 16px ⓘ opens a popover with the confidence level, the reasoning in plain language, the provenance, and the underlying statistics. The Source row now renders for single-.X datasets too, which need the answer just as much. The UCell and Cell Typing dialogs reuse the badge next to their layer pickers and warn outright when a z-scored layer is selected, since both are rank-based and would produce silently meaningless results.
  • Backend: new module backend/skopia/layer_scale.py; list_layers() attaches a scale block to each entry, so GET /scanpy/layers carries it with no new endpoint. Frontend LayerScaleInfo.
  • Score matrices written by other tools are readable. .obsm entries stored as labelled pandas DataFrames — how PySingleCellNet writes SCN_score, among others — now expose their own column names to the schema, colouring, and embedding pickers, so an .h5ad classified elsewhere can be explored in skopia without conversion.
  • Ligand-Receptor spatial signaling (Analyze → Spatial → Ligand-Receptor). A from-scratch NumPy/SciPy port of the core LRscore + permutation statistics of CytoSignal (velocity/dynamics omitted). For each cell and each L-R interaction it imputes ligand expression over a spatial neighborhood — a Gaussian ε-ball for diffusion-dependent (secreted) ligands, direct Delaunay neighbors for contact-dependent (membrane) ligands — multiplies it by the cell's own receptor, spatially smooths the score, and tests significance against a spatial permutation null (shuffle the ligand neighborhood, keep each cell's receptor) with a BH-adjusted per-cell p-value. The tool ranks interactions by number of significant cells; pick any to write its per-cell score as a continuous .obs column (LR_<ligand>_to_<receptor>) and visualize it on the embedding. Parameters (diffusion radius, permutations, min cells/gene) are prefilled from the data with inline tips, and the run shows a live progress bar (permutation count, % and elapsed/ETA). The full per-cell score + significance matrices are persisted to the dataset (.obsm['lrscore'] / ['lrscore_significant'], with metadata in .uns['lrscore']) — .obsm is the correct cell×interaction home (.obsp is cell×cell). Because results persist, re-opening the tool restores the ranked table so you can visualize different interactions without re-running; only changing scoring parameters (radius, permutations, …) requires a recompute. Section-aware: an optional Section column keeps neighborhoods and the permutation null within section (no signaling across the gap between tissue sections). Gene subset: optionally restrict eligible genes to a boolean .var column (e.g. highly_variable / spatially_variable); off by default. The scoring engine reduces the expression matrix to just the genes used by the candidate pairs and computes the (permutation-invariant) receptor side once — roughly a 35× speedup on a 2,000-gene panel (and more for whole-transcriptome data). It builds its own Gaussian/Delaunay neighbor graphs each run and does not reuse the Spatial Neighbors graph. Ships a bundled ligand-receptor database (backend/skopia/data/lr_pairs.csv, 2508 pairs distilled from CellPhoneDB v5 with the diffusion/contact split and multi-subunit complexes preserved; rebuild with python -m skopia.data.build_lr_db). The database uses human (UPPERCASE) symbols but is matched case-insensitively to the dataset's gene names, so it works on mouse data (Pdgfb → PDGFB) — mirroring CytoSignal's uppercase-match; written columns use the dataset's actual gene names. (This is a heuristic; a proper mouse→human ortholog table is planned — see docs/ROADMAP.md.) and a synthetic test dataset with known planted signaling (toy_spatial_ligrec.h5ad; generator generate_toy_ligrec.py). Backend: new pure module backend/skopia/ligrec.py, two-phase prepare_ligrec (cancellable background task) / finalize_ligrec on the adaptor, GET /scanpy/ligrec/suggest + POST /scanpy/ligrec/prepare + /finalize routes; frontend LigRecModal.
  • Refine a category with subcluster labels (Cells → Categorical → ⋯ → Refine with subcluster labels…). After masking some cells and subclustering the rest (which leaves the masked cells unassigned in a new column), fold those subcluster labels back into a parent annotation: every cell with a real subcluster label takes it (optionally renamed — prefix with the parent label, e.g. Mesen.0, use as-is, or a custom prefix), while cells the subcluster left unassigned keep their parent label. Writes a new column or overwrites the parent in place; surviving parent labels keep their colors. Backend: transfer_obs_labels on the adaptor + POST /obs/transfer_labels; frontend TransferLabelsModal.
  • Categorical labels overlaid on the embedding (Cells → Categorical → ⋯ → Show labels on plot). Toggle category names rendered at each cluster's centroid (robust median position) directly on the embedding, with a dark halo for legibility. Turning it on also colors by that column so the labels match the clusters.

Changed

  • Movable, minimizable floating panels on the embedding. The categorical/continuous/expression/bivariate legends and the Source / Embedding selector ("View") box are now draggable (grab the title bar) and collapsible (the – / ▢ button), so they no longer overlap or hide the plot. Position and minimized state persist across color-mode switches (stored per panel in the app store). Legends apply to the single, primary, and secondary plot views.
  • vite.config dev proxy target is configurable. Defaults to http://127.0.0.1:8000 but can be overridden with the SKOPIA_BACKEND env var (e.g. to run the frontend against a backend on another port).
  • Contour tolerates genes missing from the dataset. Previously, contouring a gene set that contained genes absent from the active dataset (common with imported sets) failed with an error. Now the contour paths drop the missing genes, run on the genes that are present, and report the dropped ones — shown as an amber warning in the Contour tool (per module in the multi-contour review step; in the done view for single contour). It still errors only if a gene set has no present genes. Backend run/prepare_contourize and prepare_multicontour return missing_genes.
  • Bivariate coloring accepts single genes, not just gene sets. Each bivariate axis now has a Gene set | Gene toggle: "Gene" reveals a gene-search autocomplete, "Gene set" keeps the existing dropdown. So you can color spots by e.g. Sox9 × Scx, by cartilage × tendon, or a mix (Sox9 × tendon). Available in both the Embedding view (Gene Panel → Bivariate Coloring) and the Figure builder's per-panel bivariate config (new optional bivariateGene1/2 panel fields, backward compatible). The backend already accepted arbitrary gene lists per axis, so no API change.

Fixed

  • Localize could never pick a spatial reference. The modal seeded its reference slot with the literal string 'secondary' and asked the server for the list of usable slots with that guess attached. But the list only comes back from a call naming a valid reference, and both natural arrangements return 400 — ?reference=secondary when the coordinates are in primary ("no spatial coordinates"), and ?reference=secondary&dataset=secondary when the user makes the scRNA-seq active ("the reference must be a different dataset"). Both 400s were swallowed deliberately, since a slot without coordinates is a normal state rather than an error, and the handler returned before setRefs — so the list stayed empty, the tool reported "No loaded dataset has spatial coordinates" while a perfectly good one was loaded, and the picker that would have corrected the guess was itself built from the list that never arrived. A bootstrap deadlock: switching the active dataset produced a different 400 and the same message. The slot list is now fetched with no reference at all, which the route answers unconditionally (it builds the list before validating a reference), so the picker always populates.
  • Roles no longer depend on which dataset is active. Localize is the one feature spanning two slots, and it inferred the query from the active one — punishing the obvious workflow of loading the spatial data, looking at it, and then trying to map onto it. The dataset holding coordinates is now the reference and the other is the query, whichever is being viewed. The modal states both, plus which dataset the predictions get written into, and offers a swap when both carry coordinates. The role logic is a pure function (lib/localizeRoles.ts) with its own tests, including one asserting the answer does not move when the active slot changes.
  • Neighbors on a cell selection failed for every dataset. run_neighbors builds a throwaway AnnData holding only the selected cells' .obsm representation, deliberately with no .X. scanpy's use_rep=None default resolves the representation from adata.n_vars, which on that object is 0, so it fell through to .X and raised on None. The whole sequence a user performs — lasso a subset, PCA, Neighbors, Leiden — could not complete. The representation is now named explicitly.
  • An embedding containing NaN returned a 500. NaN is a legitimate value there: run_pca and run_umap on a cell selection leave inactive cells NaN, and Localize leaves unplaceable cells NaN rather than fabricating a position. But starlette serializes strictly, so GET /api/embedding/<name> raised "Out of range float values are not JSON compliant" and the result of a subset UMAP could not be displayed at all. Non-finite coordinates now cross the wire as null.
  • Figure builder: highlighted cells no longer obscured by overlapping low-expression cells. When a figure panel colored cells by expression (or a numeric/bivariate source) and the highlight overlay was on, an overlapping non-highlighted zero/low-expression cell could be drawn over a highlighted cell and hide its color — visible when zoomed out (e.g. purple min-expression spots covering brown cartilage-highlighted spots). FigurePanel ordered cells by expression value only; it now applies a second stable sort by max highlight weight (matching the main Embedding view), so highlighted cells render on top. Applies to the PNG export too.

Added

  • Multi-section awareness for spatial analyses. Datasets that hold several distinct tissue sections in one coordinate space (e.g. via Combine Spatial Sections, or the toy_spatial_3sections.h5ad dataset) can now tell spatial analyses to respect section boundaries via an optional Section column (section_col), auto-detected from a section or sample .obs column.
  • Contour / Multi-contour interpolate and smooth per section (normalization and band thresholds stay global), so expression never bleeds across the gap between sections; multi-contour conflict resolution only votes with same-section neighbors. Section column dropdown added to the Contour tool.
  • Spatial Neighbors can build a per-section block-diagonal graph (section_col), dropping cross-section edges — which also corrects the downstream Spatial Autocorrelation, Smooth, and Combine Neighbors steps that consume the graph. Exposed via a new obs_column_select parameter type in the Analyze modal.
  • Define Sections (Analyze → Spatial). A floating, non-blocking panel to semi-manually define sections: name a new categorical .obs column, then polygon-select each section on the spatial plot and name it; the cells are labeled via the annotation API. The resulting column feeds the Section column controls above.

Added

  • Cluster Gene Set — honor the active gene mask. The "Cluster genes" dialog (Genes → gene set → ⋯ → Cluster genes…) gains a Restrict to active gene mask checkbox (enabled only when a .var gene mask is active, and showing how many of the set's genes pass). When on, only mask-visible genes are clustered. Backend: cluster_gene_set(..., use_gene_mask=True) + use_gene_mask on the /cluster_gene_set route.
  • Second bundled toy dataset: toy_spatial_3sections.h5ad. Three separated sections of the same limb-bud-like tissue (900 cells × 76 genes, reusing the toy_spatial gene panel) with an obs['section'] label, laid out left-to-right with gaps. For testing (multi)contour and spatial analyses where cross-section spot distances are not meaningful. Deterministic generator at backend/skopia/data/generate_toy_3sections.py.

Changed

  • Unified Contour tool under Analyze → Spatial. Single contourize and multi-contour are now one interface (Spatial → Contour → Open Contour tool…); the standalone "Multi-contour" toolbar button is gone. Pick sources from a gene-set picker popup (any saved gene set, or the current Gene Panel selection): one source produces a banded expression column, two or more produce a fused tissue annotation. Grid resolution and smoothing sigma are prefilled with data-aware suggestions (new GET /scanpy/contour_suggest) for both paths, and log_transform now defaults to off.
  • Analyze modal renamed. Title Scanpy Analysis → Analyze; category tabs Preprocessing → Preprocess, Cell Analysis → Cells, Gene Analysis → Genes, Spatial Analysis → Spatial.

Added

  • Multi-contour tissue annotation (Analyze → Spatial → Contour). Fuse several gene-set contours into a single tissue .obs annotation. Pick ≥2 gene-set modules (e.g. cartilage, muscle, tendon, interzone, skin, dermis); each is contourized independently (low band count by default), then a per-module review step shows a band histogram and lets you pick the "high" cutoff (auto-default = top band). Every spot is assigned the module it's high in: high in exactly one module → that tissue; high in several → resolved by a majority vote among the spot's spatial-graph neighbors ranked by Euclidean distance in X_pca (nearest profile_k, default 15); high in none → unassigned. Ties or spots with no unambiguous neighbors stay unassigned (single pass). Requires X_pca (run PCA first); reuses obsp['spatial_connectivities'] if present, else builds a coordinate-kNN. Optional QC columns (<name>_status, per-module <set>_high). Backend: new pure module backend/skopia/multicontour.py plus two-phase prepare_multicontour (cancellable) / finalize_multicontour (with a server-side score cache) on the adaptor, and /scanpy/multicontour/prepare + /finalize routes; frontend MultiContourModal. The contourize scoring core was extracted into a shared _contour_score_field used by both single- and multi-contour.
  • Contourize parameter guidance. Each contourize parameter now has a tooltip explaining the direction of effect (smoothing vs. detail, band count, log transform), and multi-contour suggests data-aware defaults for grid resolution (≈√N spots) and smoothing sigma (from median spot spacing).

Fixed

  • Frontend tsc/pixi run build no longer fails on import.meta.env. Added the standard frontend/src/vite-env.d.ts (/// <reference types="vite/client" />) so Vite's env typings are picked up; previously the production build's typecheck step errored out.

Added

  • Load 10x Visium HD feature_slice.h5 directly. 10x's public Visium HD downloads ship a compact, self-contained *_feature_slice.h5 (root attr filetype == "feature_slice") instead of a feature-barcode matrix, so scanpy.read_10x_h5 rejected them. Skopia now detects this format and converts it: the per-gene 2 µm expression slices are rebinned to 8 µm tissue bins (using the file's own tissue mask), spatial bin centroids are written to obsm['spatial'], and the precomputed clusterings (graph-based + k-means 2–10) are imported as colorable ordered-categorical .obs columns. Conversion logic lives in the new, independently-tested backend/skopia/visium_hd.py (is_feature_slice, feature_slice_to_anndata, load_feature_slice_cached); the adaptor's .h5 branch routes feature-slice files through it. First load takes ~1–2 min (it reads ~32k HDF5 gene slices); the result is cached as a <name>.skopia.square_008um.h5ad next to the source file (reused while newer than the source; falls back to a temp dir if the source dir is read-only), so subsequent loads are instant. For the Visium HD Mouse Embryo sample this yields 344,021 bins × 32,285 genes. Bin size is a parameter (bin_size=8 default; 16 µm also supported) but the load route currently hardcodes 8 µm — a load-time selector is future work.

Fixed

  • Cells no longer render at phantom positions in PCA / spatial views with >~44k cells. A stride bug in deck.gl 9.2.6's per-cell getPosition accessor path produced a vertical line of cells at X=0 in PCA (where the data has no cells) and made cells appear to "vanish" inside spatial tissues when colored by sparse genes (e.g. Col2a1) — at N ≳ 44k cells, some cells were drawn at (0, X_of_another_cell) instead of their actual position. Workaround in both ScatterPlot.tsx and FigurePanel.tsx: pack positions into a flat Float32Array and feed deck.gl through its binary-attribute API (data: { length, attributes: { getPosition: { value, size: 2 } } }), bypassing the affected code path entirely. Color/radius accessors still use the per-cell logic by looking the cell back up via closure. Minimal reproducer kept at frontend/repro.html (served at /repro.html by the dev server) — use it to verify if any future deck.gl bump fixes this upstream so the workaround can be removed.

Added

  • Coordinate grid toggle in Display Settings. Optional screen-aligned grid behind the cell plot with data-coordinate tick labels along the bottom (X) and left (Y). Snaps to "nice" 1/2/5 × 10ᵏ tick spacing; origin gets a slightly brighter line so X=0 / Y=0 are easy to spot. Updates live as you pan/zoom; ignores pointer events so it doesn't interfere with selection/drawing. Default off. Useful as a troubleshooting aid (was added during the deck.gl phantom-line investigation above).

Added

  • Figure builder — grid overlay, bivariate coloring, highlight-overlay toggle. Three additions to the figure builder: (1) Grid overlay — a checkbox in the toolbar turns on an N×N grid in every panel for visual reference. Color and line width are configurable, applied to all panels. The grid is drawn into the exported PNG too. (2) Bivariate coloring — pick two gene sets (one as red, one as blue) plus a colormap (default / pinkgreen / orangepurple / custom) per panel. Mirrors the main Embedding view's bivariate option. (3) Highlight overlay toggle — a per-panel "show highlight layers" checkbox blends the dataset's current Highlight layers (configured in the Embedding tab's Genes panel) over the panel's coloring.
  • Figure builder — multi-panel publication-quality figures. A new Figure tab next to Embedding/Heatmap. Click Create figure at the bottom of the Cells panel: if cells are selected, those are the figure's cell set; otherwise it falls back to the full dataset. Cell positions are snapshotted at creation, so subsequent filtering / deletion / analysis won't corrupt the figure. The builder shows a grid of panels (1×1 through 3×3 presets) — each panel renders the same cells colored by its own choice of single gene, gene set, or metadata column, with its own color scale (viridis / plasma / magma / inferno / cividis / coolwarm / blues / reds), expression transform (none / log1p), title, background, and border. Point size and opacity are figure-level (shared across panels) — the typical use case is comparing the same cells under different colorings, where varying point size between panels would distract; both controls live in the top toolbar. Pan/zoom is also shared so panels stay aligned. Per-panel stacking: when a panel colors by expression or a numeric metadata column, high-value cells render on top so bright markers aren't occluded by overlapping low-value cells. Export to PNG at 1×–4× DPI scale; output goes to your browser's default download directory with a timestamped filename (e.g. figure_2026-05-19_1937.png). Designed for the typical "compare gene A vs gene B side-by-side over the same tissue section" workflow, eliminating the need to save individual views and stitch them in another program.

Changed

  • Center-panel tab renamed: "Scatter Plot" → "Embedding" — more accurate label for what the view actually shows.
  • Highlight overlay panel: collapsible + more compact. The whole section now collapses behind a chevron with an "N active" badge. Per-layer rows are denser: dropped the redundant GENE/CELLS kind label, moved the threshold-mode dropdown into the header row, combined the threshold value and intensity slider into a single row alongside the histogram. About ~30% less vertical space per layer.

Fixed

  • Embedding view preserves zoom/pan across data refreshes. Previously, any op that re-fetched the embedding (cell delete, filter, normalize) reset the camera to default because the viewState useEffect ran on every bounds change. Now the camera only re-centers when the user explicitly switches embeddings (e.g. spatial → UMAP); in-place data updates keep the user's current view. As a related fix, the cell-delete handler now also re-applies expression coloring (re-fetches with the new cell indices) so the active gene/gene-set coloring stays in place across delete.
  • Highlight overlay no longer scrambles after analyses that change cell count. A useHighlightSync hook watches schema.n_cells and rebuilds layers when it changes: geneset layers auto-refetch their per-cell scores in place (preserving color, intensity, threshold mode; clamping lo/hi into the new range), and cellset layers (selection / category masks) are dropped with a toast since their masks were bound to old cell indices. Previously, ops like filter_cells and delete_cells would shift cell indices and the cached highlight values would point to the wrong cells — the user had to manually remove and re-add each layer.

Fixed

  • Masked cells were silently included in line-association and gene-cluster analyses. When a line had projections (the typical workflow), Find Associated Genes and the multi-line equivalent sent every projected cell to the backend regardless of the active cell mask. Same problem in Cluster gene set: cellContext='selection' didn't intersect with the mask, and 'all' ignored the mask entirely. Now all three paths filter projected/selected indices through activeCellMask before sending; 'all' + mask is converted to 'selection' with the mask-derived indices. Diff exp and scanpy ops already honored the mask. Known gaps that remain (out of scope for this fix): marker genes and heatmap group by obs_column and don't pass a cell-index list, so honoring the mask there needs a new backend param.

Changed

  • Highlight overlay now supports multiple layers, threshold gating, and cell-set sources. The single-color, gradient-weighted overlay has been replaced with a stack of independent layers, each with its own color, intensity, and gating rule. Three ways to add a layer: (1) Gene set — pick a set, threshold via mode (≥, ≤, between) + a draggable histogram cutoff (same UX as Select-by-Expression). Cells passing the threshold get full intensity; others get 0. (2) Selection — snapshot the current cell selection as a frozen mask. (3) Category value — pick a categorical .obs column + value; all cells with that value light up. The Cells panel also has a small color-dot button next to each category value for one-click highlighting. Layers stack in creation order; overlapping cells get color-mixed. The plot still draws highlighted cells on top via a stable sort by max layer weight. Replaces the previous single-overlay UI (one gene set, normalized gradient).

Added

  • Arrow-key nudge in Quilt mode (transform phase) — once you've lassoed a cell subset, press the arrow keys to translate the selection. Step is ~0.2% of the embedding's spatial range per press; Shift+arrow is 10× larger (matches Figma / Illustrator convention). Up/Down move along the data y-axis (math y-up). The handler is no-op when typing in inputs/textareas.

Added

  • Combine spatial sections — a new way to load 2+ spatial-transcriptomics h5ads as one dataset for cross-sample analysis (e.g. comparing the same tissue across two timepoints). Sections are laid out left-to-right along the spatial x-axis with a gap proportional to the mean section width (default 5%); y is unchanged so vertical alignment is preserved. Gene index is the intersection across inputs; a new sample categorical .obs column tags each cell with its source-file label. Per-file UMAPs/PCAs are dropped — run scanpy on the combined adata. New backend route POST /api/combine_spatial (body: {files: [{file_path, label?}], slot, gap_fraction}). New UI: a "Combine sections" mode toggle in the Load modal — click .h5ad files in the browser to build a list with editable per-file labels and an adjustable gap percentage. v1 supports .h5ad files only with obsm['X_spatial']; the route rejects others with a clear error.
  • File menu — new "File" toolbar button (left of Select) consolidating Load, Combine spatial sections, and Export under one dropdown. The standalone Load and Export buttons are gone; everything file-related lives behind one click.

Added

  • Highlight overlay — a third color channel that blends a single user-picked color (default green #22c55e) over whatever the active color mode is (single gene, gene set, bivariate, or metadata), weighted per cell by an independent gene or gene-set score. Use case: demarcate epithelium in green using an epithelial gene set while keeping bivariate red/blue on cartilage/muscle scores. New section in the Gene Panel below "Bivariate Coloring": gene-set picker + color picker + intensity slider + Apply / Clear. The score uses the same per-gene normalization + aggregation pipeline already used by gene-set coloring (configurable in Display Settings). Selected and masked cells are not blended so their visual cues stay intact. Highlight does NOT change colorMode — it's a true overlay. Highlighted cells render on top of the stack via a stable secondary sort by highlight weight inside the deck.gl data array, so the highlight is never occluded by overlapping unhighlighted cells (important for dense plots like spatial transcriptomics).

Changed

  • Drawing a line/shape no longer prompts for a name and does not exit Draw mode. Lines are auto-named "Line N" (sequential by total drawn count) and added immediately to the Shapes panel. The user can keep drawing additional lines without re-clicking Draw — Escape exits draw mode. Lines can still be renamed in-place from the Shapes panel.
  • Adjust → Rotate is no longer Shift-gated and rotates around the data centroid, not the viewport center. In Rotate mode, plain drag rotates; the cursor angle is measured relative to the data centroid (projected to screen), so cursor motion corresponds 1:1 to applied rotation. A faint orange dashed ring at the pivot and a live angle badge appear during the drag. Hold Shift to snap to 15° increments. The status row's "Flip X / Flip Y" buttons (Rotate mode only) are replaced with a rotation widget: ↺/↻ 90° quick buttons + a numeric input that accepts a precise degree value (Enter or Apply). Quilt mode's flip buttons are unchanged (they're contextual to the transform phase).
  • Adjust dropdown now has a third section: Flip → Flip Horizontal / Flip Vertical as one-shot actions (no mode entry). Flip Horizontal mirrors left↔right (reflects about the y-axis); Flip Vertical mirrors top↔bottom (reflects about the x-axis). Tooltips include the math description for users who think in terms of axes. If Quilt has a current selection, the flip applies only to those cells; otherwise it flips the whole embedding around its centroid.

Added

  • Categorical coloring now honors adata.uns[f"{col}_colors"] (the scanpy/cellxgene convention). When a categorical .obs column has a pre-assigned color list, the scatter plot legend and per-cell fills use those exact hex values instead of the default palette. Loading an h5ad from scanpy / cellxgene / Seurat-via-SeuratDisk with stored cluster colors will now display those colors directly. Per-category colors are exposed on GET /api/obs/{col} (colors: string[], positional) and GET /api/obs/summary/{col} (per-entry color). Label merges (POST /api/obs/{col}/merge_labels) rebuild the _colors list so palette state survives — the merged label inherits the existing fold-into target's color when folding into an existing label, otherwise the first merged label's color.

Changed

  • Categorical palette is now length-aware. When adata.uns[f"{col}_colors"] is absent, skopia still uses the d3-cat10 palette for the first 10 categories (existing aesthetics) and extends with golden-angle HSL hue stepping beyond that. Columns with >10 categories no longer wrap and produce duplicate colors — every category gets a unique color regardless of count.

Fixed

  • Annotations created mid-session (Add Annotation in the Cells panel, Label cells from Select by expression) now appear in the Compare Cells column dropdown — and in any other picker that reads schema.obs_dtypes, including the Heatmap config column picker. Previously, only useObsSummaries was refreshed after annotation creation, so the in-memory schema stayed stale until a page reload. Now createAnnotation flows re-fetch the schema via a shared refreshSchema() helper, the same way Scanpy operations already do.
  • Gene list import (JSON) now accepts the geneset-builder export schema (top-level object with a sets array) in addition to the legacy top-level array. It also tolerates per-gene objects of shape {symbol, from} (the raw .gsb.json project file shape), so a project file copied or renamed alongside a proper export still imports cleanly. Previously, any JSON whose top level wasn't an array failed with No gene lists found in <file>.
  • Marker genes (Compare Cells with 3+ groups) could return gene names that didn't exist in .X, causing "Gene not found in dataset" when trying to color cells by them. Root cause: run_marker_genes called scanpy.tl.rank_genes_groups without use_raw=False. When the loaded h5ad had a populated adata.raw with a larger gene set than adata.X (e.g., a curated dataset where .X was trimmed but .raw kept the full transcriptome), scanpy's default use_raw=True silently pulled marker names from .raw.var_names. Those names were unreachable for visualization (which reads from .X), and worse, the marker list could include genes the user had explicitly removed via exclude_genes. Now uses use_raw=False, matching the two-group diff-exp path which was already correct. Existing saved marker gene sets still contain the stale names; re-run Compare Cells to get a clean set.
  • Pass activeSlot explicitly to runMarkerGenes, useDiffExp.runComparison, and ScanpyModal's Compare-Cells diff-exp call. (Defensive — appendDataset already auto-defaults to the store's activeSlot, but the explicit thread makes slot intent obvious at the call site.)
  • Select → Lasso could silently stop drawing after switching between Lasso and Polygon. handleMouseDown's useCallback deps array omitted selectionTool, so once the user had selected Polygon and then triggered any other dep change (toggling interactionMode, etc.), the handler stayed bound to a stale closure with 'polygon' captured and returned early on every drag — leaving the user in "lasso mode" by the toolbar but with dragging doing nothing.
  • Cell selection from Contourize annotations (and any other categorical .obs column with non-string category values) now works. Clicking a contour level in the Cells panel selects the corresponding cells; the same fix unblocks the "Compare Cells" picker in the Scanpy modal for these columns. The bug was a wire-format mismatch — /api/obs/{col} returned raw float categories while /api/obs/summary/{col} stringified them, so the frontend's indexOf lookup never matched.
  • Segmented-line draw tool: the first segment is now drawn on the first try. Previously, selecting "Segmented Line" from the Draw dropdown after already being in draw mode left handleMouseDown / handleMouseUp bound to a stale drawTool closure (they didn't list drawTool as a useCallback dep), so the first click followed the pencil code path, cleared the line points, and the segmented line never accumulated points until the user toggled Draw off and on.
  • Line association (clustering off): the results modal now renders the significant genes as collapsible Increasing/Decreasing cards, shows filter controls (min R², min amplitude, max FDR) for them, and enables "Add to Gene Sets" — previously the modal showed "No significant genes found" and the button was silently disabled because the old list-view path only handled module output.
  • Spatial Autocorrelation no longer errors with Expected n_perms to be positive, found 0 when Permutations is set to 0. The modal already documented 0 as the "analytical only" setting; the backend now translates n_perms=0 to None (squidpy's analytical-only path) before dispatch.

Changed

  • Display Settings → Gene Set Aggregation is now an explicit pipeline rather than a single Z-score toggle. Pick a per-gene normalization (None / Z-score MAD / Z-score SD / Min-max / Rank → [0, 1]) and an aggregation (Mean / Median / Sum / Max); a per-gene clip slider appears when Min-max is selected. Same pipeline drives both single gene-set coloring and each axis of bivariate coloring (Contourize is unchanged). Defaults reproduce the previous Z-score+Mean behavior. The old scoring_method request param is gone — replaced by per_gene_norm, per_gene_clip, aggregation.
  • Line association, "Add to Gene Sets" without clustering: now saves a single combined gene set named Associated genes (N) inside the per-run folder, instead of two separate Increasing / Decreasing sets. With clustering on, one set per module is still created.
  • Overflow (⋯) menu popup on gene rows inside an expanded gene set is no longer clipped by the gene set container's rounded-corner mask — the popup now escapes ancestors with overflow: hidden and closes on scroll
  • Stale cell state after filter_cells no longer corrupts downstream features: cell selection, expression coloring cache, and bivariate expression cache are all cleared when cells are removed, and the Select cells by expression modal defensively clamps any out-of-range indices before handing them to the backend
  • Single-line gene association (gear icon in Shapes) now uses the line's projected/linked cells instead of the global cell mask, so only cells actually linked to the line are tested
  • Fixed B-spline regression in line gene association: removed redundant intercept column that caused multicollinearity with the B-spline partition of unity, producing unreliable F-statistics and missing significant genes

Changed

  • Combine Neighbors no longer overwrites the expression kNN by default. The Analyze → Cell Analysis → Combine Neighbors modal now has an "Output graph name" input (defaulting to combined_connectivities); the result is written to obsp[name] instead of unconditionally clobbering obsp["connectivities"]. A _connectivities suffix is auto-added if missing so the new graph shows up in pickers (Smooth, future Combine runs). Picking the literal name connectivities keeps the old behaviour (overwrites the expression kNN and re-points Leiden / UMAP to the combined graph) and shows an inline yellow warning so users know what they're doing.

Added

  • In-plot Source: layer dropdown for visualization. A new dropdown appears in the bottom-left of the main scatter view (alongside the Embedding selector) whenever the active dataset has any non-X layer (typically after running Preprocess → Smooth). Picking a layer reroutes single-gene, gene-set, and bivariate coloring through that layer so you can visually inspect smoothed (or any other layered) values without modifying .X. The selection is per-dataset, persists for the session, and falls back to .X (default) if the chosen layer disappears (e.g. after reloading the dataset). Single-gene, multi-gene aggregation, and bivariate expression endpoints all gained an optional layer argument that overrides transform when set.
  • kNN smoothing in Preprocess → Smooth. New Scanpy modal entry that smooths gene expression over any cell-cell kNN graph in obsp (Spatial Neighbors, Cell Neighbors, or a Combined graph). Algorithm: one or more iterations of S ← D⁻¹·(A + α·I)·X where α is the self-loop weight. The result is written to adata.layers[output_layer] (default smoothed) — .X is not modified. To use the smoothed values, pick the new layer from the Source matrix dropdown that now appears on Gene PCA, Gene Neighbors, and the Cluster Genes modal. New endpoints: POST /api/scanpy/smooth, GET /api/scanpy/layers. New optional layer parameter on POST /api/scanpy/gene_pca, POST /api/scanpy/gene_neighbors, and POST /api/cluster_gene_set (defaults preserve the historical .X behavior).
  • DBSCAN added as a third method in the Cluster genes modal, alongside Hierarchical (Ward) and K-means. Picking DBSCAN replaces the K input with two new inputs: eps (neighbor radius in correlation-distance space, default 0.3 — i.e. genes are considered neighbors when their Pearson correlation is at least 0.7) and min_samples (minimum genes within eps for a gene to seed a cluster, default 3). Unlike K-based methods, DBSCAN discovers the number of clusters from the data; genes that fail the density threshold are returned as a trailing "noise" sub-cluster.
  • Display Settings defaults configurable via ~/.skopia/config.yaml. New display: section accepts point_size, point_opacity, background_color, color_scale, bivariate_colormap, expression_transform, clip_percentile, gene_set_per_gene_norm, gene_set_per_gene_clip, gene_set_aggregation. Defaults are applied to every dataset slot at startup and again on each fresh dataset load. Unknown keys are silently ignored. Sample updated in docs/config.example.yaml. Restart required to pick up edits.
  • Rename and merge category labels in any categorical .obs column (Contourize results, Leiden, user annotations, original metadata). Double-click a label name in the Cells panel to rename it inline. Click the ⋯ menu on a column header → "Merge labels…" to open a small modal that lets you pick 2+ labels and choose the merged name. Renames refuse name collisions (the toast suggests using merge instead); merges fold into an existing target label if you pick its name. New endpoints: POST /api/obs/{column}/rename_label, POST /api/obs/{column}/merge_labels.
  • Color-ramp clip percentile slider in Display Settings (0–5% in 0.5 steps, default 1.0). Controls symmetric percentile clipping for color-ramp anchors across single-gene, gene-set, and bivariate coloring. Set to 0 to disable clipping entirely. Single-gene expression now honors this setting too (previously it had no clipping).
  • Raw-counts snapshot on load: when a dataset is loaded and adata.X looks like non-negative integer counts (detected from a bounded random sample), adata.X is copied into adata.layers["counts"] (only if that layer doesn't already exist). Default expression paths still read from adata.X; this is purely defensive so downstream tooling can reach raw counts after normalize/log1p is run in-session. Also sets adata.uns["skopia"]["counts_inferred"] = True.
  • User-editable config file for parameter defaults at ~/.skopia/config.yaml (or .yml / .json, or $SKOPIA_CONFIG_PATH). Override the default values for any Scanpy modal param (scanpy.<function>.<param>) or the Line Association form (line_association.<param>) without touching code. Missing file is fine — hardcoded defaults apply. Requires a backend restart to pick up edits. Sample at docs/config.example.yaml. New endpoint: GET /api/config/defaults.
  • Gene sets now survive accidental browser reloads: the full gene-set category / folder / set tree is persisted on the backend process (server-lifetime, matches how drawn lines work) and rehydrated when the tab loads. The frontend debounce-saves on every mutation. Does not persist across backend restarts. Endpoints: GET /api/gene_sets, PUT /api/gene_sets.
  • Line association results modal now has a Download CSV button that exports per-gene stats (gene, f_stat, pval, fdr, r_squared, amplitude, direction) for every gene tested — not just the top/significant ones. Suitable for running GSEA or other external ranked-list analyses. The backend response gains an all_genes field carrying the full table.
  • Combine Neighbors (Analyze → Cell Analysis): weighted combination of multiple cell kNN graphs (e.g. expression neighbors + spatial neighbors). Each graph is max-normalized before weighting so graphs with different edge scales contribute proportionally to their weight, then summed and symmetrized. The result replaces obsp['connectivities'], so downstream Leiden/UMAP run on the combined graph with no further configuration. Default weights are equal across selected graphs and are user-editable.
  • Line association: new "Cluster genes into modules" checkbox in the Gene Association section of Line Tools (single-line and multi-line). Default is off — only positive/negative gene lists are returned. Turning it on runs the existing profile-shape clustering (increasing, decreasing, peak, trough, complex).
  • Line association: results now land in their own Line Association category in the Gene Panel, with each run of "Find Associated Genes" creating its own folder named after the line(s) and a timestamp. Gene sets inside the folder are one-per-module (clustering on) or one-per-direction (clustering off).
  • PCA Loadings explorer (Analyze → Cell Analysis): scan a scrollable table of top +/− loading genes per PC, then create derived PC-subset embeddings (X_pca_noPC2_5, etc.) that exclude selected PCs. The Neighbors step gained a PC source dropdown that routes through any derived subset via use_rep; UMAP and Leiden inherit the choice automatically through the neighbors graph. Re-running PCA auto-clears stale derived subsets with a toast.
  • Gene Mask: per-dataset, session-only filter that hides genes in the Gene Panel based on .var boolean columns (e.g. highly_variable, spatially_variable, mt). Opens from the Gene Panel ⋯ → Gene mask…. Supports per-column Off/Keep/Hide toggles with configurable Keep-combine mode (ANY or ALL). Filters gene browse, search, expanded gene set rows, and gene set score aggregation. Existing analysis operations (Diff Exp, Marker Genes, Gene PCA, etc.) are unaffected and retain their own gene_subset dropdowns.
  • Select cells by expression threshold from gene and gene set ⋯ overflow menus. Interactive histogram with Above / Below / Between threshold modes; Update-selection action supports Replace / Add / Intersect; Label-cells action creates an annotation column with customizable high/low labels and context, and hands off directly to differential expression for the newly labeled groups.
  • Overflow menu (⋯) on gene set and folder rows, consolidating Pin/Unpin and other secondary actions. On manual folder rows, the per-folder export moves into this menu as an Export ▸ submenu.
  • "Cluster genes…" action in the gene set overflow menu: sub-cluster a chosen gene set into K groups by expression pattern using hierarchical (Ward / correlation distance) or K-means. Supports running over all cells, the current lasso selection, or an annotation category. Results appear as a new folder under Gene Clusters.
  • Manual gene set folders in the Gene Panel: create via a + 📁 button, rename via double-click, delete with a confirm dialog for non-empty folders. Sets can be created directly inside a folder or dragged in from the top level.
  • Drag-reorder for gene sets (within the Manual category) and folders (in any category), with a teal insertion indicator above/below the drop target.
  • Pinning for gene sets and folders: float an item to the top of its container via the ⋯ overflow menu. Pin state survives moves but is not exported.
  • Hide/unhide for gene set categories: the 👁 button hides a whole category; a footer at the bottom of the Gene Panel lists hidden categories with per-category Unhide buttons.
  • Per-folder export for manual folders to JSON, GMT, or CSV via the ⋯ overflow menu Export ▸ submenu on the folder row.
  • Support for loading prefixed 10x file trios (e.g. GSM1234_barcodes.tsv.gz, GSM1234_features.tsv.gz, GSM1234_matrix.mtx.gz) common in GEO accessions — detected automatically in the file browser and loadable like standard 10x matrix folders
  • Header now shows the loaded data filename above cell/gene counts, with stacked stats layout
  • GitHub icon link and Docs link in the header for quick access to the skopia repository
  • Compare Cells feature in Analyze > Cell Analysis: select an .obs column, check 2+ groups, and run pairwise differential expression or marker gene analysis directly from the Analyze modal
  • Lasso draw tool: draw closed freehand shapes in Draw mode (like pencil but always creates a closed shape)
  • Polygon selection tool for Select mode: click vertices to define a polygon selection area, double-click to close and select cells inside
  • Select button dropdown (replaces Lasso button): choose between Lasso (freehand) and Polygon (click-based) selection tools
  • Adjust button dropdown: combines Rotate (formerly Adjust) and Quilt into a single toolbar dropdown

Changed

  • Pin icons (📌) and the folder export icon (⬇) are no longer direct-click buttons on gene set / folder rows; they live inside the new overflow (⋯) menu. Functionality is unchanged.
  • Renamed "Lasso" toolbar button to "Select" with tool dropdown for lasso and polygon selection
  • Renamed "Lines" panel to "Shapes" with updated empty-state messages
  • Renamed Adjust mode to "Rotate" within the new Adjust dropdown
  • Merged Adjust and Quilt buttons into a single "Adjust" dropdown
  • Cell Panel checkboxes now select cells (like lasso) instead of marking for comparison
  • Removed standalone "Compare" toolbar button; comparison feature is now accessed via Analyze > Cell Analysis > Compare Cells
  • Fixed Draw button dropdown arrow alignment (was appearing below the button)
  • Standardized draw tool instructions across all tools to consistent "Click and drag to..." / "Click to add..., double-click to..." format
  • Backend schema now includes filename field

Previously Added

  • Cancel button for long-running analysis operations (gene neighbors, spatial neighbors, spatial autocorrelation, contourize, line gene association). Operations run in the background and can be stopped without corrupting session data.
  • Line Association: analysis parameters (spline knots, FDR threshold, max genes per module) are now configurable in the Line Tools modal before running "Find Associated Genes"
  • Line Association results modal: interactive filter controls for minimum R², minimum amplitude, maximum FDR, and pattern type toggles to refine results after analysis
  • Multi-line combined association analysis: check multiple lines with projected cells in the Lines panel, then run a pooled "Find Associated Genes" across tissue sections or replicates. Per-line direction reversal ensures consistent biological axis alignment.
  • Cell Panel: clicking a category value to select cells now highlights that row with a teal left border, making the selection source visible

Previously Added

  • Draw tool subtypes: pencil (freehand), polygon (click vertices, double-click to close), segmented line (click points, double-click to finish), and smooth curve (Catmull-Rom spline through control points). Select via dropdown arrow next to the Draw button.
  • Per-shape appearance customization: stroke color, line width, fill color (with transparency), and open/closed toggle. Accessible via the gear icon (Line Tools) on each line in the Lines panel. Changes apply immediately and persist.
  • Gene subset selection across all gene-level analyses: Differential Expression, Marker Genes, Gene PCA, Build Gene Graph, Gene Neighbors, and Spatial Autocorrelation all now default to using highly variable genes (HVG) if defined, with an option to switch to all genes. This reduces multiple testing burden and makes results more interpretable.
  • Pearson correlation metric for Gene Neighbors analysis
  • Differential Expression modal now has customizable parameters for scanpy's rank_genes_groups (test method, p-value correction) and filter_rank_genes_groups (min fold change, max p-adj, min/max group fractions), with a "Re-run" button to adjust and re-analyze
  • Load 10x CellRanger matrix folders (filtered_feature_bc_matrix/ etc.) directly from the file browser. Folders containing matrix.mtx(.gz), barcodes.tsv(.gz), and features.tsv(.gz) or genes.tsv(.gz) appear as loadable items.
  • Exclude Genes in Scanpy → Preprocessing: remove genes by exact name or regex pattern (e.g. ^mt- for mitochondrial, ^Gm\d+ for predicted genes). Enter gene names (one per line) and/or comma-separated regex patterns.
  • PCA variance bar chart in Scanpy → Cell Analysis → Neighbors: shows % variance explained per PC with cumulative line and elbow detection to help choose the number of PCs for kNN computation.
  • Gene identifier column switching: dropdown in Gene Panel header to switch between .var columns (e.g., Ensembl IDs vs gene symbols) when alternatives are available. Gene sets and selections are automatically remapped.
  • CahanLab logo in header now links to https://cahanlab.org/

Changed

  • Renamed "Scanpy" toolbar button to "Analyze"
  • Preprocessing function order: Exclude Genes → Filter Cells → Filter Genes → Normalize → Log1p → HVG
  • Updated defaults: Exclude Genes regex patterns (^mt-, ^Gm\d+, ^Rps, ^Rpl), HVG max mean (6), Gene Neighbors (basis: expression, neighbors: 10, default subset: HVG), Cluster Genes (resolution: 2.0, column: gmod)
  • Compare button now resets to inactive state after returning results
  • Load modal redesigned with Finder-inspired two-column layout: sidebar with quick-access shortcuts (Home, Desktop, Documents, Downloads) and recently loaded files, breadcrumb path navigation for clicking any ancestor directory
  • Gene Panel: more compact layout with reduced padding, Browse button moved to header next to Import, empty auto-generated categories (Gene Clusters, Similar Genes, etc.) hidden until populated
  • Cell Panel: lasso selection is now cleared after running a lasso-based comparison (Set as Group 1/2 → Compare)

Fixed

  • Expression coloring errors (e.g., "Gene not found") no longer block the scatter plot. The error appears as a dismissable toast that auto-clears after 5 seconds, and the color mode resets so the app remains usable.
  • When a dataset is loaded with no embeddings, the message now says to use Scanpy to create embeddings, instead of the misleading "No data loaded" message.
  • Cell Panel now properly refreshes when switching between datasets or loading a new dataset
  • Support for loading .rds files containing Seurat objects. Requires R and the Seurat/SeuratDisk R packages to be installed. RDS files are automatically converted to h5ad format on load.
  • Load 10x Genomics Cell Ranger .h5 files in addition to .h5ad files. The file browser now shows both formats, and the Load modal accepts either.
  • Gene Neighbors basis selection: choose between gene PCA embeddings or raw expression as the basis for computing gene-gene neighbors. When using expression basis, optional gene subset filtering and z-score scaling are available. This lets you compare PCA-based and expression-based gene similarity results.
  • Quilt mode undo: after rearranging cells in quilt mode, click the "Undo" button or press Ctrl/Cmd+Z to revert the last transform. Supports multiple levels of undo within a quilt session. The undo stack resets when exiting and re-entering quilt mode.
  • Quilt mode: a new interaction mode for rearranging tissue pieces in spatial transcriptomics data. Click "Quilt" in the toolbar, lasso a group of cells, then drag to translate, shift+drag to rotate, or use flip buttons to reposition the selected patch. Press Escape to re-select, or Escape again to exit. Transforms persist in h5ad export.
  • Side-by-side dual scatter plot view: click "Split" in the toolbar to view both primary and secondary datasets simultaneously. Click a plot to make it the active dataset. Each plot has independent pan/zoom, its own embedding selector, and its own legend. Interaction tools (lasso, draw, adjust) work on whichever plot you click. Gene and gene set coloring applies to both plots simultaneously.
  • Embeddings created by Scanpy (PCA, UMAP) are now automatically selected for viewing, even when the dataset had no embeddings initially.
  • Backend multi-dataset support: load multiple datasets into named slots (primary, secondary, etc.). All API endpoints accept an optional ?dataset= query parameter. New GET /datasets and DELETE /datasets/{slot} endpoints for managing loaded datasets. Existing single-dataset usage is unchanged.
  • Dataset slot selector in Load modal — load a second h5ad file into the Secondary slot without losing the Primary dataset.
  • Dataset switcher dropdown in header toolbar (appears when two datasets are loaded) — switch between primary and secondary views seamlessly.
  • Contourize spatial analysis: assign cells to spatial expression contour levels based on a gene set. Select genes in the Gene Panel, open Scanpy Modal > Spatial Analysis > Contourize, configure smoothing and contour levels, and run. Creates a new categorical obs column that can be used for coloring and downstream analysis.
  • One-vs-rest marker gene analysis: click "Markers" on any categorical column in the Cell Panel to identify marker genes for each group using Wilcoxon rank-sum test. Select groups, set top N genes, and optionally apply fold-change and expression fraction filters. Results can be added as gene sets to the new "Marker Genes" category in the Gene Panel.
  • Additive lasso selection: hold Shift while drawing multiple lasso shapes to select non-adjacent groups of cells without losing the previous selection.
  • Embedding rotation and reflection controls ("Adjust" interaction mode): shift+drag to rotate, flip X/Y buttons. Transforms modify adata.obsm in place and persist in h5ad export.
  • JSON import support in Import Gene Lists modal (.json files round-trip with export).
  • Preferred embedding auto-selection on dataset load: spatial > umap > pca (case-insensitive substring match).

Changed

  • Loading a dataset no longer reloads the page; the store is updated in-place for seamless transitions.
  • All frontend API calls now include ?dataset= query parameter when targeting the secondary dataset slot.
  • Replaced "Markers" button and "G1"/"G2" group buttons on categorical columns with checkboxes and a unified "Compare" button in the header toolbar. Check 2 categories for pairwise differential expression, or 3+ for one-vs-rest marker gene analysis. Checked categories are pre-selected in the Marker Genes modal.
  • Renamed "Shapes" panel to "Lines" panel.
  • Line tools (smoothing, gene association, projection embedding) moved from an inline section that obscured the panel into a dedicated modal, launched via a gear button on each line row.
  • Lines panel is now collapsible (click the header to toggle).
  • Cells (left) and Genes (right) panels are now horizontally collapsible. Collapsing either or both gives more space to the scatter plot.

Fixed

  • Gene set export now includes genes from all categories and folders (previously only exported the legacy flat list, which was often empty).