spatialdata-io


Namespatialdata-io JSON
Version 0.3.0 PyPI version JSON
download
home_pageNone
SummarySpatialData IO for common techs
upload_time2025-08-15 21:41:24
maintainerNone
docs_urlNone
authorscverse
requires_python>=3.10
licenseBSD 3-Clause License Copyright (c) 2022, scverse® All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![SpatialData banner](https://github.com/scverse/spatialdata/blob/main/docs/_static/img/spatialdata_horizontal.png?raw=true)

# spatialdata-io: convenient readers for loading common formats into SpatialData

[![Tests][badge-tests]][link-tests]
[![Documentation][badge-docs]][link-docs]
[![DOI](https://zenodo.org/badge/544045123.svg)](https://zenodo.org/badge/latestdoi/544045123)
[![Documentation][badge-pypi]][link-pypi]
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/spatialdata-io/badges/version.svg)](https://anaconda.org/conda-forge/spatialdata-io)

[badge-tests]: https://github.com/scverse/spatialdata-io/actions/workflows/test.yaml/badge.svg
[link-tests]: https://github.com/scverse/spatialdata-io/actions/workflows/test.yaml
[badge-docs]: https://img.shields.io/readthedocs/spatialdata-io
[badge-pypi]: https://badge.fury.io/py/spatialdata-io.svg
[link-pypi]: https://pypi.org/project/spatialdata-io/

This package contains reader functions to load common spatial omics formats into SpatialData. Currently, we provide support for:

- 10x Genomics Visium®
- 10x Genomics Visium HD®
- 10x Genomics Xenium®
- Akoya PhenoCycler® (formerly CODEX®)
- Curio Seeker®
- DBiT-seq
- MCMICRO (output data)
- NanoString CosMx®
- Spatial Genomics GenePS® (seqFISH)
- Steinbock (output data)
- STOmics Stereo-seq®
- Vizgen MERSCOPE® (MERFISH)
- MACSima® (MACS® iQ View output)

Note: all mentioned technologies are registered trademarks of their respective companies.

## Known limitations

Contributions for addressing the below limitations are very welcomed.

- Only Stereo-seq 7.x is supported, 8.x is not currently supported. https://github.com/scverse/spatialdata-io/issues/161

### How to Contribute

1. **Open a GitHub Issue**: Start by opening a new issue or commenting on an existing one in the repository. Clearly describe the problem and your proposed changes to avoid overlapping efforts with others.

2. **Submit a Pull Request (PR)**: Once the issue is discussed, submit a PR to the `spatialdata-io` repository. Ensure your PR includes information about a suitable dataset for testing the reader, ideally no larger than 10 GB. Include clear instructions for accessing the data, preferably with a `curl` or `wget` command for easy downloading.

3. **Optional Enhancements**: To facilitate reproducibility and ease of data access, consider adding a folder in the [spatialdata-sandbox](https://github.com/giovp/spatialdata-sandbox) repository. Include a `download.py` and `to_zarr.py` script (refer to examples in the repository) to enable others to reproduce your reader by simply running these scripts sequentially.

## Getting started

Please refer to the [documentation][link-docs]. In particular, the

- [API documentation][link-api].
- [CLI documentation][link-cli].

## Installation

You need to have Python 3.8 or newer installed on your system. If you don't have
Python installed, we recommend installing [Miniconda](https://docs.conda.io/en/latest/miniconda.html).

There are several alternative options to install spatialdata-io:

1. Install the latest release of `spatialdata-io` from [PyPI](https://pypi.org/project/spatialdata-io/):

```bash
pip install spatialdata-io
```

2. Install the latest development version:

```bash
pip install git+https://github.com/scverse/spatialdata-io.git@main
```

## Contact

For questions and help requests, you can reach out in the [scverse discourse][scverse-discourse].
If you found a bug, please use the [issue tracker][issue-tracker].

## Readers from third-party libraries

Technologies that can be read into `SpatialData` objects using third-party libraries:

- METASPACE (MALDI, ...): [metaspace-converter](https://github.com/metaspace2020/metaspace-converter)
- PhenoCycler®: [SOPA](https://github.com/gustaveroussy/sopa)
- MACSima®: [SOPA](https://github.com/gustaveroussy/sopa)
- Hyperion® (Imaging Mass Cytometry): [SOPA](https://github.com/gustaveroussy/sopa)

## Disclaimer

This library is community maintained and is not officially endorsed by the aforementioned spatial technology companies. As such, we cannot offer any warranty of the correctness of the representation. Furthermore, we cannot ensure the correctness of the readers for every data version as the technologies evolve and update their formats. If you find a bug or notice a misrepresentation of the data please report it via our [Bug Tracking System](https://github.com/scverse/spatialdata-io/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen) so that it can be addressed either by the maintainers of this library or by the community.

## Solutions to common problems

### Problem: I cannot visualize the data, everything is slow

Solution: after parsing the data with `spatialdata-io` readers, you need to write it to Zarr and read it again. Otherwise the performance advantage given by the SpatialData Zarr format will not available.

```python
from spatialdata_io import xenium
from spatialdata import read_zarr

sdata = xenium("raw_data")
sdata.write("data.zarr")
sdata = read_zarr("sdata.zarr")
```

## Citation

Marconato, L., Palla, G., Yamauchi, K.A. et al. SpatialData: an open and universal data framework for spatial omics. Nat Methods (2024). https://doi.org/10.1038/s41592-024-02212-x

[scverse-discourse]: https://discourse.scverse.org/
[issue-tracker]: https://github.com/scverse/spatialdata-io/issues
[changelog]: https://spatialdata.scverse.org/projects/io/en/stable/changelog.html
[link-docs]: https://spatialdata.scverse.org/projects/io/en/stable/
[link-api]: https://spatialdata.scverse.org/projects/io/en/stable/api.html
[link-cli]: https://spatialdata.scverse.org/projects/io/en/stable/cli.html
[//]: # "numfocus-fiscal-sponsor-attribution"

spatialdata-io is part of the scverse® project ([website](https://scverse.org), [governance](https://scverse.org/about/roles)) and is fiscally sponsored by [NumFOCUS](https://numfocus.org/).
If you like scverse® and want to support our mission, please consider making a tax-deductible [donation](https://numfocus.org/donate-to-scverse) to help the project pay for developer time, professional services, travel, workshops, and a variety of other needs.

<div align="center">
<a href="https://numfocus.org/project/scverse">
  <img
    src="https://raw.githubusercontent.com/numfocus/templates/master/images/numfocus-logo.png"
    width="200"
  >
</a>
</div>

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "spatialdata-io",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "scverse <scverse@scverse.scverse>",
    "keywords": null,
    "author": "scverse",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/4c/7d/19792b9da1c371d805155f284da576dafe72024dd62ced6d7cc6ce4411c1/spatialdata_io-0.3.0.tar.gz",
    "platform": null,
    "description": "![SpatialData banner](https://github.com/scverse/spatialdata/blob/main/docs/_static/img/spatialdata_horizontal.png?raw=true)\n\n# spatialdata-io: convenient readers for loading common formats into SpatialData\n\n[![Tests][badge-tests]][link-tests]\n[![Documentation][badge-docs]][link-docs]\n[![DOI](https://zenodo.org/badge/544045123.svg)](https://zenodo.org/badge/latestdoi/544045123)\n[![Documentation][badge-pypi]][link-pypi]\n[![Anaconda-Server Badge](https://anaconda.org/conda-forge/spatialdata-io/badges/version.svg)](https://anaconda.org/conda-forge/spatialdata-io)\n\n[badge-tests]: https://github.com/scverse/spatialdata-io/actions/workflows/test.yaml/badge.svg\n[link-tests]: https://github.com/scverse/spatialdata-io/actions/workflows/test.yaml\n[badge-docs]: https://img.shields.io/readthedocs/spatialdata-io\n[badge-pypi]: https://badge.fury.io/py/spatialdata-io.svg\n[link-pypi]: https://pypi.org/project/spatialdata-io/\n\nThis package contains reader functions to load common spatial omics formats into SpatialData. Currently, we provide support for:\n\n- 10x Genomics Visium\u00ae\n- 10x Genomics Visium HD\u00ae\n- 10x Genomics Xenium\u00ae\n- Akoya PhenoCycler\u00ae (formerly CODEX\u00ae)\n- Curio Seeker\u00ae\n- DBiT-seq\n- MCMICRO (output data)\n- NanoString CosMx\u00ae\n- Spatial Genomics GenePS\u00ae (seqFISH)\n- Steinbock (output data)\n- STOmics Stereo-seq\u00ae\n- Vizgen MERSCOPE\u00ae (MERFISH)\n- MACSima\u00ae (MACS\u00ae iQ View output)\n\nNote: all mentioned technologies are registered trademarks of their respective companies.\n\n## Known limitations\n\nContributions for addressing the below limitations are very welcomed.\n\n- Only Stereo-seq 7.x is supported, 8.x is not currently supported. https://github.com/scverse/spatialdata-io/issues/161\n\n### How to Contribute\n\n1. **Open a GitHub Issue**: Start by opening a new issue or commenting on an existing one in the repository. Clearly describe the problem and your proposed changes to avoid overlapping efforts with others.\n\n2. **Submit a Pull Request (PR)**: Once the issue is discussed, submit a PR to the `spatialdata-io` repository. Ensure your PR includes information about a suitable dataset for testing the reader, ideally no larger than 10 GB. Include clear instructions for accessing the data, preferably with a `curl` or `wget` command for easy downloading.\n\n3. **Optional Enhancements**: To facilitate reproducibility and ease of data access, consider adding a folder in the [spatialdata-sandbox](https://github.com/giovp/spatialdata-sandbox) repository. Include a `download.py` and `to_zarr.py` script (refer to examples in the repository) to enable others to reproduce your reader by simply running these scripts sequentially.\n\n## Getting started\n\nPlease refer to the [documentation][link-docs]. In particular, the\n\n- [API documentation][link-api].\n- [CLI documentation][link-cli].\n\n## Installation\n\nYou need to have Python 3.8 or newer installed on your system. If you don't have\nPython installed, we recommend installing [Miniconda](https://docs.conda.io/en/latest/miniconda.html).\n\nThere are several alternative options to install spatialdata-io:\n\n1. Install the latest release of `spatialdata-io` from [PyPI](https://pypi.org/project/spatialdata-io/):\n\n```bash\npip install spatialdata-io\n```\n\n2. Install the latest development version:\n\n```bash\npip install git+https://github.com/scverse/spatialdata-io.git@main\n```\n\n## Contact\n\nFor questions and help requests, you can reach out in the [scverse discourse][scverse-discourse].\nIf you found a bug, please use the [issue tracker][issue-tracker].\n\n## Readers from third-party libraries\n\nTechnologies that can be read into `SpatialData` objects using third-party libraries:\n\n- METASPACE (MALDI, ...): [metaspace-converter](https://github.com/metaspace2020/metaspace-converter)\n- PhenoCycler\u00ae: [SOPA](https://github.com/gustaveroussy/sopa)\n- MACSima\u00ae: [SOPA](https://github.com/gustaveroussy/sopa)\n- Hyperion\u00ae (Imaging Mass Cytometry): [SOPA](https://github.com/gustaveroussy/sopa)\n\n## Disclaimer\n\nThis library is community maintained and is not officially endorsed by the aforementioned spatial technology companies. As such, we cannot offer any warranty of the correctness of the representation. Furthermore, we cannot ensure the correctness of the readers for every data version as the technologies evolve and update their formats. If you find a bug or notice a misrepresentation of the data please report it via our [Bug Tracking System](https://github.com/scverse/spatialdata-io/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen) so that it can be addressed either by the maintainers of this library or by the community.\n\n## Solutions to common problems\n\n### Problem: I cannot visualize the data, everything is slow\n\nSolution: after parsing the data with `spatialdata-io` readers, you need to write it to Zarr and read it again. Otherwise the performance advantage given by the SpatialData Zarr format will not available.\n\n```python\nfrom spatialdata_io import xenium\nfrom spatialdata import read_zarr\n\nsdata = xenium(\"raw_data\")\nsdata.write(\"data.zarr\")\nsdata = read_zarr(\"sdata.zarr\")\n```\n\n## Citation\n\nMarconato, L., Palla, G., Yamauchi, K.A. et al. SpatialData: an open and universal data framework for spatial omics. Nat Methods (2024). https://doi.org/10.1038/s41592-024-02212-x\n\n[scverse-discourse]: https://discourse.scverse.org/\n[issue-tracker]: https://github.com/scverse/spatialdata-io/issues\n[changelog]: https://spatialdata.scverse.org/projects/io/en/stable/changelog.html\n[link-docs]: https://spatialdata.scverse.org/projects/io/en/stable/\n[link-api]: https://spatialdata.scverse.org/projects/io/en/stable/api.html\n[link-cli]: https://spatialdata.scverse.org/projects/io/en/stable/cli.html\n[//]: # \"numfocus-fiscal-sponsor-attribution\"\n\nspatialdata-io is part of the scverse\u00ae project ([website](https://scverse.org), [governance](https://scverse.org/about/roles)) and is fiscally sponsored by [NumFOCUS](https://numfocus.org/).\nIf you like scverse\u00ae and want to support our mission, please consider making a tax-deductible [donation](https://numfocus.org/donate-to-scverse) to help the project pay for developer time, professional services, travel, workshops, and a variety of other needs.\n\n<div align=\"center\">\n<a href=\"https://numfocus.org/project/scverse\">\n  <img\n    src=\"https://raw.githubusercontent.com/numfocus/templates/master/images/numfocus-logo.png\"\n    width=\"200\"\n  >\n</a>\n</div>\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License\n        \n        Copyright (c) 2022, scverse\u00ae\n        All rights reserved.\n        \n        Redistribution and use in source and binary forms, with or without\n        modification, are permitted provided that the following conditions are met:\n        \n        1. Redistributions of source code must retain the above copyright notice, this\n           list of conditions and the following disclaimer.\n        \n        2. Redistributions in binary form must reproduce the above copyright notice,\n           this list of conditions and the following disclaimer in the documentation\n           and/or other materials provided with the distribution.\n        \n        3. Neither the name of the copyright holder nor the names of its\n           contributors may be used to endorse or promote products derived from\n           this software without specific prior written permission.\n        \n        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
    "summary": "SpatialData IO for common techs",
    "version": "0.3.0",
    "project_urls": {
        "Documentation": "https://spatialdata-io.readthedocs.io/",
        "Home-page": "https://github.com/scverse/spatialdata-io",
        "Source": "https://github.com/scverse/spatialdata-io"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e611ffc9812999d8fd5e70c8d3e63fefca502c4249acbb233f4a7e35d84a715a",
                "md5": "2396cf181087ba83e678b548d760e3c5",
                "sha256": "6574aacdafff8af2d3cae85e2318b4efb7a2e1e23fdaf856c907a081e6de28a0"
            },
            "downloads": -1,
            "filename": "spatialdata_io-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2396cf181087ba83e678b548d760e3c5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 86388,
            "upload_time": "2025-08-15T21:41:23",
            "upload_time_iso_8601": "2025-08-15T21:41:23.053659Z",
            "url": "https://files.pythonhosted.org/packages/e6/11/ffc9812999d8fd5e70c8d3e63fefca502c4249acbb233f4a7e35d84a715a/spatialdata_io-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4c7d19792b9da1c371d805155f284da576dafe72024dd62ced6d7cc6ce4411c1",
                "md5": "2f77926e23b606958a5e495ff79bcc7f",
                "sha256": "c8ba30e442fffd6e6ce6d11b558f6e7c7845532dc506e9d534561de051277d37"
            },
            "downloads": -1,
            "filename": "spatialdata_io-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "2f77926e23b606958a5e495ff79bcc7f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 81394,
            "upload_time": "2025-08-15T21:41:24",
            "upload_time_iso_8601": "2025-08-15T21:41:24.445824Z",
            "url": "https://files.pythonhosted.org/packages/4c/7d/19792b9da1c371d805155f284da576dafe72024dd62ced6d7cc6ce4411c1/spatialdata_io-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-15 21:41:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "scverse",
    "github_project": "spatialdata-io",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "spatialdata-io"
}
        
Elapsed time: 1.49176s