Repository navigation
convert: 10x and STARsolo Matrix Market folders, in and out - #49
Conversation
Fixes #24. `adata convert FOLDER -o out.h5ad` reads the folder shapes Cell Ranger and STARsolo write -- Cell Ranger 3 (features.tsv), Cell Ranger 2 (genes.tsv, a subfolder per genome), STARsolo Gene/GeneFull, and STARsolo Velocyto (spliced/unspliced/ambiguous -> layers, X a copy of spliced) -- each file plain or gzipped, under one GEO-style prefix or none. `--to 10x-mtx` writes a gzipped Cell Ranger 3 folder back. Import streams through formats/mtx in two passes: the first checks the folder (barcode and feature counts, every entry) before any output exists, the second writes X, straight through when entries arrive in barcode order and through on-disk buckets when not. The result matches scanpy's read_10x_mtx(gex_only=False) column for column, checked in test_external_readers, except that integer counts stay integers. The 10x HDF5 flags apply (--genome, --var-names, --make-unique, --feature-type, --split-feature-types), plus --compression. Also a benchmark case against scanpy, perf guards (linear work, flat write calls on import, flat read calls on export), and docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A work directory reused across tiers handed one tier's sidecar to the next: a ci run measured the smoke tier's MTX folder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 660cf1ef78
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes #24. Part 3 of 3, stacked on #48 (and through it on #47).
adata convert FOLDER -o out.h5adreads every folder shape Cell Ranger and STARsolo write:features.tsv);genes.tsv, with a subfolder per genome);GeneandGeneFull;Velocyto, wherespliced,unsplicedandambiguousbecome layers and X is a copy ofspliced.Each file may be plain or gzipped, under one GEO-style prefix or none.
--to 10x-mtxwrites a gzipped Cell Ranger 3 folder back.scanpy.read_10x_mtx(gex_only=False)column for column, except that integer counts stay integers.--genome,--var-names,--make-unique,--feature-type,--split-feature-types), plus--compression.Tests
tests/test_mtx.pyuses hand-written fixtures for every layout. It covers entry order, duplicates, real values, prefixes, genomes, velocyto, run metadata in both directions, refusals, the export round trip (byte-identical after decompression), CSR/CSC/dense export, and overwriting.tests/test_external_readers.py(integration) checks against scanpy for:--make-unique;All of these pass locally.
Perf guards: linear work for sorted, shuffled and split input, flat write calls on import, and flat read calls on export.
Benchmark: new case
import-10x-mtx, against scanpy'sread_10x_mtxfollowed by a write. At thecisize (50M entries, warm cache, run locally):Python's peak was 222 MB at both 5M and 50M entries.
Not yet done: a run on a real STARsolo folder from a cellgeni ticket.
🤖 Generated with Claude Code