Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions src/methods/senkin_tmp/senkin_tmp/config.vsh.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
__merge__: ../../../api/comp_method.yaml
name: senkin_tmp
label: "senkin & tmp"
summary: "LightGBM + bidirectional GRU ensemble for CITE-seq protein prediction (OpenProblems 2022 2nd place)"
summary: "LightGBM + bidirectional GRU ensemble for CITE-seq protein prediction (best CITE-seq model of the Open Problems 2022 competition)"
description: |
Two-stage method from the OpenProblems NeurIPS 2021 competition. Stage 1 trains four
LightGBM models on different RNA feature representations (log-normalized, CLR-TSVD,
custom sqrt-normalized, and raw counts). Stage 2 refines predictions with two neural
network architectures: a bidirectional GRU with cosine-similarity loss and a dense
bidirectional GRU with MSE loss. Final predictions are a weighted blend (55% cosine,
45% MSE) of per-fold averaged outputs.
Two-stage method of senkin13 from the Open Problems NeurIPS 2022 multimodal single-cell
integration competition (2nd place overall, best CITE-seq submission). Stage 1 trains four
LightGBM models on different RNA feature representations (log-normalized counts; CLR-TSVD
together with correlated genes and TSVD/PCA of a custom sqrt normalization with per-batch
median correction; raw counts; raw counts predicting raw protein counts). Stage 2 refines
the TSVD-reduced LightGBM predictions, together with the feature blocks (each z-scored per
cell), with two neural networks: a bidirectional GRU with cosine-similarity loss and a dense
bidirectional GRU with MSE loss. Final predictions are a weighted blend (55% cosine, 45% MSE)
of per-fold averaged outputs, rescaled to the target scale with a global affine transform.
references:
doi:
- 10.64898/2026.02.24.707614
Expand Down
4 changes: 2 additions & 2 deletions src/methods/senkin_tmp/senkin_tmp_predict/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ engines:
image: openproblems/base_pytorch_nvidia:1
setup:
- type: docker
run: pip install --no-cache-dir --no-deps git+https://github.com/lueckenlab/senkin-tmp-cite-pred.git
run: pip install --no-cache-dir --no-deps git+https://github.com/lueckenlab/senkin-tmp-cite-pred.git@a830343a148c087dd95f60d5c7e14529aaba2425
- type: python
packages:
- lightgbm>=4.0
Expand All @@ -31,4 +31,4 @@ runners:
- type: executable
- type: nextflow
directives:
label: [highmem, hightime, midcpu]
label: [lowmem, lowtime, lowcpu]
12 changes: 9 additions & 3 deletions src/methods/senkin_tmp/senkin_tmp_predict/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

## VIASH START
par = {
"input_test_mod1": "resources_test/task_predict_modality/openproblems_neurips2021/bmmc_cite/swap/test_mod1.h5ad",
"input_train_mod2": "resources_test/task_predict_modality/openproblems_neurips2021/bmmc_cite/swap/train_mod2.h5ad",
"input_test_mod1": "resources_test/task_predict_modality/openproblems_neurips2021/bmmc_cite/normal/test_mod1.h5ad",
"input_train_mod2": "resources_test/task_predict_modality/openproblems_neurips2021/bmmc_cite/normal/train_mod2.h5ad",
"input_model": "output_model.pkl",
"output": "output_pred.h5ad",
}
Expand All @@ -26,9 +26,15 @@
with open(par["input_model"], "rb") as f:
bundle = pickle.load(f)

predictions = bundle["test_predictions"]
if "test_obs_names" in bundle:
# The train step predicted the test cells in the order of input_test_mod1; make sure nothing changed
assert (np.asarray(bundle["test_obs_names"]) == adata_rna_test.obs_names.values).all(), "test cells do not match the trained model"
assert predictions.shape == (adata_rna_test.n_obs, adata_prot_train.n_vars)

logger.info("Writing predictions...")
adata_out = ad.AnnData(
layers={"normalized": csc_matrix(bundle["test_predictions"])},
layers={"normalized": csc_matrix(predictions)},
obs=adata_rna_test.obs,
var=adata_prot_train.var,
uns={
Expand Down
18 changes: 17 additions & 1 deletion src/methods/senkin_tmp/senkin_tmp_train/config.vsh.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
__merge__: ../../../api/comp_method_train.yaml
name: senkin_tmp_train
info:
# The api default test inputs are bmmc_cite/swap (ADT->GEX). senkin predicts protein
# (ADT) from RNA (GEX), so point the component test at the 'normal' (GEX->ADT)
# direction, otherwise the new modality guard correctly exits non-applicable.
test_setup:
normal_direction:
input_train_mod1: resources_test/task_predict_modality/openproblems_neurips2021/bmmc_cite/normal/train_mod1.h5ad
input_train_mod2: resources_test/task_predict_modality/openproblems_neurips2021/bmmc_cite/normal/train_mod2.h5ad
input_test_mod1: resources_test/task_predict_modality/openproblems_neurips2021/bmmc_cite/normal/test_mod1.h5ad
resources:
- path: script.py
type: python_script
- path: /src/utils/exit_codes.py
arguments:
- name: "--n_folds"
type: integer
Expand Down Expand Up @@ -56,9 +66,15 @@ engines:
github:
- openproblems-bio/core#subdirectory=packages/python/openproblems
- type: docker
run: pip install --no-cache-dir --no-deps git+https://github.com/lueckenlab/senkin-tmp-cite-pred.git
run: pip install --no-cache-dir --no-deps git+https://github.com/lueckenlab/senkin-tmp-cite-pred.git@a830343a148c087dd95f60d5c7e14529aaba2425
runners:
- type: executable
- type: nextflow
directives:
label: [highmem, hightime, midcpu, gpu]
# Override the api default (bmmc_cite/swap = ADT->GEX). senkin only supports GEX->ADT.
test_resources:
- type: python_script
path: /common/component_tests/run_and_check_output.py
- path: /resources_test/task_predict_modality/openproblems_neurips2021/bmmc_cite/normal
dest: resources_test/task_predict_modality/openproblems_neurips2021/bmmc_cite/normal
Loading
Loading