Skip to content

Commit d775d93

Browse files
committed
submission fixes for upgrade to snakemake 8+
1 parent 974f934 commit d775d93

3 files changed

Lines changed: 56 additions & 78 deletions

File tree

workflow/Snakefile

Lines changed: 17 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ rule to_spatialdata:
3131
paths.sdata_zgroup if paths.data_path else [],
3232
conda:
3333
"sopa2"
34-
threads: 8
34+
threads: 2
3535
resources:
36-
mem_mb=128_000,
36+
lsf_extra="-gpu num=1"
3737
params:
3838
reader = args['read'].as_cli(),
3939
data_path = paths.data_path,
@@ -50,7 +50,7 @@ rule tissue_segmentation:
5050
touch(paths.smk_tissue_segmentation),
5151
conda:
5252
"sopa2"
53-
threads: 8
53+
threads: 2
5454
params:
5555
tissue_segmentation = args["segmentation"]["tissue"].as_cli(),
5656
sdata_path = paths.sdata_path,
@@ -71,7 +71,7 @@ checkpoint patchify_image:
7171
sdata_path = paths.sdata_path,
7272
conda:
7373
"sopa2"
74-
threads: 8
74+
threads: 2
7575
shell:
7676
"""
7777
sopa patchify image {params.sdata_path} {params.patchify_image}
@@ -90,9 +90,7 @@ checkpoint patchify_transcripts:
9090
sdata_path = paths.sdata_path,
9191
conda:
9292
"sopa2"
93-
threads: 8
94-
resources:
95-
mem_mb=32_000,
93+
threads: 2
9694
shell:
9795
"""
9896
sopa patchify transcripts {params.sdata_path} {params.patchify_transcripts}
@@ -106,11 +104,9 @@ rule patch_segmentation_cellpose:
106104
paths.smk_cellpose_temp_dir / "{index}.parquet",
107105
conda:
108106
"sopa2"
109-
threads: 1
107+
threads: 2
110108
resources:
111-
mem_mb=32_000,
112-
queue="gpu -R 'h100nvl' -gpu 'num=1'",
113-
time=45,
109+
lsf_extra="-gpu num=1"
114110
params:
115111
cellpose = args["segmentation"]["cellpose"].as_cli(),
116112
sdata_path = paths.sdata_path,
@@ -129,8 +125,6 @@ rule patch_segmentation_baysor:
129125
params:
130126
baysor_config = args["segmentation"]["baysor"].as_cli(keys=["config"]),
131127
sdata_path = paths.sdata_path,
132-
resources:
133-
cpus_per_task=8,
134128
shell:
135129
"""
136130
export JULIA_NUM_THREADS={resources.cpus_per_task} # parallelize within each patch for Baysor >= v0.7
@@ -140,7 +134,7 @@ rule patch_segmentation_baysor:
140134
module purge
141135
fi
142136
143-
sopa segmentation baysor {params.sdata_path} --patch-index {wildcards.index} {params.baysor_config}
137+
sopa segmentation baysor {params.sdata_path} --patch-index {wildcards.index} {params.baysor_config} --force
144138
"""
145139

146140
rule patch_segmentation_comseg:
@@ -151,9 +145,6 @@ rule patch_segmentation_comseg:
151145
paths.smk_transcripts_temp_dir / "{index}" / "segmentation_counts.h5ad",
152146
conda:
153147
"sopa2"
154-
threads: 8
155-
resources:
156-
mem_mb=128_000,
157148
params:
158149
comseg_config = args["segmentation"]["comseg"].as_cli(keys=["config"]),
159150
sdata_path = paths.sdata_path,
@@ -176,7 +167,7 @@ rule resolve_cellpose:
176167
touch(paths.smk_cellpose_boundaries),
177168
conda:
178169
"sopa2"
179-
threads: 8
170+
threads: 2
180171
params:
181172
sdata_path = paths.sdata_path,
182173
shell:
@@ -192,7 +183,7 @@ rule resolve_baysor:
192183
touch(paths.smk_table),
193184
conda:
194185
"sopa2"
195-
threads: 8
186+
threads: 2
196187
params:
197188
resolve = args.resolve_transcripts(),
198189
sdata_path = paths.sdata_path,
@@ -212,7 +203,7 @@ rule resolve_comseg:
212203
touch(paths.smk_table),
213204
conda:
214205
"sopa2"
215-
threads: 8
206+
threads: 2
216207
params:
217208
resolve = args.resolve_transcripts(),
218209
sdata_path = paths.sdata_path,
@@ -241,9 +232,7 @@ rule aggregate:
241232
touch(paths.smk_aggregation),
242233
conda:
243234
"sopa2"
244-
threads: 8
245-
resources:
246-
mem_mb=64_000,
235+
threads: 2
247236
params:
248237
aggregate = args["aggregate"].as_cli(),
249238
sdata_path = paths.sdata_path,
@@ -261,9 +250,7 @@ rule annotate:
261250
"sopa2"
262251
threads: 2
263252
resources:
264-
mem_mb=64_000,
265-
queue="gpu -R 'h100nvl' -gpu 'num=1'",
266-
time=180,
253+
lsf_extra="-gpu num=1"
267254
params:
268255
method_name = args['annotation']['method'],
269256
annotation = args['annotation']['args'].as_cli() + " --save-maps",
@@ -282,9 +269,7 @@ rule novae:
282269
"novae"
283270
threads: 16
284271
resources:
285-
mem_mb=64_000,
286-
queue="gpu -R 'h100nvl' -gpu 'num=1'",
287-
time=45,
272+
lsf_extra="-gpu num=1"
288273
params:
289274
sdata_path = paths.sdata_path,
290275
radius = config["novae"]["radius"],
@@ -304,9 +289,7 @@ rule image_write:
304289
paths.explorer_image,
305290
conda:
306291
"sopa2"
307-
threads: 8
308-
resources:
309-
mem_mb=64_000,
292+
threads: 2
310293
params:
311294
explorer = args["explorer"].as_cli(keys=['lazy', 'ram_threshold_gb', 'pixel_size', 'pixelsize']),
312295
sdata_path = paths.sdata_path,
@@ -329,9 +312,7 @@ rule report:
329312
report = paths.report,
330313
conda:
331314
"sopa2"
332-
threads: 8
333-
resources:
334-
mem_mb=32_000,
315+
threads: 2
335316
shell:
336317
"""
337318
sopa report {params.sdata_path} {params.report}
@@ -347,9 +328,7 @@ rule explorer:
347328
paths.explorer_experiment,
348329
conda:
349330
"sopa2"
350-
threads: 8
351-
resources:
352-
mem_mb=256_000,
331+
threads: 2
353332
params:
354333
explorer = args["explorer"].as_cli(),
355334
sdata_path = paths.sdata_path,

workflow/lsf/config.yaml

Lines changed: 0 additions & 30 deletions
This file was deleted.

workflow/profile/lsf/config.yaml

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,46 @@
1-
# Warning: this profile is still experimental.
2-
31
executor: lsf
42
default-resources:
5-
mem_mb: 8_000 # default rules memory in MB (you can keep this value)
3+
mem_mb: 8_000
64
gpu: 0
5+
lsf_project: acc_untreatedIBD
6+
lsf_queue: premium
7+
runtime: 60
8+
9+
set-resources:
10+
to_spatialdata:
11+
mem_mb: 128_000
12+
image_write:
13+
mem_mb: 64_000
14+
patchify_transcripts:
15+
mem_mb: 32_000
16+
patch_segmentation_cellpose:
17+
lsf_queue: gpu
18+
mem_mb: 32_000
19+
runtime: 45
20+
annotate:
21+
lsf_queue: gpu
22+
mem_mb: 64_000
23+
runtime: 180
24+
novae:
25+
lsf_queue: gpu
26+
mem_mb: 64_000
27+
runtime: 45
28+
patch_segmentation_baysor:
29+
mem_mb: 32_000
30+
cpus_per_task: 2
31+
resolve_baysor:
32+
mem_mb: 128_000
33+
aggregate:
34+
mem_mb: 64_000
35+
report:
36+
mem_mb: 32_000
37+
explorer:
38+
mem_mb: 256_000
739

8-
# other options (you can keep the default values)
9-
restart-times: 0
10-
max-jobs-per-second: 100
11-
max-status-checks-per-second: 1
12-
local-cores: 1
13-
latency-wait: 60
14-
jobs: 50
40+
restart-times: 3
41+
max-jobs-per-second: 10
42+
jobs: 20000
43+
latency-wait: 2
1544
keep-going: True
1645
rerun-incomplete: True
1746
printshellcmds: True

0 commit comments

Comments
 (0)