Label the platelet cluster as platelets, not DC - #98
Merged
Conversation
tutorials/generate_plots.py carried Seurat's nine new.cluster.ids while this pipeline resolves eight — DC merges into CD14+ Mono at resolution 0.5 — and rename_idents is positional, so every label from position 7 on slid by one. The 14-cell platelet cluster (PPBP 5.85, FCER1A 0.00) was captioned "DC" in the annotated UMAP, the tutorial's headline figure, and "Platelet" was never applied to anything. This shipped in 1.0.0. The rest of the repository already had it right: pbmc3k_tutorial.md prints the corrected eight-entry map beside the figure drawn from the stale one, and tutorials/README.md states all 32 DC cells land in CD14+ Mono. The file that draws the pictures was the one that lagged. The guard test existed and was correct — it just never ran, because test_tutorial_smoke.py is opt-in and excluded from CI. It now also asserts that the map's keys are exactly the cluster ids produced, which names a length mismatch directly rather than inferring it from a marker landing in the wrong cluster; the old assertion reported this as "FCER1A is highest in CD14+ Mono", which describes the clustering and reads like a false alarm. Seven figures regenerated: dropping DC from the label set also shifts the alphabetical palette assignment, so the cluster-coloured panels move too. 10_marker_heatmap.png correctly does not — it restores cluster numbers first. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Three claims outlived the 9 -> 8 cluster change: * the caption directly beneath the annotated UMAP said "the biological result — 9 identical cell types — is the same", contradicting Step 11 and the fidelity table on the same page; * tutorials/README.md said the tutorial annotates nine; * ROADMAP.md recorded the earlier label transposition as guarded by test_cell_type_map_matches_the_markers, which this recurrence disproves — the assertion was correct and never ran. The caption also explained the differing cluster numbering as Louvain being "non-deterministic by cluster ID". Both tools number clusters by descending size (R: 711, 478, 471, 344, 270, 164, 154, 32, 14 — truecell: 692, 515, 458, 344, 301, 159, 155, 14, verified from r_anchors.json and the pipeline), so the keys differ because the sizes do. R's cluster 7 is the 32-cell DC and its 8 the 14-cell platelets; truecell's 7 is those same platelets. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Author
|
Smoke suite against the fix: 26 passed, 11m02s. Against the pre-fix run of 24 passed / 1 failed. The count goes 25 → 26 because CI: |
This was referenced Aug 7, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found by running the opt-in tutorial smoke suite before cutting 1.1.0.
test_cell_type_map_matches_the_markersfailed with:The defect
tutorials/generate_plots.pycarried Seurat's ninenew.cluster.idswhilethis pipeline resolves eight — DC merges into CD14+ Mono at resolution 0.5,
the split #97 documented.
rename_identsis positional, so every label fromposition 7 on slid by one:
"DC" in the annotated UMAP, the tutorial's headline figure
Per-cluster means, from the pipeline this PR fixes:
The cluster wearing the DC label is platelets, and the real DC cells are inside
CD14+ Mono, which is what "absorbed at this resolution" means.
The cluster sizes make it exact. Both tools number clusters by descending size:
R's cluster 7 is the 32-cell DC and its 8 the 14-cell platelets. truecell's 7 is
those same 14 platelets — and was wearing R's label for position 7.
This shipped in 1.0.0. Verified by running the same test against the
v1.0.0tag in a worktree, where it fails identically — not a regression fromthe recent review work.
The part worth reading twice
The rest of the repository already had it right.
pbmc3k_tutorial.mdprints thecorrected eight-entry map directly beside the figure drawn from the stale
one, and
tutorials/README.mdstates that all 32 DC cells land in CD14+ Mono.One file lagged, and it was the file that draws the pictures.
The guard test existed and was correct. It never ran:
test_tutorial_smoke.pyis opt-in and excluded from CI by design, so nothing failed for a whole release
cycle.
Commit 1 — the fix
CELL_TYPE_MAPreduced to the eight clusters the pipeline actually produces,with a comment tying it to Step 12 of
pbmc3k_tutorial.md— the two are thesame map written twice.
run_pipelinesplit sorun_pipeline_unlabelledexposes the object while theidents are still numeric. After the rename the question cannot be asked: a map
of the wrong length looks exactly like a map of the right one.
assertion reported this defect as "FCER1A is highest in CD14+ Mono", which
describes the clustering rather than the labelling and reads like a false
alarm about a merge. The new one names the actual fault.
FCER1A peaks stays a question about labelling. DC keeps its panel entry: it is
the canonical marker list, not a description of what was resolved.
Figures. Seven regenerated. Dropping DC from the label set also shifts the
alphabetical palette assignment, so the two cluster-coloured panels move
alongside the five that carry text.
10_marker_heatmap.pngcorrectly doesnot — it restores cluster numbers before drawing. Confirmed these diffs are
all mine: regenerating on untouched
mainin a worktree produces byte-identicalfigures, so nothing here is pre-existing drift.
Commit 2 — the prose that counted the same nine
Three claims outlived the 9 → 8 change:
pbmc3k_tutorial.mdcaptiontutorials/README.mdROADMAP.mdtest_cell_type_map_matches_the_markers"The first sat directly beneath the mislabeled figure, contradicting Step 11 and
the fidelity table on the same page. The third is disproved by this PR existing:
the assertion was correct and never ran, so the entry now says that a correct
assertion nobody runs is not a guard, and that the standing gap is the gate
rather than the assertion.
That caption also explained the differing cluster numbering as Louvain being
"non-deterministic by cluster ID". It is not — both tools number by descending
size, as above, so the keys differ because the sizes do.
docs/fidelity.mdanddocs/quickstart.mdneeded nothing: #97 already put themat eight-vs-nine and ARI 0.899. The root README makes no cluster-count claim.
Verification
Mutation-tested, and the two guards discriminate:
tests/test_docs.py18 passed — the site still builds--strictTRUECELL_TUTORIAL_SMOKE=1suite re-running against the fix; result tobe posted below. The pre-fix run was 24 passed / 1 failed, that one failure
being this defect.
Worth considering separately
The pbmc3k portion of the smoke suite needs only the 24 MB dataset and ran in
15 seconds. "Run it before cutting a release" is a gate that only works if
someone remembers; this is the second release cycle where a labelled figure went
out wrong. Caching that one dataset in CI would close it.
🤖 Generated with Claude Code