Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b1e6d06
feat: suppor for spaceranger4.0
stephenwilliams22 Sep 24, 2025
a6d7e9f
make nuc segmentation and cut dup code
stephenwilliams22 Oct 2, 2025
31379c8
use only in_nucleus
stephenwilliams22 Oct 2, 2025
34ac722
make local functions
stephenwilliams22 Oct 2, 2025
b7848fa
ruff
stephenwilliams22 Oct 6, 2025
ae43fe7
typing
stephenwilliams22 Oct 6, 2025
31c76fd
nuc seg cli
stephenwilliams22 Oct 7, 2025
9134c94
tests
stephenwilliams22 Oct 8, 2025
42028ce
add vignette
stephenwilliams22 Oct 10, 2025
b269d32
update BARCODE_MAPPINGS_PATH and calc centroids
stephenwilliams22 Oct 10, 2025
0e891ec
delete vignette. moved to new PR
stephenwilliams22 Oct 13, 2025
c9674ca
Merge branch 'main' into stephen/spaceranger4.0
LucaMarconato Oct 22, 2025
49d3e7e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 22, 2025
30e4076
wip code review visium hd
LucaMarconato Oct 24, 2025
cc9dc68
wip code review
LucaMarconato Oct 24, 2025
e5c2d16
initial review pass
LucaMarconato Oct 24, 2025
ab3611b
Merge branch 'main' into stephen/spaceranger4.0
LucaMarconato Oct 27, 2025
8cecbf3
pin pyarrow
LucaMarconato Oct 27, 2025
4b8a41f
fix docstring
LucaMarconato Oct 27, 2025
39ffde5
code review simplification
LucaMarconato Oct 27, 2025
01583e0
fix typo
LucaMarconato Oct 27, 2025
8bb3ab9
fix unnecessary check
LucaMarconato Oct 27, 2025
3098486
fix unnecessary check
LucaMarconato Oct 27, 2025
955a9a6
fix docstring
LucaMarconato Oct 27, 2025
6f6459c
update tests
stephenwilliams22 Oct 29, 2025
0d11d26
revert python change and update pytest
stephenwilliams22 Oct 29, 2025
0fe6b77
test precommit
stephenwilliams22 Oct 29, 2025
62c3f9f
ruff
stephenwilliams22 Oct 29, 2025
032a9bd
add deprecation warning for load_segmentations_only in visium_hd
LucaMarconato Nov 3, 2025
644f8c7
Merge commit 'refs/pull/328/head' of https://github.com/scverse/spati…
LucaMarconato Nov 3, 2025
1db1c01
fix visium_hd cli
LucaMarconato Nov 3, 2025
b94f096
fix min test small datasets
LucaMarconato Nov 3, 2025
301650e
fix bug cli bin sizes
LucaMarconato Nov 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/prepare_test_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
# the Visium HD dataset is licensed as CC BY 4.0, as shown here
# https://www.10xgenomics.com/support/software/space-ranger/latest/resources/visium-hd-example-data

# 10x Genomics Visium HD 4.0.1 3' Mouse Brain
# 10x Genomics Visium HD 4.0.1 3' Mouse Brain Chunk
curl -O https://cf.10xgenomics.com/samples/spatial-exp/4.0.1/Visium_HD_Tiny_3prime_Dataset/Visium_HD_Tiny_3prime_Dataset_outs.zip

# -------
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies = [
"joblib",
"imagecodecs",
"dask-image",
"pyarrow",
"pyarrow<22.0.0", # https://github.com/scverse/spatialdata-io/issues/334
"readfcs",
"tifffile>=2023.8.12",
"ome-types",
Expand Down
15 changes: 15 additions & 0 deletions src/spatialdata_io/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,24 @@ def visium_wrapper(
default=False,
help="If true, annotates the table by labels. [default: False]",
)
@click.option(
"--load-segmentations-only",
default=None,
help="If `True`, only the segmented cell boundaries and their associated counts will be loaded. All binned data will be skipped. [default: None, which will fall back to `False` with a deprecation warning]",
)
@click.option(
"--load-nucleus-segmentations",
type=bool,
default=False,
help="If `True` and nucleus segmentation files are present, load nucleus segmentation polygons and the corresponding nucleus-filtered count table. [default: False]",
)
def visium_hd_wrapper(
input: str,
output: str,
dataset_id: str | None = None,
filtered_counts_file: bool = True,
load_segmentations_only: bool | None = None,
load_nucleus_segmentations: bool = False,
bin_size: int | list[int] | None = None,
bins_as_squares: bool = True,
fullres_image_file: str | Path | None = None,
Expand All @@ -428,6 +441,8 @@ def visium_hd_wrapper(
path=input,
dataset_id=dataset_id,
filtered_counts_file=filtered_counts_file,
load_segmentations_only=load_segmentations_only,
load_nucleus_segmentations=load_nucleus_segmentations,
bin_size=bin_size,
bins_as_squares=bins_as_squares,
fullres_image_file=fullres_image_file,
Expand Down
9 changes: 9 additions & 0 deletions src/spatialdata_io/_constants/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,16 @@ class VisiumHDKeys(ModeEnum):
BIN_PREFIX = "square_"
MICROSCOPE_IMAGE = "microscope_image"
BINNED_OUTPUTS = "binned_outputs"
SEGMENTATION_OUTPUTS = "segmented_outputs"

# counts and locations files
FILTERED_COUNTS_FILE = "filtered_feature_bc_matrix.h5"
RAW_COUNTS_FILE = "raw_feature_bc_matrix.h5"
TISSUE_POSITIONS_FILE = "tissue_positions.parquet"
BARCODE_MAPPINGS_FILE = "barcode_mappings.parquet"
FILTERED_CELL_COUNTS_FILE = "filtered_feature_cell_matrix.h5"
CELL_SEGMENTATION_GEOJSON_PATH = "cell_segmentations.geojson"
NUCLEUS_SEGMENTATION_GEOJSON_PATH = "nucleus_segmentations.geojson"

# images
IMAGE_HIRES_FILE = "tissue_hires_image.png"
Expand Down Expand Up @@ -402,3 +407,7 @@ class VisiumHDKeys(ModeEnum):
MICROSCOPE_COLROW_TO_SPOT_COLROW = ("microscope_colrow_to_spot_colrow",)
SPOT_COLROW_TO_MICROSCOPE_COLROW = ("spot_colrow_to_microscope_colrow",)
FILE_FORMAT = "file_format"

# Cell Segmentation keys
CELL_SEG_KEY_HD = "cell_segmentations"
NUCLEUS_SEG_KEY_HD = "nucleus_segmentations"
Loading
Loading