Sopa

Latest version: v2.0.0

Safety actively analyzes 701442 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 4

2.0.0

This version introduces many new API features but also some breaking changes; check [our migration guide](https://github.com/gustaveroussy/sopa/discussions/138) to smoothly update your code base.

Added
- Full Visium HD support (including, notably, bins aggregation)
- Dask parallelization backend for faster segmentation (useful for API users). This can be done via `sopa.settings.parallelization_backend = 'dask'`. More details in the FAQ.
- Support for one-line segmentation, e.g. `sopa.segmentation.cellpose(sdata, ...)` or `sopa.segmentation.baysor(sdata, ...)`. This will implicitly use the selected parallelization backend.
- Spatial elements keys are saved in `sdata.attrs` so that Sopa knows automatically which element should be used in which function. It is still possible to precise `image_key` / `points_key` / `shapes_key` if needed. More details in the FAQ.
- Allows changing the auto-save settings (i.e. decide if spatial elements are saved on-disk automatically or not). This can be done via `sopa.settings.auto_save_on_disk = False`.
- Can recover a failed/stopped segmentation when using the API (and also `force` a segmentation, for Baysor)
- Better cache handling (invisible to API users)
- New tissue segmentation for non-H&E data (`sopa.segmentation.tissue`)
- Full support for `baysor>=0.7.0`
- Added `Stardist` segmentation (mainly used for H&E data)
- Added support for Python 3.12

Changes
- The `sopa.io.uniform` dataset is now deprecated (use `sopa.io.toy_dataset` instead)
- API: The image patches are now called `sdata["image_patches"]` instead of `sdata["sopa_patches"]`

Breaking changes
- Drop support for Python 3.9
- API: `sopa.segmentation.Patches2D` is deprecated. Instead, use the functions `sopa.make_image_patches` or `sopa.make_transcript_patches`
- API: Use `sopa.overlay_segmentation` instead of `sopa.segmentation.overlay_segmentation`
- API: The `Aggregator` class has been replaced by a simple function wrapper: `sopa.aggregate`
- API: The annotations methods are moved to the utils. For instance, use `sopa.utils.higher_z_score` instead of `sopa.annotation.higher_z_score`
- CLI: `sopa read` has been renamed `sopa convert` to avoid confusion.
- CLI: during segmentation, use `--cache-dir-name` instead of `--patch-dir`
- Drop support for Python 3.9

Fixes
- Snakemake path issue on Windows (64)
- Issues related to incompatible versions of Baysor

1.1.6

Fix
- Support `baysor>=0.7.0` (125, lguerard).
- NB: For Snakemake, please remove the `new_component_*` arguments from the Baysor config.
- Use `DataTree` from `xarray` - use new spatialdata version (159)

1.1.5

Fix
- Accept `object` dtype for channel names (114)

Changed
- Update MACSima reader to read the channel names of the latest file format

1.1.4

Hotfix
- Fixed Baysor issue on MERSCOPE data with the Vizgen prior
- Fix patch-maker issue due to new API temporary implementation

1.1.3

Fix
- Fixed aggregation issue when gene names are `NaN` or `None` (101)
- Fix Xenium reader for old Xenium data format (105)

Added
- Support multipolygons in ROI rasterization
- Added bins aggregation
- Added Visium HD reader (tutorial coming soon)

Changed
- Import submodules in init (segmentation, io, utils)
- API simplification in progress (new API + tutorial coming soon)

1.1.2

Fix
- Convert intensities values in integer for the `ome_tif` and `aicsimageio` readers
- Fix cellpose `pretrained_model` weights unused (pakiessling, 90)
- Prevent spillover during image preprocessing before segmentation (pakiessling, 90)

Added
- Blur and CLAHE can be disabled by setting the parameter to 0 (pakiessling, 90)
- Added an optional parameter clahe_kernel_size for skimage.exposure.equalize_adapthist (pakiessling, 90)
- Check that the image has an integer dtype before segmentation (better error log 92)

Page 1 of 4

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.