From a183f16843a73d309e45e7045505827473072750 Mon Sep 17 00:00:00 2001 From: jalil Date: Sat, 24 Aug 2024 10:49:20 +0200 Subject: [PATCH] robust analysis fixed --- scripts/run_robust_analys.sh | 10 ++++- .../multi_omics/scenicplus/config.vsh.yaml | 1 + .../multi_omics/scenicplus_ns/config.vsh.yaml | 21 +++++++++ src/methods/multi_omics/scenicplus_ns/main.nf | 21 +++++++++ src/methods/multi_omics/scenicplus_ns/run.sh | 44 +++++++++++++++++++ .../run_robustness_analysis/config.vsh.yaml | 4 +- src/workflows/run_robustness_analysis/main.nf | 1 + 7 files changed, 99 insertions(+), 3 deletions(-) create mode 100644 src/methods/multi_omics/scenicplus_ns/config.vsh.yaml create mode 100644 src/methods/multi_omics/scenicplus_ns/main.nf create mode 100644 src/methods/multi_omics/scenicplus_ns/run.sh diff --git a/scripts/run_robust_analys.sh b/scripts/run_robust_analys.sh index 1f464ff30..0847ba6f2 100644 --- a/scripts/run_robust_analys.sh +++ b/scripts/run_robust_analys.sh @@ -3,10 +3,15 @@ # RUN_ID="run_$(date +%Y-%m-%d_%H-%M-%S)" RUN_ID="robust_analy" -resources_dir="resources" -publish_dir="output/${RUN_ID}" +# resources_dir="resources" +# publish_dir="output/${RUN_ID}" + +resources_dir="s3://openproblems-data/resources/grn" +publish_dir="s3://openproblems-data/resources/grn/results/${RUN_ID}" grn_models_folder="${resources_dir}/grn_models" + + reg_type=ridge subsample=-2 max_workers=10 @@ -35,6 +40,7 @@ HERE append_entry() { cat >> $param_file << HERE - id: ${1}_${2}_${3} + perturbation_data: ${resources_dir}/grn-benchmark/perturbation_data.h5ad layer: ${layer} reg_type: $reg_type method_id: $1 diff --git a/src/methods/multi_omics/scenicplus/config.vsh.yaml b/src/methods/multi_omics/scenicplus/config.vsh.yaml index 7226838ef..4fbf1085e 100644 --- a/src/methods/multi_omics/scenicplus/config.vsh.yaml +++ b/src/methods/multi_omics/scenicplus/config.vsh.yaml @@ -3,6 +3,7 @@ __merge__: ../../../api/comp_method.yaml functionality: name: scenicplus + namespace: grn_methods info: label: scenicplus summary: "GRN inference using scenicplus" diff --git a/src/methods/multi_omics/scenicplus_ns/config.vsh.yaml b/src/methods/multi_omics/scenicplus_ns/config.vsh.yaml new file mode 100644 index 000000000..92ab82478 --- /dev/null +++ b/src/methods/multi_omics/scenicplus_ns/config.vsh.yaml @@ -0,0 +1,21 @@ + +__merge__: ../../../api/comp_method.yaml + +functionality: + name: grn_inference_scenicplus + namespace: "workflows" + info: + label: grn_inference_scenicplus + summary: "Infers GRNs from multiomics data using scenicplus." + + resources: + - type: nextflow_script + path: main.nf + entrypoint: run_wf + dependencies: + - name: grn_methods/scenicplus + +platforms: + - type: nextflow + directives: + label: [ midtime, midmem, lowcpu ] diff --git a/src/methods/multi_omics/scenicplus_ns/main.nf b/src/methods/multi_omics/scenicplus_ns/main.nf new file mode 100644 index 000000000..6492cb243 --- /dev/null +++ b/src/methods/multi_omics/scenicplus_ns/main.nf @@ -0,0 +1,21 @@ +workflow run_wf { + take: + input_ch + + main: + output_ch = input_ch + + | scenicplus.run( + fromState: [multiomics_rna: "multiomics_rna", + multiomics_atac: "multiomics_atac", + temp_dir: "temp_dir", + num_workers: "num_workers" + ], + toState: [prediction:"prediction"] + ) + + | setState(["prediction"]) + + emit: + output_ch +} diff --git a/src/methods/multi_omics/scenicplus_ns/run.sh b/src/methods/multi_omics/scenicplus_ns/run.sh new file mode 100644 index 000000000..725161975 --- /dev/null +++ b/src/methods/multi_omics/scenicplus_ns/run.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +RUN_ID="scenicplus" +resources_dir="s3://openproblems-data/resources_test/grn" +publish_dir="s3://openproblems-data/resources_test/grn/results/${RUN_ID}" + +# resources_dir="./resources_test" +# publish_dir="./output/${RUN_ID}" + +num_workers=20 + +param_file="./params/${RUN_ID}.yaml" +# Start writing to the YAML file +cat > $param_file << HERE +param_list: + - id: ${RUN_ID} + multiomics_rna: ${resources_dir}/grn-benchmark/multiomics_rna.h5ad + multiomics_atac: ${resources_dir}/grn-benchmark/multiomics_atac.h5ad + num_workers: $num_workers + temp_dir: ./tmp/grn +output_state: "state.yaml" +publish_dir: "$publish_dir" +HERE + + +# nextflow run . \ +# -main-script target/nextflow/workflows/grn_inference_scenicplus/main.nf \ +# -profile docker \ +# -with-trace \ +# -c src/common/nextflow_helpers/labels_ci.config \ +# -params-file params/${RUN_ID}.yaml + + +# ./tw-windows-x86_64.exe launch ` +# https://github.com/openproblems-bio/task_grn_benchmark.git ` +# --revision build/main ` +# --pull-latest ` +# --main-script target/nextflow/workflows/run_grn_inference/main.nf ` +# --workspace 53907369739130 ` +# --compute-env 6TeIFgV5OY4pJCk8I0bfOh ` +# --params-file ./params/celloracle_test.yaml ` +# --config src/common/nextflow_helpers/labels_tw.config + + diff --git a/src/workflows/run_robustness_analysis/config.vsh.yaml b/src/workflows/run_robustness_analysis/config.vsh.yaml index 6f359ed98..338a90348 100644 --- a/src/workflows/run_robustness_analysis/config.vsh.yaml +++ b/src/workflows/run_robustness_analysis/config.vsh.yaml @@ -1,4 +1,3 @@ - functionality: name: run_robustness_analysis namespace: "workflows" @@ -8,6 +7,9 @@ functionality: argument_groups: - name: Inputs arguments: + - name: --perturbation_data + type: file + direction: input - name: --layer type: string direction: input diff --git a/src/workflows/run_robustness_analysis/main.nf b/src/workflows/run_robustness_analysis/main.nf index d2358eb53..815081ef1 100644 --- a/src/workflows/run_robustness_analysis/main.nf +++ b/src/workflows/run_robustness_analysis/main.nf @@ -42,6 +42,7 @@ workflow run_wf { }, // use 'fromState' to fetch the arguments the component requires from the overall state fromState: [ + perturbation_data: "perturbation_data", prediction_n: "prediction", layer: "layer", subsample: "subsample",