Skip to content

Commit

Permalink
fix: citation, relational query index, python 3.12 tests (#569)
Browse files Browse the repository at this point in the history
* fix citation, fix relational query index

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix test

* fix tests

* testing against 3.12

* fix docs

* restoring tests against 3.10 instead of 3.12

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
LucaMarconato and pre-commit-ci[bot] authored May 25, 2024
1 parent 2a38051 commit 3733514
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SpatialData is a data framework that comprises a FAIR storage format and a colle
- `spatialdata-plot`: Static plotting library for `spatialdata` ([repository][spatialdata-plot-repo], [documentation][spatialdata-plot-docs]).
- `napari-spatialdata-repo`: napari plugin for interactive exploration and annotation of `spatialdata` ([repository][napari-spatialdata-repo], [documentation][napari-spatialdata-docs]).

Please see our preprint {cite}`Marconato2023.05.05.539647` for citation and to learn more.
Please see our publication {cite}`marconatoSpatialDataOpenUniversal2024` for citation and to learn more.

```{eval-rst}
.. note::
Expand Down
11 changes: 11 additions & 0 deletions docs/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,14 @@ @article {Marconato2023.05.05.539647
eprint = {https://www.biorxiv.org/content/early/2023/05/08/2023.05.05.539647.full.pdf},
journal = {bioRxiv}
}

@article{marconatoSpatialDataOpenUniversal2024,
title = {{{SpatialData}}: An Open and Universal Data Framework for Spatial Omics},
author = {Marconato, Luca and Palla, Giovanni and Yamauchi, Kevin A. and Virshup, Isaac and Heidari, Elyas and Treis, Tim and Vierdag, Wouter-Michiel and Toth, Marcella and Stockhaus, Sonja and Shrestha, Rahul B. and Rombaut, Benjamin and Pollaris, Lotte and Lehner, Laurens and V{\"o}hringer, Harald and Kats, Ilia and Saeys, Yvan and Saka, Sinem K. and Huber, Wolfgang and Gerstung, Moritz and Moore, Josh and Theis, Fabian J. and Stegle, Oliver},
year = {2024},
month = mar,
journal = {Nature Methods},
issn = {1548-7105},
doi = {10.1038/s41592-024-02212-x},
abstract = {Spatially resolved omics technologies are transforming our understanding of biological tissues. However, the handling of uni- and multimodal spatial omics datasets remains a challenge owing to large data volumes, heterogeneity of data types and the lack of flexible, spatially aware data structures. Here we introduce SpatialData, a framework that establishes a unified and extensible multiplatform file-format, lazy representation of larger-than-memory data, transformations and alignment to common coordinate systems. SpatialData facilitates spatial annotations and cross-modal aggregation and analysis, the utility of which is illustrated in the context of multiple vignettes, including integrative analysis on a multimodal Xenium and Visium breast cancer study.}
}
2 changes: 2 additions & 0 deletions src/spatialdata/_core/query/relational_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ def _get_masked_element(
if match_rows == "right":
mask_values = _match_rows(table_instance_key_column, mask, element_indices, match_rows)

if isinstance(element, DaskDataFrame):
return element.map_partitions(lambda df: df.loc[mask_values], meta=element)
return element.loc[mask_values, :]


Expand Down
2 changes: 1 addition & 1 deletion src/spatialdata/dataloader/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class ImageTilesDataset(Dataset):
tile_scale
This parameter is used to determine the size (width and height) of the tiles.
Each tile will have size in units equal to tile_scale times the diameter of the circle that approximates (=same
area) the region that defines the tile.
area) the region that defines the tile.
For example, suppose the regions to be multiscale labels; this is how the tiles are created:
Expand Down
1 change: 1 addition & 0 deletions tests/core/query/test_relational_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,7 @@ def test_points_table_joins(full_sdata):
element_dict, table = join_spatialelement_table(
sdata=full_sdata, spatial_element_names="points_0", table_name="table", how="inner"
)

assert len(element_dict["points_0"]) == 100
assert all(table.obs["instance_id"] == list(reversed(range(100))))

Expand Down

0 comments on commit 3733514

Please sign in to comment.