Commit 272f649
committed
feat(index): write gene_id_to_name.tsv for --probe-csv indexes
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.1 parent 52ccc73 commit 272f649
2 files changed
Lines changed: 96 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
175 | 176 | | |
176 | 177 | | |
177 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
178 | 190 | | |
179 | 191 | | |
180 | 192 | | |
| |||
275 | 287 | | |
276 | 288 | | |
277 | 289 | | |
278 | | - | |
279 | 290 | | |
280 | 291 | | |
281 | 292 | | |
| |||
301 | 312 | | |
302 | 313 | | |
303 | 314 | | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | 315 | | |
308 | 316 | | |
309 | 317 | | |
| |||
453 | 461 | | |
454 | 462 | | |
455 | 463 | | |
456 | | - | |
457 | 464 | | |
458 | 465 | | |
459 | 466 | | |
| |||
462 | 469 | | |
463 | 470 | | |
464 | 471 | | |
465 | | - | |
466 | 472 | | |
467 | 473 | | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
468 | 477 | | |
469 | 478 | | |
470 | 479 | | |
| |||
482 | 491 | | |
483 | 492 | | |
484 | 493 | | |
485 | | - | |
486 | 494 | | |
487 | 495 | | |
488 | 496 | | |
| |||
492 | 500 | | |
493 | 501 | | |
494 | 502 | | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
495 | 516 | | |
496 | 517 | | |
497 | 518 | | |
| |||
501 | 522 | | |
502 | 523 | | |
503 | 524 | | |
504 | | - | |
505 | 525 | | |
506 | 526 | | |
507 | 527 | | |
508 | 528 | | |
509 | 529 | | |
510 | 530 | | |
511 | 531 | | |
512 | | - | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
513 | 542 | | |
514 | 543 | | |
515 | 544 | | |
516 | 545 | | |
517 | | - | |
518 | 546 | | |
519 | 547 | | |
520 | 548 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
55 | 90 | | |
56 | 91 | | |
57 | 92 | | |
| |||
140 | 175 | | |
141 | 176 | | |
142 | 177 | | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
| 178 | + | |
153 | 179 | | |
154 | 180 | | |
155 | 181 | | |
| |||
179 | 205 | | |
180 | 206 | | |
181 | 207 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
| 208 | + | |
187 | 209 | | |
188 | 210 | | |
189 | 211 | | |
| |||
312 | 334 | | |
313 | 335 | | |
314 | 336 | | |
315 | | - | |
| 337 | + | |
316 | 338 | | |
| 339 | + | |
317 | 340 | | |
318 | 341 | | |
319 | 342 | | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
320 | 361 | | |
321 | 362 | | |
322 | 363 | | |
| |||
0 commit comments