Skip to content

Commit

Permalink
enable writing directly to zipstore
Browse files Browse the repository at this point in the history
note: need to enable this for non-imaris files too
also, some of the remote storage features may be broken
  • Loading branch information
akhanf committed Jan 15, 2025
1 parent 79e61a2 commit 661b345
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 86 deletions.
10 changes: 5 additions & 5 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,12 @@ def get_output_ome_zarr(acq_type):
if config["use_zipstore"]:
return {
"zarr": bids(
root=work,
root=root,
subject="{subject}",
datatype="micr",
sample="{sample}",
acq=f"{{acq,[a-zA-Z0-9]*{acq_type}[a-zA-Z0-9]*}}",
suffix="SPIM.ome.zarr",
suffix="SPIM.ome.zarr.zip",
)
}
else:
Expand All @@ -303,12 +303,12 @@ def get_output_ome_zarr(acq_type):
if config["use_zipstore"]:
return {
"zarr": bids(
root=work,
root=root,
subject="{subject}",
datatype="micr",
sample="{sample}",
acq=f"{{acq,[a-zA-Z0-9]*{acq_type}[a-zA-Z0-9]*}}",
suffix="SPIM.ome.zarr",
suffix="SPIM.ome.zarr.zip",
)
}
else:
Expand All @@ -334,7 +334,7 @@ def get_input_ome_zarr_to_nii(wildcards):
datatype="micr",
sample="{sample}",
acq="{acq}",
suffix="SPIM.ome.zarr",
suffix="SPIM.ome.zarr.zip",
).format(**wildcards)
else:
return bids(
Expand Down
47 changes: 0 additions & 47 deletions workflow/rules/imaris.smk
Original file line number Diff line number Diff line change
Expand Up @@ -35,56 +35,9 @@ 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=directory(bids(
root=root,
subject="{subject}",
datatype="micr",
sample="{sample}",
acq="{acq}",
stain="{stain}",
suffix="imaris.zarr",
)),
log:
bids(
root="logs",
subject="{subject}",
datatype="imaris_channel_to_zarr",
sample="{sample}",
acq="{acq}",
stain="{stain}",
suffix="log.txt",
),
container:
config["containers"]["spimprep"]
group:
"preproc"
threads: 1
resources:
runtime=360,
mem_mb=1000,
shadow: 'minimal'
script:
"../scripts/imaris_channel_to_zarr.py"


rule imaris_to_ome_zarr:
input:
ims=get_input_sample,
zarr=lambda wildcards: expand(bids(
root=root,
subject="{subject}",
datatype="micr",
sample="{sample}",
acq="{acq}",
stain="{stain}",
suffix="imaris.zarr",
),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
34 changes: 0 additions & 34 deletions workflow/rules/ome_zarr.smk
Original file line number Diff line number Diff line change
Expand Up @@ -89,40 +89,6 @@ rule tif_stacks_to_ome_zarr:
"../scripts/tif_stacks_to_ome_zarr.py"


rule ome_zarr_to_zipstore:
""" use 7zip to create a zipstore """
input:
zarr=bids(
root=work,
subject="{subject}",
datatype="micr",
sample="{sample}",
acq="{acq}",
suffix="SPIM.ome.zarr",
),
output:
zarr_zip=bids(
root=root,
subject="{subject}",
datatype="micr",
sample="{sample}",
acq="{acq}",
suffix="SPIM.ome.zarr.zip",
),
log:
bids(
root="logs",
subject="{subject}",
datatype="micr",
sample="{sample}",
acq="{acq}",
suffix="log.txt",
),
group:
"preproc"
shell:
"7z a -mx0 -tzip {output.zarr_zip} {input.zarr}/. &> {log}"


rule ome_zarr_to_nii:
input:
Expand Down

0 comments on commit 661b345

Please sign in to comment.