Skip to content

Commit ac4c629

Browse files
authored
Deprecate visium (#3407)
1 parent 1cd5a00 commit ac4c629

File tree

17 files changed

+625
-597
lines changed

17 files changed

+625
-597
lines changed

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@
143143
scipy=("https://docs.scipy.org/doc/scipy/", None),
144144
seaborn=("https://seaborn.pydata.org/", None),
145145
session_info2=("https://session-info2.readthedocs.io/en/stable/", None),
146+
squidpy=("https://squidpy.readthedocs.io/en/stable/", None),
146147
sklearn=("https://scikit-learn.org/stable/", None),
147148
)
148149

docs/release-notes/1.5.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The `1.5.0` release adds a lot of new functionality, much of which takes advanta
55

66
#### Spatial data support
77

8-
- Basic analysis {doc}`/tutorials/spatial/basic-analysis` and integration with single cell data {doc}`/tutorials/spatial/integration-scanorama` {smaller}`G Palla`
8+
- Tutorials for basic analysis and integration with single cell data {smaller}`G Palla`
99
- {func}`~scanpy.read_visium` read 10x Visium data {pr}`1034` {smaller}`G Palla, P Angerer, I Virshup`
1010
- {func}`~scanpy.datasets.visium_sge` load Visium data directly from 10x Genomics {pr}`1013` {smaller}`M Mirkazemi, G Palla, P Angerer`
1111
- {func}`~scanpy.pl.spatial` plot spatial data {pr}`1012` {smaller}`G Palla, P Angerer`

docs/release-notes/3407.misc.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
| Deprecate … | in favor of … |
2+
| --- | --- |
3+
| {func}`scanpy.read_visium` | {func}`squidpy.read.visium` |
4+
| {func}`scanpy.datasets.visium_sge` | {func}`squidpy.datasets.visium` |
5+
| {func}`scanpy.pl.spatial` | {func}`squidpy.pl.spatial_scatter` |
6+
7+
{smaller}`P Angerer`

docs/tutorials/index.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,6 @@ trajectories/index
3737

3838
## Spatial data
3939

40-
```{seealso}
41-
For more up-to-date tutorials on working with spatial data, see:
42-
43-
* [SquidPy tutorials](https://squidpy.readthedocs.io/en/stable/notebooks/tutorials/index.html)
44-
* [SpatialData tutorials](https://spatialdata.scverse.org/en/latest/tutorials/notebooks/notebooks.html)
45-
* [Scverse ecosystem spatial tutorials](https://scverse.org/learn/)
46-
```
47-
48-
```{toctree}
49-
:maxdepth: 2
50-
51-
spatial/index
52-
```
5340

5441
## Experimental
5542

@@ -64,3 +51,12 @@ experimental/index
6451
A number of older tutorials can be found at:
6552

6653
* The [`scanpy_usage`](https://github.com/scverse/scanpy_usage) repository
54+
55+
```{seealso}
56+
Scanpy used to have tutorials for its (now deprecated) spatial data functionality.x
57+
For up-to-date tutorials on working with spatial data, see:
58+
59+
* SquidPy {doc}`squidpy:notebooks/tutorials/index`
60+
* [SpatialData tutorials](https://spatialdata.scverse.org/en/latest/tutorials/notebooks/notebooks.html)
61+
* [Scverse ecosystem spatial tutorials](https://scverse.org/learn/)
62+
```

docs/tutorials/spatial/basic-analysis.ipynb

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/tutorials/spatial/index.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/tutorials/spatial/integration-scanorama.ipynb

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/scanpy/datasets/_datasets.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from anndata import AnnData
1010

1111
from .. import _utils
12-
from .._compat import old_positionals
12+
from .._compat import deprecated, old_positionals
1313
from .._settings import settings
1414
from .._utils._doctests import doctest_internet, doctest_needs
1515
from ..readwrite import read, read_visium
@@ -509,6 +509,7 @@ def _download_visium_dataset(
509509
return sample_dir
510510

511511

512+
@deprecated("Use `squidpy.datasets.visium` instead.")
512513
@doctest_internet
513514
@check_datasetdir_exists
514515
def visium_sge(
@@ -519,6 +520,9 @@ def visium_sge(
519520
"""\
520521
Processed Visium Spatial Gene Expression data from 10x Genomics’ database.
521522
523+
.. deprecated:: 1.11.0
524+
Use :func:`squidpy.datasets.visium` instead.
525+
522526
The database_ can be browsed online to find the ``sample_id`` you want.
523527
524528
.. _database: https://support.10xgenomics.com/spatial-gene-expression/datasets

src/scanpy/plotting/_tools/scatterplots.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from packaging.version import Version
2929

3030
from ... import logging as logg
31+
from ..._compat import deprecated
3132
from ..._settings import settings
3233
from ..._utils import (
3334
Empty, # noqa: TCH001
@@ -919,6 +920,7 @@ def pca(
919920
return axs
920921

921922

923+
@deprecated("Use `squidpy.pl.spatial_scatter` instead.")
922924
@_wraps_plot_scatter
923925
@_doc_params(
924926
adata_color_etc=doc_adata_color_etc,
@@ -948,6 +950,9 @@ def spatial(
948950
"""\
949951
Scatter plot in spatial coordinates.
950952
953+
.. deprecated:: 1.11.0
954+
Use :func:`squidpy.pl.spatial_scatter` instead.
955+
951956
This function allows overlaying data on top of images.
952957
Use the parameter `img_key` to see the image in the background
953958
And the parameter `library_id` to select the image.
@@ -994,8 +999,6 @@ def spatial(
994999
--------
9951000
:func:`scanpy.datasets.visium_sge`
9961001
Example visium data.
997-
:doc:`/tutorials/spatial/basic-analysis`
998-
Tutorial on spatial analysis.
9991002
"""
10001003
# get default image params if available
10011004
library_id, spatial_data = _check_spatial_data(adata.uns, library_id)

src/scanpy/readwrite.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
from matplotlib.image import imread
3737

3838
from . import logging as logg
39-
from ._compat import add_note, old_positionals
39+
from ._compat import add_note, deprecated, old_positionals
4040
from ._settings import settings
4141
from ._utils import _empty
4242

@@ -366,6 +366,7 @@ def _read_v3_10x_h5(filename, *, start=None):
366366
raise Exception("File is missing one or more required datasets.")
367367

368368

369+
@deprecated("Use `squidpy.read.visium` instead.")
369370
def read_visium(
370371
path: Path | str,
371372
genome: str | None = None,
@@ -378,6 +379,9 @@ def read_visium(
378379
"""\
379380
Read 10x-Genomics-formatted visum dataset.
380381
382+
.. deprecated:: 1.11.0
383+
Use :func:`squidpy.read.visium` instead.
384+
381385
In addition to reading regular 10x output,
382386
this looks for the `spatial` folder and loads images,
383387
coordinates and scale factors.

0 commit comments

Comments
 (0)