Skip to content

Commit c63fc9e

Browse files
committed
Add other conda env support
1 parent 0763618 commit c63fc9e

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

workflow/Snakefile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ from src import WorkflowPaths, Args, validate_config
33
config = validate_config(config) # validate the Snakemake config
44
paths = WorkflowPaths(config) # object handling the paths to the files that will be created
55
args = Args(paths, config) # object handling the arguments passed to the workflow
6+
conda_env = "YOUR_ENVIRONMENT_NAME" # conda environment to use for the rules
67

78
### Segmentation rules
89
include: "rules/utils.smk"
@@ -38,7 +39,7 @@ rule to_spatialdata:
3839
output:
3940
paths.sdata_zgroup if paths.data_path else [],
4041
conda:
41-
"sopa"
42+
conda_env
4243
params:
4344
reader = args['read'].as_cli(),
4445
data_path = paths.data_path,
@@ -54,7 +55,7 @@ rule tissue_segmentation:
5455
output:
5556
touch(paths.segmentation_done("tissue")),
5657
conda:
57-
"sopa"
58+
conda_env
5859
params:
5960
tissue_segmentation = args["segmentation"]["tissue"].as_cli(),
6061
sdata_path = paths.sdata_path,
@@ -74,7 +75,7 @@ checkpoint patchify_image:
7475
patchify_image = args["patchify"].as_cli(contains="pixel"),
7576
sdata_path = paths.sdata_path,
7677
conda:
77-
"sopa"
78+
conda_env
7879
shell:
7980
"""
8081
sopa patchify image {params.sdata_path} {params.patchify_image}
@@ -92,7 +93,7 @@ checkpoint patchify_transcripts:
9293
patchify_transcripts = args.patchify_transcripts(),
9394
sdata_path = paths.sdata_path,
9495
conda:
95-
"sopa"
96+
conda_env
9697
shell:
9798
"""
9899
sopa patchify transcripts {params.sdata_path} {params.patchify_transcripts}
@@ -104,7 +105,7 @@ rule aggregate:
104105
output:
105106
touch(paths.smk_aggregation),
106107
conda:
107-
"sopa"
108+
conda_env
108109
params:
109110
aggregate = args["aggregate"].as_cli(),
110111
sdata_path = paths.sdata_path,
@@ -119,7 +120,7 @@ rule annotate:
119120
output:
120121
directory(paths.annotations),
121122
conda:
122-
"sopa"
123+
conda_env
123124
resources:
124125
partition="gpgpuq" if args['annotation']['method'] == "tangram" else "shortq",
125126
gpu="a100:1" if args['annotation']['method'] == "tangram" else 0,
@@ -138,7 +139,7 @@ rule explorer_raw:
138139
output:
139140
touch(paths.smk_explorer_raw),
140141
conda:
141-
"sopa"
142+
conda_env
142143
params:
143144
explorer = args["explorer"].as_cli(keys=['lazy', 'ram_threshold_gb', 'pixel_size', 'pixelsize']),
144145
sdata_path = paths.sdata_path,
@@ -156,7 +157,7 @@ rule explorer:
156157
output:
157158
paths.explorer_experiment,
158159
conda:
159-
"sopa"
160+
conda_env
160161
params:
161162
explorer = args["explorer"].as_cli(),
162163
sdata_path = paths.sdata_path,
@@ -177,7 +178,7 @@ rule report:
177178
sdata_path = paths.sdata_path,
178179
report = paths.report,
179180
conda:
180-
"sopa"
181+
conda_env
181182
shell:
182183
"""
183184
sopa report {params.sdata_path} {params.report}

workflow/rules/cellpose.smk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ rule patch_segmentation_cellpose:
55
output:
66
paths.temp_dir("cellpose") / "{index}.parquet",
77
conda:
8-
"sopa"
8+
conda_env
99
params:
1010
cellpose = args["segmentation"]["cellpose"].as_cli(),
1111
sdata_path = paths.sdata_path,
@@ -21,7 +21,7 @@ rule resolve_cellpose:
2121
output:
2222
touch(paths.segmentation_done("cellpose")),
2323
conda:
24-
"sopa"
24+
conda_env
2525
params:
2626
sdata_path = paths.sdata_path,
2727
shell:

0 commit comments

Comments
 (0)