Write gene_id_to_name.tsv when indexing a probe set CSV#202
Open
an-altosian wants to merge 1 commit into
Open
Conversation
When `simpleaf index` builds from a 10x probe set CSV that carries a gene symbol column (`gene_name` or `gene_symbol`), it now emits a `gene_id_to_name.tsv` mapping into the reference and the built index. Previously this mapping was only produced on the auto-build path inside `multiplex-quant`/`quant` (via probe_utils), so a prebuilt probe index passed with `--index` carried no gene names. The GTF/roers path already wrote the file; this brings the probe-csv path to parity, letting downstream `quant` surface gene names for prebuilt probe indexes. The mapping covers every gene in the probe set independent of the `included` flag (it is a complete gene annotation, not matrix contents); conflicting names for the same gene_id are rejected. The insert-with-conflict-check and TSV-write logic are factored into two shared `probe_utils` helpers (`insert_gene_name`, `write_gene_id_to_name`) used by BOTH the auto-build path and `simpleaf index`, so the logic is not duplicated. Adds a unit test for the dedup/conflict behavior.
an-altosian
force-pushed
the
feat/index-probe-csv-gene-id-to-name
branch
from
June 5, 2026 22:21
ac97387 to
272f649
Compare
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.
What
simpleaf index --probe-csvnow writes agene_id_to_name.tsvmapping into the reference dir and copies it into the built index, when the probe set CSV carries a gene-symbol column (gene_nameorgene_symbol).Why
The gene_id→name mapping was only generated on the auto-build path used by
multiplex-quant/quant(viaprobe_utils::convert_probe_csv_to_reference_files). When a user prebuilds a probe index withsimpleaf index --probe-csvand passes it via--index, no mapping was produced, so downstreamquantcould only surface Ensembl gene IDs, not names. The GTF/roers reference path already emitsgene_id_to_name.tsv; this brings the probe-CSV path to parity.Behavior
includedflag (a complete gene annotation, not matrix contents).gene_idare rejected with a clear error (matchesprobe_utilssemantics).index_info["gene_id_to_name"]; the existing copy step propagates the file into the final index dir, soquantpicks it up automatically.Tests
insert_gene_name_dedups_and_detects_conflicts(dedup + conflict).simpleaf index --probe-csvon a 3-gene CSV (including an excluded-only gene) producesref/gene_id_to_name.tsvandindex/gene_id_to_name.tsvwith all genes mapped.Scope
Single-file change:
src/simpleaf_commands/indexing.rs.