Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ from src import WorkflowPaths, Args, validate_config
config = validate_config(config) # validate the Snakemake config
paths = WorkflowPaths(config) # object handling the paths to the files that will be created
args = Args(paths, config) # object handling the arguments passed to the workflow
conda_env = "YOUR_ENVIRONMENT_NAME" # conda environment to use for the rules

### Segmentation rules
include: "rules/utils.smk"
Expand Down Expand Up @@ -38,7 +39,7 @@ rule to_spatialdata:
output:
paths.sdata_zgroup if paths.data_path else [],
conda:
"sopa"
conda_env
params:
reader = args['read'].as_cli(),
data_path = paths.data_path,
Expand All @@ -54,7 +55,7 @@ rule tissue_segmentation:
output:
touch(paths.segmentation_done("tissue")),
conda:
"sopa"
conda_env
params:
tissue_segmentation = args["segmentation"]["tissue"].as_cli(),
sdata_path = paths.sdata_path,
Expand All @@ -74,7 +75,7 @@ checkpoint patchify_image:
patchify_image = args["patchify"].as_cli(contains="pixel"),
sdata_path = paths.sdata_path,
conda:
"sopa"
conda_env
shell:
"""
sopa patchify image {params.sdata_path} {params.patchify_image}
Expand All @@ -92,7 +93,7 @@ checkpoint patchify_transcripts:
patchify_transcripts = args.patchify_transcripts(),
sdata_path = paths.sdata_path,
conda:
"sopa"
conda_env
shell:
"""
sopa patchify transcripts {params.sdata_path} {params.patchify_transcripts}
Expand All @@ -104,7 +105,7 @@ rule aggregate:
output:
touch(paths.smk_aggregation),
conda:
"sopa"
conda_env
params:
aggregate = args["aggregate"].as_cli(),
sdata_path = paths.sdata_path,
Expand All @@ -119,7 +120,7 @@ rule annotate:
output:
directory(paths.annotations),
conda:
"sopa"
conda_env
resources:
partition="gpgpuq" if args['annotation']['method'] == "tangram" else "shortq",
gpu="a100:1" if args['annotation']['method'] == "tangram" else 0,
Expand All @@ -138,7 +139,7 @@ rule explorer_raw:
output:
touch(paths.smk_explorer_raw),
conda:
"sopa"
conda_env
params:
explorer = args["explorer"].as_cli(keys=['lazy', 'ram_threshold_gb', 'pixel_size', 'pixelsize']),
sdata_path = paths.sdata_path,
Expand All @@ -156,7 +157,7 @@ rule explorer:
output:
paths.explorer_experiment,
conda:
"sopa"
conda_env
params:
explorer = args["explorer"].as_cli(),
sdata_path = paths.sdata_path,
Expand All @@ -177,7 +178,7 @@ rule report:
sdata_path = paths.sdata_path,
report = paths.report,
conda:
"sopa"
conda_env
shell:
"""
sopa report {params.sdata_path} {params.report}
Expand Down
4 changes: 2 additions & 2 deletions workflow/rules/cellpose.smk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ rule patch_segmentation_cellpose:
output:
paths.temp_dir("cellpose") / "{index}.parquet",
conda:
"sopa"
conda_env
params:
cellpose = args["segmentation"]["cellpose"].as_cli(),
sdata_path = paths.sdata_path,
Expand All @@ -21,7 +21,7 @@ rule resolve_cellpose:
output:
touch(paths.segmentation_done("cellpose")),
conda:
"sopa"
conda_env
params:
sdata_path = paths.sdata_path,
shell:
Expand Down
Loading