Repository navigation
Visium atlas tutorial + TableAdapter, parallel to_anndata with covariates - #28
Merged
Merged
Conversation
…ction and per-member transform
…rapids-singlecell + Harmony)
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Documentation build overview
10 files changed ·
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #28 +/- ##
==========================================
+ Coverage 92.15% 92.24% +0.08%
==========================================
Files 18 18
Lines 1466 1508 +42
==========================================
+ Hits 1351 1391 +40
- Misses 115 117 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
… reasons in uns; tutorial uses OrthologAdapter
This was referenced Oct 23, 2026
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.
Summary
First tutorial that builds something on top of the whole catalog: every Visium Spatial Gene Expression table (4,008 sections, 7 mammals) goes through the client into one integrated, GPU-computed atlas. The tutorial asks whether spots cluster by species or by organ.
Client:
to_anndata()/concat_tables()New keyword arguments. Defaults keep the current behaviour.
max_workers: members are read in parallel. Reading all 4,008 Visium tables with 16 workers takes about 85 minutes.obs_columns: catalog columns (organism, tissue, …) are copied intoobsas categoricals.elements: reads only some table elements, e.g.("X", "obs", "var"), so duplicate count layers aren't downloaded.adapter: a newTableAdapterprotocol, the table-level counterpart ofTaskAdapter.requirements()sets the elements to read,validate_meta(row)runs before the download,validate(adata, row)runs on the table as read, andbuild(adata, row)maps the table into the shared space (Nonedrops the member). Skipped members and their reasons are recorded inuns["sddb"]together with the adapter's name and version.Tests cover parallel ordering, the unknown-column error, element selection, adapter skips at both stages, build returning
None, requirements selecting elements, and the protocol check.Closes #29.
Tutorial:
docs/guides/visium-atlas/pixi.tomlandpixi.lock: CUDA 13 / RAPIDS 26.10 plus the prebuiltrapids-singlecell-cu13wheel, following rapids-singlecell's recommended conda env. Nothing is compiled.PYTHONNOUSERSITE=1stops~/.localCUDA wheels from shadowing the env.2026-10-22) and reads tables only.OrthologAdapter(the referenceTableAdapter) (Ensembl Compara 116), keyed by Ensembl ID prefix. This handles rat sections aligned to mouse andGRCh38_-prefixed IDs.all_neighborskNN graph and UMAP, on all 10.6M spots.nb_execution_modeisoff, so RTD renders the committed outputs. The run was done on the Helmholtz HPC.Result
After Harmony, spots group by organ: brain/cortex, liver, kidney, heart and gut each form their own region, with human and mouse mixed inside each. Spots do not split by species.
Test plan
pytest: 328 passed, 4 skippeduns["sddb"]), 10.6M spots. Read + map took about 60 minutes, preprocessing to PCA about 20 minutes, and integration plus plots about 6 minutes.Follow-ups: #30 (streaming/cached
to_anndata), #31 (embedding contract and evaluation), theislab/spatialdata-db#241 (normalize gene IDs at ingest).