Skip to content

Commit

Permalink
snakefmt, update container
Browse files Browse the repository at this point in the history
  • Loading branch information
akhanf committed Jan 30, 2025
1 parent c801639 commit 7649d46
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 26 deletions.
2 changes: 1 addition & 1 deletion config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,5 @@ report:


containers:
spimprep: 'docker://khanlab/spimprep-deps:imaris-deps'
spimprep: 'docker://khanlab/spimprep-deps:v0.1.1'

2 changes: 1 addition & 1 deletion workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def get_input_sample(wildcards):
# sample was a tar file, so point to the extracted folder
return rules.extract_sample.output.ome_dir.format(**wildcards)

elif sample_path.suffixes[-1] == '.ims':
elif sample_path.suffixes[-1] == ".ims":
return get_sample_path_remote(wildcards)
else:
print(f"unsupported input: {sample_path}")
Expand Down
51 changes: 29 additions & 22 deletions workflow/rules/imaris.smk
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,24 @@ rule imaris_to_metadata:
script:
"../scripts/imaris_to_metadata.py"


rule imaris_channel_to_zarr:
input:
ims=get_input_sample,
params:
channel=lambda wildcards: get_stains(wildcards).index(wildcards.stain),
output:
zarr=temp(bids(
root=work,
subject="{subject}",
datatype="micr",
sample="{sample}",
acq="{acq}",
stain="{stain}",
suffix="imaris.zarr.zip",
)),
zarr=temp(
bids(
root=work,
subject="{subject}",
datatype="micr",
sample="{sample}",
acq="{acq}",
stain="{stain}",
suffix="imaris.zarr.zip",
)
),
log:
bids(
root="logs",
Expand All @@ -68,22 +71,27 @@ rule imaris_channel_to_zarr:
resources:
runtime=360,
mem_mb=1000,
shadow: 'minimal'
shadow:
"minimal"
script:
"../scripts/imaris_channel_to_zarr.py"


rule imaris_to_ome_zarr:
input:
zarr=lambda wildcards: expand(bids(
root=work,
subject="{subject}",
datatype="micr",
sample="{sample}",
acq="{acq}",
stain="{stain}",
suffix="imaris.zarr.zip",
),stain=get_stains(wildcards),allow_missing=True),
zarr=lambda wildcards: expand(
bids(
root=work,
subject="{subject}",
datatype="micr",
sample="{sample}",
acq="{acq}",
stain="{stain}",
suffix="imaris.zarr.zip",
),
stain=get_stains(wildcards),
allow_missing=True,
),
metadata_json=rules.prestitched_to_metadata.output.metadata_json,
params:
max_downsampling_layers=config["ome_zarr"]["max_downsampling_layers"],
Expand Down Expand Up @@ -112,8 +120,7 @@ rule imaris_to_ome_zarr:
resources:
runtime=360,
mem_mb=config["total_mem_mb"],
shadow: 'minimal'
shadow:
"minimal"
script:
"../scripts/imaris_to_ome_zarr.py"


2 changes: 0 additions & 2 deletions workflow/rules/ome_zarr.smk
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ rule tif_stacks_to_ome_zarr:
"../scripts/tif_stacks_to_ome_zarr.py"



rule ome_zarr_to_nii:
input:
**get_storage_creds(),
Expand Down Expand Up @@ -138,4 +137,3 @@ rule ome_zarr_to_nii:
config["containers"]["spimprep"]
script:
"../scripts/ome_zarr_to_nii.py"

0 comments on commit 7649d46

Please sign in to comment.