Skip to content

Commit bc7cc8c

Browse files
authored
Update the way we provide the benchmark config (#99)
1 parent 1888fdb commit bc7cc8c

5 files changed

Lines changed: 178 additions & 38 deletions

File tree

scripts/create_resources/combine/process_datasets.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,6 @@ param_list:
326326
dataset_description: "Spatial data: Bruker CosMx Human Lung Cancer Lung13; Single cell data: 2024Zuani_human_nsclc_sc"
327327
dataset_organism: "homo_sapiens"
328328
329-
330-
331329
output_sc: "\$id/output_sc.h5ad"
332330
output_sp: "\$id/output_sp.zarr"
333331
output_state: "\$id/state.yaml"

scripts/run_benchmark/run_full_local.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,69 @@ echo " Make sure to run 'scripts/project/build_all_docker_containers.sh'!"
2020
RUN_ID="run_$(date +%Y-%m-%d_%H-%M-%S)"
2121
publish_dir="resources/results/${RUN_ID}"
2222

23+
cat > /tmp/params_settings.yaml << HERE
24+
default_methods:
25+
- custom_segmentation
26+
- basic_transcript_assignment
27+
- basic_count_aggregation
28+
- basic_qc_filter
29+
- alpha_shapes
30+
- normalize_by_volume
31+
- ssam
32+
- no_correction
33+
segmentation_methods:
34+
- custom_segmentation
35+
# - cellpose
36+
- binning
37+
# - stardist
38+
# - watershed
39+
transcript_assignment_methods:
40+
- basic_transcript_assignment
41+
#- baysor
42+
# - clustermap
43+
# - pciseq
44+
# - comseg
45+
# - proseg
46+
count_aggregation_methods:
47+
- basic_count_aggregation
48+
qc_filtering_methods:
49+
- basic_qc_filter
50+
volume_calculation_methods:
51+
- alpha_shapes
52+
normalization_methods:
53+
- normalize_by_volume
54+
# - normalize_by_counts
55+
# - spanorm
56+
celltype_annotation_methods:
57+
- ssam
58+
# - tacco
59+
# - moscot
60+
expression_correction_methods:
61+
- no_correction
62+
# - gene_efficiency_correction
63+
# - resolvi_correction
64+
method_parameters_yaml: /tmp/method_params.yaml
65+
HERE
66+
2367
# write the parameters to file
2468
cat > /tmp/params.yaml << HERE
2569
input_states: resources/datasets/**/state.yaml
2670
rename_keys: 'input_sc:output_sc;input_sp:output_sp'
71+
save_spatial_data: false
72+
settings: '$(yq -o json /tmp/params_settings.yaml | jq -c .)'
2773
output_state: "state.yaml"
2874
publish_dir: "$publish_dir"
2975
HERE
3076

77+
cat > /tmp/method_params.yaml << HERE
78+
parameters:
79+
binning:
80+
default:
81+
bin_size: 30
82+
sweep:
83+
bin_size: [20, 30, 40]
84+
HERE
85+
3186
# run the benchmark
3287
nextflow run . \
3388
-main-script target/nextflow/workflows/run_benchmark/main.nf \

scripts/run_benchmark/run_full_seqeracloud.sh

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,7 @@ set -e
1212
RUN_ID="run_$(date +%Y-%m-%d_%H-%M-%S)"
1313
publish_dir="s3://openproblems-data/resources/task_ist_preprocessing/results/${RUN_ID}"
1414

15-
# input_dir="s3://openproblems-data/resources/task_ist_preprocessing/datasets"
16-
# cat > /tmp/params.yaml << HERE
17-
# param_list:
18-
19-
# - id: "mouse_brain_combined/rep1"
20-
# input_sp: "$input_dir/mouse_brain_combined/rep1/output_sp.zarr"
21-
# input_sc: "$input_dir/mouse_brain_combined/rep1/output_sc.h5ad"
22-
23-
# output_sc: "\$id/output_sc.h5ad"
24-
# output_sp: "\$id/output_sp.zarr"
25-
# output_state: "\$id/state.yaml"
26-
# publish_dir: "$publish_dir"
27-
# HERE
28-
29-
# write the parameters to file
30-
cat > /tmp/params.yaml << HERE
31-
input_states: s3://openproblems-data/resources/task_ist_preprocessing/datasets/**/state.yaml
32-
rename_keys: 'input_sc:output_sc;input_sp:output_sp'
33-
save_spatial_data: false
15+
cat > /tmp/params_settings.yaml << HERE
3416
default_methods:
3517
- custom_segmentation
3618
- basic_transcript_assignment
@@ -49,7 +31,7 @@ segmentation_methods:
4931
transcript_assignment_methods:
5032
- basic_transcript_assignment
5133
- baysor
52-
# - clustermap
34+
- clustermap
5335
- pciseq
5436
- comseg
5537
- proseg
@@ -71,10 +53,30 @@ expression_correction_methods:
7153
- no_correction
7254
- gene_efficiency_correction
7355
- resolvi_correction
56+
method_parameters_yaml: /tmp/method_params.yaml
57+
HERE
58+
59+
# write the parameters to file
60+
cat > /tmp/params.yaml << HERE
61+
input_states: s3://openproblems-data/resources/task_ist_preprocessing/datasets/**/state.yaml
62+
rename_keys: 'input_sc:output_sc;input_sp:output_sp'
63+
save_spatial_data: false
64+
settings: '$(yq -o json /tmp/params_settings.yaml | jq -c .)'
7465
output_state: "state.yaml"
7566
publish_dir: "$publish_dir"
7667
HERE
7768

69+
# NOTE: this file needs to be made available on the seqera cloud workspace and the
70+
# path needs to be added above (method_parameters_yaml)
71+
cat > /tmp/method_params.yaml << HERE
72+
parameters:
73+
binning:
74+
default:
75+
bin_size: 30
76+
sweep:
77+
bin_size: [20, 30, 40]
78+
HERE
79+
7880
tw launch https://github.com/openproblems-bio/task_ist_preprocessing.git \
7981
--revision build/main \
8082
--pull-latest \

scripts/run_benchmark/run_test_local.sh

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,7 @@ echo " Make sure to run 'scripts/project/build_all_docker_containers.sh'!"
1515
RUN_ID="testrun_$(date +%Y-%m-%d_%H-%M-%S)"
1616
publish_dir="temp/results/${RUN_ID}"
1717

18-
# Write the parameters to file
19-
cat > /tmp/params.yaml << HERE
20-
id: mouse_brain_combined
21-
input_sc: resources_test/task_ist_preprocessing/mouse_brain_combined/scrnaseq_reference.h5ad
22-
input_sp: resources_test/task_ist_preprocessing/mouse_brain_combined/raw_ist.zarr
23-
save_spatial_data: false
18+
cat > /tmp/params_settings.yaml << HERE
2419
default_methods:
2520
- custom_segmentation
2621
- basic_transcript_assignment
@@ -62,10 +57,30 @@ expression_correction_methods:
6257
# - gene_efficiency_correction
6358
# - resolvi_correction
6459
method_parameters_yaml: /tmp/method_params.yaml
60+
HERE
61+
62+
# Write the parameters to file (input_states version, NOTE: enable `-entry auto` for this)
63+
cat > /tmp/params.yaml << HERE
64+
input_states: resources_test/task_ist_preprocessing/**/state.yaml
65+
rename_keys: 'input_sc:output_sc;input_sp:output_sp'
66+
save_spatial_data: false
67+
settings: '$(yq -o json /tmp/params_settings.yaml | jq -c .)'
6568
output_state: "state.yaml"
6669
publish_dir: "$publish_dir"
6770
HERE
6871

72+
# #Write the parameters to file (specific id version, NOTE: disable `-entry auto` for this)
73+
# cat > /tmp/params.yaml << HERE
74+
# id: mouse_brain_combined
75+
# input_sc: resources_test/task_ist_preprocessing/mouse_brain_combined/scrnaseq_reference.h5ad
76+
# input_sp: resources_test/task_ist_preprocessing/mouse_brain_combined/raw_ist.zarr
77+
# save_spatial_data: true
78+
# $(cat /tmp/params_settings.yaml)
79+
# output_state: "state.yaml"
80+
# publish_dir: "$publish_dir"
81+
# HERE
82+
83+
6984
cat > /tmp/method_params.yaml << HERE
7085
parameters:
7186
binning:
@@ -79,5 +94,6 @@ nextflow run . \
7994
-main-script target/nextflow/workflows/run_benchmark/main.nf \
8095
-profile docker \
8196
-resume \
97+
-entry auto \
8298
-c common/nextflow_helpers/labels_ci.config \
8399
-params-file /tmp/params.yaml

scripts/run_benchmark/run_test_seqeracloud.sh

Lines changed: 79 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,95 @@ set -e
1111
resources_test_s3=s3://openproblems-data/resources_test/task_ist_preprocessing
1212
publish_dir_s3="s3://openproblems-nextflow/temp/results/$(date +%Y-%m-%d_%H-%M-%S)"
1313

14-
# write the parameters to file
14+
cat > /tmp/params_settings.yaml << HERE
15+
default_methods:
16+
- custom_segmentation
17+
- basic_transcript_assignment
18+
- basic_count_aggregation
19+
- basic_qc_filter
20+
- alpha_shapes
21+
- normalize_by_volume
22+
- ssam
23+
- no_correction
24+
segmentation_methods:
25+
- custom_segmentation
26+
- cellpose
27+
- binning
28+
- stardist
29+
- watershed
30+
transcript_assignment_methods:
31+
- basic_transcript_assignment
32+
- baysor
33+
- clustermap
34+
- pciseq
35+
- comseg
36+
- proseg
37+
count_aggregation_methods:
38+
- basic_count_aggregation
39+
qc_filtering_methods:
40+
- basic_qc_filter
41+
volume_calculation_methods:
42+
- alpha_shapes
43+
normalization_methods:
44+
- normalize_by_volume
45+
- normalize_by_counts
46+
- spanorm
47+
celltype_annotation_methods:
48+
- ssam
49+
- tacco
50+
- moscot
51+
expression_correction_methods:
52+
- no_correction
53+
- gene_efficiency_correction
54+
- resolvi_correction
55+
#method_parameters_yaml: /tmp/method_params.yaml
56+
HERE
57+
58+
# Write the parameters to file (input_states version, NOTE: enable `-entry_name auto` for this)
1559
cat > /tmp/params.yaml << HERE
16-
id: mouse_brain_combined
17-
input_sc: $resources_test_s3/mouse_brain_combined/scrnaseq_reference.h5ad
18-
input_sp: $resources_test_s3/mouse_brain_combined/raw_ist.zarr
60+
input_states: $resources_test_s3/**/state.yaml
61+
rename_keys: 'input_sc:output_sc;input_sp:output_sp'
62+
save_spatial_data: false
63+
settings: '$(yq -o json /tmp/params_settings.yaml | jq -c .)'
1964
output_state: "state.yaml"
20-
publish_dir: $publish_dir_s3
65+
publish_dir: "$publish_dir_s3"
66+
HERE
67+
68+
# # write the parameters to file (specific id version, NOTE: disable `-entry_name auto` for this)
69+
# cat > /tmp/params.yaml << HERE
70+
# id: mouse_brain_combined
71+
# input_sc: $resources_test_s3/mouse_brain_combined/scrnaseq_reference.h5ad
72+
# input_sp: $resources_test_s3/mouse_brain_combined/raw_ist.zarr
73+
# save_spatial_data: false
74+
# settings: '$(yq -o json /tmp/params_settings.yaml | jq -c .)'
75+
# output_state: "state.yaml"
76+
# publish_dir: $publish_dir_s3
77+
# HERE
78+
79+
# NOTE: this file needs to be made available on the seqera cloud workspace and the
80+
# path needs to be added above (method_parameters_yaml)
81+
cat > /tmp/method_params.yaml << HERE
82+
parameters:
83+
binning:
84+
default:
85+
bin_size: 30
86+
sweep:
87+
bin_size: [20, 30, 40]
2188
HERE
2289

90+
2391
tw launch https://github.com/openproblems-bio/task_ist_preprocessing.git \
2492
--revision build/main \
2593
--pull-latest \
2694
--main-script target/nextflow/workflows/run_benchmark/main.nf \
2795
--workspace 53907369739130 \
2896
--params-file /tmp/params.yaml \
97+
--entry-name auto \
2998
--config common/nextflow_helpers/labels_tw.config \
3099
--labels task_ist_preprocessing,test
31100

32-
aws s3 sync \
33-
s3://openproblems-nextflow/temp/results \
34-
temp_results \
35-
--profile op \
36-
--dryrun
101+
# aws s3 sync \
102+
# s3://openproblems-nextflow/temp/results \
103+
# temp_results \
104+
# --profile op \
105+
# --dryrun

0 commit comments

Comments
 (0)