Skip to content

Commit 0688615

Browse files
authored
Mark scipenn non-applicable outside GEX -> ADT (#77)
* Mark scipenn non-applicable outside GEX -> ADT * Add PR number to changelog
1 parent 8972ac7 commit 0688615

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@
112112

113113
* `senkin_tmp_train`, `senkin_tmp_predict`: Store the model bundle (the test predictions, as the solution is transductive) as an h5ad file in a directory instead of a pickle. The train image is built from `nvidia/cuda` with the current pandas 3, the predict image `openproblems/base_pytorch_nvidia:1` ships pandas 2, and unpickling the bundled `var` DataFrame raised `NotImplementedError` in `NDArrayBacked.__setstate__`, so senkin_tmp finished both CITE training runs of run_2026-09-23 but never produced a prediction. The predict step still reads the old pickle until the test resources are regenerated (PR #73).
114114

115+
* `scipenn`: Exit 99 (non-applicable) instead of raising a `ValueError` on anything other than GEX -> ADT (PR #77).
116+
115117
# task_predict_modality 0.1.1
116118

117119
## NEW FUNCTIONALITY

‎src/methods/scipenn/config.vsh.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ arguments:
4444
resources:
4545
- type: python_script
4646
path: script.py
47+
- path: /src/utils/exit_codes.py
4748
engines:
4849
# sciPENN is installed --no-deps: it pins a spurious numba<=0.50.0 (never imported) and a
4950
# 2021-era stack, but runs on the base image's torch/scanpy/anndata. The base already ships

‎src/methods/scipenn/script.py‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import logging
22
import os
3+
import sys
34
import tempfile
45

56
import anndata as ad
@@ -23,21 +24,24 @@
2324
"batch_size": 128,
2425
"seed": 0,
2526
}
26-
meta = {"name": "scipenn"}
27+
meta = {"name": "scipenn", "resources_dir": "src/utils"}
2728
## VIASH END
2829

30+
sys.path.append(meta["resources_dir"])
31+
from exit_codes import exit_non_applicable
32+
2933
logger.info("Reading input files...")
3034
rna_train = ad.read_h5ad(par["input_train_mod1"]) # mod1 = RNA (GEX)
3135
prot_train = ad.read_h5ad(par["input_train_mod2"]) # mod2 = protein (ADT)
3236
rna_test = ad.read_h5ad(par["input_test_mod1"])
3337

3438
# sciPENN only supports the GEX -> ADT direction. It biologically interprets the
3539
# gene sets as RNA and the protein sets as surface protein, so running it on the
36-
# swapped (ADT -> GEX) direction produces meaningless output. Fail loudly instead.
40+
# swapped (ADT -> GEX) direction produces meaningless output.
3741
mod1 = rna_train.uns.get("modality")
3842
mod2 = prot_train.uns.get("modality")
3943
if mod1 != "GEX" or mod2 != "ADT":
40-
raise ValueError(
44+
exit_non_applicable(
4145
f"sciPENN only supports predicting protein (ADT) from RNA (GEX); "
4246
f"got mod1={mod1!r}, mod2={mod2!r}."
4347
)

0 commit comments

Comments
 (0)