Skip to content

Commit

Permalink
fix pipeline and scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rcannood committed Sep 4, 2024
1 parent fcc5d85 commit 735da9f
Show file tree
Hide file tree
Showing 10 changed files with 139 additions and 2 deletions.
Empty file modified scripts/create_component/create_python_method.sh
100644 → 100755
Empty file.
Empty file modified scripts/create_component/create_python_metric.sh
100644 → 100755
Empty file.
Empty file modified scripts/create_component/create_r_method.sh
100644 → 100755
Empty file.
Empty file modified scripts/create_component/create_r_metric.sh
100644 → 100755
Empty file.
36 changes: 36 additions & 0 deletions scripts/run_benchmark/run_full_local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# get the root of the directory
REPO_ROOT=$(git rev-parse --show-toplevel)

# ensure that the command below is run from the root of the repository
cd "$REPO_ROOT"

# NOTE: depending on the the datasets and components, you may need to launch this workflow
# on a different compute platform (e.g. a HPC, AWS Cloud, Azure Cloud, Google Cloud).
# please refer to the nextflow information for more details:
# https://www.nextflow.io/docs/latest/

set -e

# generate a unique id
RUN_ID="run_$(date +%Y-%m-%d_%H-%M-%S)"
publish_dir="resources/results/${RUN_ID}"

# write the parameters to file
cat > /tmp/params.yaml << HERE
input_states: resources/datasets/**/state.yaml
rename_keys: 'input_singlecell_dataset:output_sc;input_spatial_dataset:output_sp'
output_state: "state.yaml"
publish_dir: "$publish_dir"
HERE

# run the benchmark
nextflow run openproblems-bio/task_spatial_simulators \
--revision build/main \
-main-script target/nextflow/workflows/run_benchmark/main.nf \
-profile docker \
-resume \
-entry auto \
-c common/nextflow_helpers/labels.config \
-params-file /tmp/params.yaml
32 changes: 32 additions & 0 deletions scripts/run_benchmark/run_full_seqeracloud.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

# get the root of the directory
REPO_ROOT=$(git rev-parse --show-toplevel)

# ensure that the command below is run from the root of the repository
cd "$REPO_ROOT"

set -e

# generate a unique id
RUN_ID="run_$(date +%Y-%m-%d_%H-%M-%S)"
publish_dir="s3://openproblems-data/resources/task_spatial_simulators/results/${RUN_ID}"

# write the parameters to file
cat > /tmp/params.yaml << HERE
input_states: s3://openproblems-data/resources/task_spatial_simulators/datasets/**/state.yaml
rename_keys: 'input_singlecell_dataset:output_sc;input_spatial_dataset:output_sp'
output_state: "state.yaml"
publish_dir: "$publish_dir"
HERE

tw launch https://github.com/openproblems-bio/task_spatial_simulators.git \
--revision build/main \
--pull-latest \
--main-script target/nextflow/workflows/run_benchmark/main.nf \
--workspace 53907369739130 \
--compute-env 6TeIFgV5OY4pJCk8I0bfOh \
--params-file /tmp/params.yaml \
--entry-name auto \
--config common/nextflow_helpers/labels_tw.config \
--labels task_spatial_simulators,full
33 changes: 33 additions & 0 deletions scripts/run_benchmark/run_test_local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# get the root of the directory
REPO_ROOT=$(git rev-parse --show-toplevel)

# ensure that the command below is run from the root of the repository
cd "$REPO_ROOT"

# remove this when you have implemented the script
echo "TODO: once the 'run_benchmark' workflow has been implemented, update this script to use it."
echo " Step 1: replace 'task_spatial_simulators' with the name of the task in the following command."
echo " Step 2: replace the rename keys parameters to fit your run_benchmark inputs"
echo " Step 3: replace the settings parameter to fit your run_benchmark outputs"
echo " Step 4: remove this message"
exit 1

set -e

# write the parameters to file
cat > /tmp/params.yaml << 'HERE'
input_states: s3://openproblems-data/resources_test/task_spatial_simulators/**/state.yaml
rename_keys: 'input_singlecell_dataset:output_sc;input_spatial_dataset:output_sp'
output_state: "state.yaml"
publish_dir: s3://openproblems-nextflow/temp/task_spatial_simulators/
HERE

nextflow run . \
-main-script target/nextflow/workflows/run_benchmark/main.nf \
-profile docker \
-resume \
-entry auto \
-c common/nextflow_helpers/labels.config \
-params-file /tmp/params.yaml
36 changes: 36 additions & 0 deletions scripts/run_benchmark/run_test_seqeracloud.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# get the root of the directory
REPO_ROOT=$(git rev-parse --show-toplevel)

# ensure that the command below is run from the root of the repository
cd "$REPO_ROOT"

# remove this when you have implemented the script
echo "TODO: once the 'run_benchmark' workflow has been implemented, update this script to use it."
echo " Step 1: replace 'task_spatial_simulators' with the name of the task in the following command."
echo " Step 2: replace the rename keys parameters to fit your run_benchmark inputs"
echo " Step 3: replace the settings parameter to fit your run_benchmark outputs"
echo " Step 4: remove this message"
exit 1

set -e

# write the parameters to file
cat > /tmp/params.yaml << 'HERE'
input_states: s3://openproblems-data/resources_test/task_spatial_simulators/**/state.yaml
rename_keys: 'input_singlecell_dataset:output_sc;input_spatial_dataset:output_sp'
output_state: "state.yaml"
publish_dir: s3://openproblems-nextflow/temp/task_spatial_simulators/
HERE

tw launch https://github.com/openproblems-bio/task_spatial_simulators.git \
--revision build/main \
--pull-latest \
--main-script target/nextflow/workflows/run_benchmark/main.nf \
--workspace 53907369739130 \
--compute-env 6TeIFgV5OY4pJCk8I0bfOh \
--params-file /tmp/params.yaml \
--entry-name auto \
--config common/nextflow_helpers/labels_tw.config \
--labels task_spatial_simulators,test
2 changes: 1 addition & 1 deletion src/workflows/run_benchmark/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ workflow run_wf {
output_ch = score_ch

// extract the scores
| extract_metadata.run(
| extract_uns_metadata.run(
key: "extract_scores",
fromState: [input: "metric_output"],
toState: { id, output, state ->
Expand Down
2 changes: 1 addition & 1 deletion src/workflows/run_benchmark/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ nextflow run . \
-entry auto \
-c common/nextflow_helpers/labels_ci.config \
--input_states "$DATASETS_DIR/spatialsimbench_mobnew/state.yaml" \
--rename_keys 'input_sc:output_sc;input_sp:output_sp' \
--rename_keys 'input_singlecell_dataset:output_sc;input_spatial_dataset:output_sp' \
--settings '{"output_scores": "scores.yaml", "output_dataset_info": "dataset_info.yaml", "output_method_configs": "method_configs.yaml", "output_metric_configs": "metric_configs.yaml", "output_task_info": "task_info.yaml"}' \
--publish_dir "$OUTPUT_DIR" \
--output_state "state.yaml"

0 comments on commit 735da9f

Please sign in to comment.