diff --git a/CHANGELOG.md b/CHANGELOG.md index 4322e59a..defbf476 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ ## [1.0.3] - tbd ### Breaking changes -- `pixelsize` argument has been renamed to `pixel_size` +- `pixelsize` argument has been renamed to `pixel_size` (the snakemake pipeline is only deprecating it for now) ### Added - The `phenocycler` reader can now also read `.tif` files (not just `.qptiff`) diff --git a/sopa/cli/explorer.py b/sopa/cli/explorer.py index 7d78c0e7..61a34800 100644 --- a/sopa/cli/explorer.py +++ b/sopa/cli/explorer.py @@ -4,6 +4,10 @@ app_explorer = typer.Typer() +PIXELSIZE_DEPRECATED = ( + "`pixelsize` is deprecated and will be removed in future versions. Use `pixel_size` instead." +) + @app_explorer.command() def write( @@ -23,6 +27,10 @@ def write( 0.2125, help="Number of microns in a pixel. Invalid value can lead to inconsistent scales in the Explorer.", ), + pixelsize: float = typer.Option( + None, + help=PIXELSIZE_DEPRECATED, + ), lazy: bool = typer.Option( True, help="If `True`, will not load the full images in memory (except if the image memory is below `ram_threshold_gb`)", @@ -41,6 +49,7 @@ def write( ), ): """Convert a spatialdata object to Xenium Explorer's inputs""" + import logging from pathlib import Path from sopa.io.explorer import write @@ -51,6 +60,11 @@ def write( if output_path is None: output_path = Path(sdata_path).with_suffix(".explorer") + if pixelsize is not None: + log = logging.getLogger(__name__) + log.critical(PIXELSIZE_DEPRECATED) + pixel_size = pixelsize + write( output_path, sdata, diff --git a/workflow/Snakefile b/workflow/Snakefile index b46a9c6d..c6b2f51e 100644 --- a/workflow/Snakefile +++ b/workflow/Snakefile @@ -186,7 +186,7 @@ rule image_write: mem_mb=64_000, partition="longq" params: - args_explorer = str(args["explorer"].where(keys=['lazy', 'ram_threshold_gb', 'pixel_size'])), + args_explorer = str(args["explorer"].where(keys=['lazy', 'ram_threshold_gb', 'pixel_size', 'pixelsize'])), shell: """ sopa explorer write {paths.sdata_path} --output-path {paths.explorer_directory} {params.args_explorer} --mode '+i' --no-save-h5ad