Repository navigation
--feature-type takes a 10x input with no types as gene expression (#127) - #128
Conversation
--feature-type and --split-feature-types were refused on a Cell Ranger 2 .h5 and on a folder whose features file has no type column, though both convert without them, so a pipeline had to inspect each 10x input before it chose its flags. Such an input holds gene expression alone (Cell Ranger 2, older STARsolo), so plan_targets takes every feature as 'Gene Expression' when the caller says why the types are missing: --feature-type 'Gene Expression' keeps every feature with a warning, any other type is refused naming gene expression, and --split-feature-types writes one OUT.Gene_Expression output. var gains no feature_types column, so the output is the one the plain conversion gives; the entry map stays the plain transpose. Filtering an h5ad input on its feature_types column, the issue's lower priority, is noted in STATUS.md as a follow-up. 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 insufficient remaining quota. Try requesting a review at a lower effort level.
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 Summary: ✅ CompletedThis 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. |
- A genes.tsv with a third column was called untyped, so --feature-type 'Gene Expression' kept every feature of a Cell Ranger 3 features.tsv renamed genes.tsv (as GEO often serves them), antibodies included, and the warning said it had no types. Its third column is not read, as in scanpy, so the flags are refused there, saying to name the file features.tsv to filter on the types. - The h5 message says "Cell Ranger 2's layout records no feature types", true of CellBender 0.2 run on Cell Ranger 2 input as well. - Tests: values of var compared in the mtx test, a GEO-prefixed folder, CellBender on Cell Ranger 2 input, and a refusal checked to write no output of any name. - Docs: .zarr outputs, the three-column case, 10x-mtx.md reflowed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Test Results (py3.13)3 836 tests +11 3 824 ✅ +11 7m 55s ⏱️ - 1m 56s Results for commit fee6d45. ± Comparison against base commit 85723b6. This pull request removes 3 and adds 14 tests. Note that renamed tests count towards both. |
Test Results (py3.12)3 836 tests +11 3 824 ✅ +11 9m 15s ⏱️ + 3m 30s Results for commit fee6d45. ± Comparison against base commit 85723b6. This pull request removes 3 and adds 14 tests. Note that renamed tests count towards both. |
Fixes #127.
adata convert … --feature-type 'Gene Expression'and--split-feature-typesused to be refused on a Cell Ranger 2.h5and on an MTX folder whose features file has no type column (Cell Ranger 2'sgenes.tsv, older STARsolo's two-columnfeatures.tsv), though both convert fine without the flags. A pipeline that passes the same flags for any 10x input (nf-metacells) therefore had to inspect each input first.Such an input holds gene expression alone, so its features are now taken as
Gene Expression(option 1 of the issue):--feature-type 'Gene Expression'keeps every feature and prints a warning saying so;No features of type 'Peaks'; Cell Ranger 2's layout records no feature types, so this file holds gene expression only.;--split-feature-typeswrites oneOUT.Gene_Expression.h5ad, as it does for a v3 file that holds gene expression only.var gains no
feature_typescolumn, so the output equals the plain conversion, which is already checked against scanpy. Every mask is all-true, so the entry map stays the plain transpose, and reads and memory are unchanged.A
genes.tsvwith a third column, often a Cell Ranger 3features.tsvrenamed for old Seurat on GEO, still refuses the flags. Its third column isn't read (scanpy ignores it too), and taking it as gene expression would keep antibodies. The message says to name the filefeatures.tsvto filter on its types.The change is in
conversion/features.py::plan_targets, which takes anuntypedreason from its caller (mtx.py,tenx.py); the two refusals are gone. Visium and Xenium share the path but are always v3. CellBender 0.2 run on Cell Ranger 2 input keeps that layout, so it gets the same behaviour. Parse doesn't take the flags.Not in this PR, noted in STATUS.md: filtering an h5ad input on its
feature_typescolumn, the issue's lower-priority ask.Changelog entry (for 0.17.7)
Changed
--feature-typeand--split-feature-typestake a 10x input with no feature types as gene expression (#127). A Cell Ranger 2.h5, or a folder whose features file has no type column, holds gene expression alone.--feature-type "Gene Expression"now keeps every feature with a warning, rather than being refused; any other type is refused; and--split-feature-typeswrites oneOUT.Gene_Expressionoutput. So the same flags work on any 10x input.Tests
test_the_type_flags_take_a_cell_ranger_2_file_as_gene_expression(h5) andtest_the_type_flags_take_an_untyped_folder_as_gene_expression(mtx, over thecr2andstarsolo2collayouts) check the output against the plain conversion, along with the single output file and the warning. Both fail onmain.test_a_genes_tsv_with_a_third_column_refuses_the_type_flags, a GEO-prefixed folder, andtest_cellbender_on_cell_ranger_2_input_takes_the_type_flags_as_gene_expressionwere added after review.--feature-type Peaksis refused.🤖 Generated with Claude Code