diff --git a/workflow/lib/cloud_io.py b/workflow/lib/cloud_io.py index efed1fa..7077e0f 100644 --- a/workflow/lib/cloud_io.py +++ b/workflow/lib/cloud_io.py @@ -10,7 +10,6 @@ def is_remote(uri_string): def get_fsspec(uri_string,storage_provider_settings=None,creds=None): uri = Path(uri_string) if uri.protocol == 'gcs': - print('is gcs') from gcsfs import GCSFileSystem gcsfs_opts={} gcsfs_opts={'project': storage_provider_settings['gcs'].get_settings().project, diff --git a/workflow/rules/common.smk b/workflow/rules/common.smk index f11382f..1fe01b2 100644 --- a/workflow/rules/common.smk +++ b/workflow/rules/common.smk @@ -68,17 +68,6 @@ def get_extension_ome_zarr(): return "ome.zarr" -def strip_snakemake_touch(path): - """This strips the .snakemake_touch (see get_extension_ome_zarr) - from the given path. Use this with params to obtain a uri for the - remote file.""" - suffix = ".zarr/" + ".snakemake_touch" - if path.endswith(suffix): - return path[: -len(suffix)] + ".zarr" - else: - return path - - # targets def get_all_targets(): targets = [] diff --git a/workflow/rules/ome_zarr.smk b/workflow/rules/ome_zarr.smk index 24b3c0c..040bab1 100644 --- a/workflow/rules/ome_zarr.smk +++ b/workflow/rules/ome_zarr.smk @@ -23,7 +23,14 @@ rule zarr_to_ome_zarr: scaling_method=config["ome_zarr"]["scaling_method"], downsampling=config["bigstitcher"]["fuse_dataset"]["downsampling"], stains=get_stains, - uri=lambda wildcards, output: strip_snakemake_touch(output.zarr), + uri=_bids( + root=root, + subject="{subject}", + datatype="micr", + sample="{sample}", + acq="{acq}", + suffix="SPIM.ome.zarr", + ), storage_provider_settings=workflow.storage_provider_settings, output: **get_output_ome_zarr("blaze"), @@ -60,7 +67,14 @@ rule tif_stacks_to_ome_zarr: scaling_method=config["ome_zarr"]["scaling_method"], downsampling=config["bigstitcher"]["fuse_dataset"]["downsampling"], stains=get_stains, - uri=lambda wildcards, output: strip_snakemake_touch(output.zarr), + uri=_bids( + root=root, + subject="{subject}", + datatype="micr", + sample="{sample}", + acq="{acq}", + suffix="SPIM.ome.zarr", + ), storage_provider_settings=workflow.storage_provider_settings, output: **get_output_ome_zarr("prestitched"), @@ -121,7 +135,14 @@ rule ome_zarr_to_nii: zarr=get_input_ome_zarr_to_nii(), params: channel_index=lambda wildcards: get_stains(wildcards).index(wildcards.stain), - uri=lambda wildcards, input: strip_snakemake_touch(input.zarr), + uri=_bids( + root=root, + subject="{subject}", + datatype="micr", + sample="{sample}", + acq="{acq}", + suffix="SPIM.ome.zarr", + ), storage_provider_settings=workflow.storage_provider_settings, output: nii=bids(