Skip to content

Declare uns['modality'] in the task file formats - #29

Merged
rcannood merged 3 commits into
mainfrom
fix/declare-uns-modality
Jul 29, 2026
Merged

Declare uns['modality'] in the task file formats#29
rcannood merged 3 commits into
mainfrom
fix/declare-uns-modality

Conversation

@rcannood

@rcannood rcannood commented Jul 28, 2026

Copy link
Copy Markdown
Member

Describe your changes

process_dataset writes uns["modality"] on all four outputs, and quite a lot of the repo depends on it:

  • run_benchmark/main.nf -- picks which object's normalization_id to trust (dataset_uns_mod1.modality == "GEX")
  • guanlab_dengkw_pm -- keys n_comp_dict on (mod1_type, mod2_type)
  • cellmapper_scvi -- chooses scVI vs PoissonVI
  • novel_train / novel_predict -- pick the model class
  • simple_mlp_train / simple_mlp_predict -- build the GEX2ADT-style task name

But it appears in none of file_train_mod{1,2}.yaml / file_test_mod{1,2}.yaml. Anyone writing a new data processor against the published contract would satisfy the spec and break six methods -- and run_benchmark would quietly fall through to the mod2 branch, since null == "GEX" is just false.

Declaring it as a required uns string. Verified all 16 files under resources_test/task_predict_modality/ already carry it (GEX/ADT/ATAC), so nothing is excluded.

Part of a series of PRs coming out of a pre-run review of the benchmark.

Checklist before requesting a review

  • I have performed a self-review of my code

  • Check the correct box. Does this PR contain:

    • Breaking changes
    • New functionality
    • Major changes
    • Minor changes
    • Bug fixes
  • Proposed changes are described in the CHANGELOG.md

  • CI Tests succeed and look good!

rcannood added 3 commits July 28, 2026 17:09
process_dataset writes it and guanlab_dengkw_pm, cellmapper_scvi,
novel_train, novel_predict, simple_mlp_train, simple_mlp_predict and
run_benchmark all read it, but it was in none of the file specs.
@rcannood
rcannood merged commit 9bb88f4 into main Jul 29, 2026
2 checks passed
@rcannood
rcannood deleted the fix/declare-uns-modality branch July 29, 2026 10:27
@rcannood rcannood mentioned this pull request Jul 29, 2026
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant