diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cf2a082..5dc296a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -112,6 +112,8 @@ * `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). +* `scipenn`: Exit 99 (non-applicable) instead of raising a `ValueError` on anything other than GEX -> ADT (PR #77). + # task_predict_modality 0.1.1 ## NEW FUNCTIONALITY diff --git a/src/methods/scipenn/config.vsh.yaml b/src/methods/scipenn/config.vsh.yaml index cd19413e..8b4d170e 100644 --- a/src/methods/scipenn/config.vsh.yaml +++ b/src/methods/scipenn/config.vsh.yaml @@ -44,6 +44,7 @@ arguments: resources: - type: python_script path: script.py + - path: /src/utils/exit_codes.py engines: # sciPENN is installed --no-deps: it pins a spurious numba<=0.50.0 (never imported) and a # 2021-era stack, but runs on the base image's torch/scanpy/anndata. The base already ships diff --git a/src/methods/scipenn/script.py b/src/methods/scipenn/script.py index 21a8e200..566acffd 100644 --- a/src/methods/scipenn/script.py +++ b/src/methods/scipenn/script.py @@ -1,5 +1,6 @@ import logging import os +import sys import tempfile import anndata as ad @@ -23,9 +24,12 @@ "batch_size": 128, "seed": 0, } -meta = {"name": "scipenn"} +meta = {"name": "scipenn", "resources_dir": "src/utils"} ## VIASH END +sys.path.append(meta["resources_dir"]) +from exit_codes import exit_non_applicable + logger.info("Reading input files...") rna_train = ad.read_h5ad(par["input_train_mod1"]) # mod1 = RNA (GEX) prot_train = ad.read_h5ad(par["input_train_mod2"]) # mod2 = protein (ADT) @@ -33,11 +37,11 @@ # sciPENN only supports the GEX -> ADT direction. It biologically interprets the # gene sets as RNA and the protein sets as surface protein, so running it on the -# swapped (ADT -> GEX) direction produces meaningless output. Fail loudly instead. +# swapped (ADT -> GEX) direction produces meaningless output. mod1 = rna_train.uns.get("modality") mod2 = prot_train.uns.get("modality") if mod1 != "GEX" or mod2 != "ADT": - raise ValueError( + exit_non_applicable( f"sciPENN only supports predicting protein (ADT) from RNA (GEX); " f"got mod1={mod1!r}, mod2={mod2!r}." )