From ad265c4593824e92db469f7f6c7f465839c8f1e0 Mon Sep 17 00:00:00 2001 From: Tim Daniel Rose <34072286+tdrose@users.noreply.github.com> Date: Thu, 30 Nov 2023 10:58:18 +0100 Subject: [PATCH 1/7] Update index.rst Using content from README.md file to improve docs index page. --- docs/index.rst | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 599efc3..094a033 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -10,9 +10,26 @@ Welcome to METASPACE Converter's documentation! |Docs badge| |PyPI badge| -Functions to convert `METASPACE`_ datasets to `AnnData`_ objects. +Python package to download and convert datasets from the `METASPACE`_ +knowledge base to common formats for single-cell and spatial omics analysis. +Datasets can be directly downloaded to +`AnnData`_ and `SpatialData`_ objects. + +`AnnData`_ is the underlying data format +of many packages of the `scverse`_ such as +`ScanPy`_ for single-cell data analysis and +`SquidPy`_ for spatial omics analysis. + +Another supported format that is part of the `scverse`_ +is `SpatialData`_ for storing, aligning, and processing spatial omics data. +This enables users to easily align and integrate METASPACE datasets to other spatial omics modalities. + +The METASPACE-converter package uses the `METASPACE python client`_ +download datasets from METASPACE. +If you also need to upload or modify datasets on METASPACE, please check the `Python client documentation`_. + +If you encounter bugs or have suggestions for new features, please open an issue on `GitHub`_. -This makes it easy to work with the `ScanPy`_, `SquidPy`_ and `SpatialData`_ ecosystem with METASPACE data. Installation ------------ @@ -31,12 +48,23 @@ You can install the package via pip: api examples +License +------- + +Unless specified otherwise source code in file headers or LICENSE files present in subdirectories, all files of this package are licensed under the `Apache 2.0 license`_. + + + .. _METASPACE: https://metaspace2020.eu/ .. _AnnData: https://anndata.readthedocs.io/en/stable/ .. _ScanPy: https://scanpy.readthedocs.io/en/stable/ .. _SquidPy: https://squidpy.readthedocs.io/en/stable/ .. _SpatialData: https://spatialdata.scverse.org/en/latest/ - +.. _scverse: https://doi.org/10.1038/s41587-023-01733-8 +.. _GitHub: https://github.com/metaspace2020/metaspace-converter +.. _METASPACE python client: https://github.com/metaspace2020/metaspace/tree/master/metaspace/python-client +.. _Python client documentation: https://metaspace2020.readthedocs.io/en/latest/index.html +.. _Apache 2.0 license: https://github.com/metaspace2020/metaspace/blob/master/LICENSE .. |Tests badge| image:: https://img.shields.io/github/actions/workflow/status/metaspace2020/metaspace-converter/tests.yml?branch=master&label=tests :target: https://github.com/metaspace2020/metaspace-converter/actions/workflows/tests.yml From a2d27ec872cb90a5cefe6437f84ea37fc8043ad6 Mon Sep 17 00:00:00 2001 From: Tim Daniel Rose <34072286+tdrose@users.noreply.github.com> Date: Thu, 30 Nov 2023 10:59:32 +0100 Subject: [PATCH 2/7] Fixed typo in README. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index df17de6..4c38168 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Datasets can be directly downloaded to [AnnData](https://anndata.readthedocs.io/en/stable/index.html) and [SpatialData](https://spatialdata.scverse.org/en/latest/) objects. -[AnnData](https://anndata.readthedocs.io/en/stable/index.html) provides is underlying data format +[AnnData](https://anndata.readthedocs.io/en/stable/index.html) is the underlying data format of many packages of the [scverse](https://doi.org/10.1038/s41587-023-01733-8) such as [scanpy](https://scanpy.readthedocs.io/en/stable/) for single-cell data analysis and [squidpy](https://squidpy.readthedocs.io/en/stable/index.html) for spatial omics analysis. From 73afe89e9d97340e792149a071d8f6726731c133 Mon Sep 17 00:00:00 2001 From: Tim Daniel Rose <34072286+tdrose@users.noreply.github.com> Date: Thu, 30 Nov 2023 11:34:23 +0100 Subject: [PATCH 3/7] Fixed more Typos and removed Import section. --- README.md | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 4c38168..7a9e157 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,8 @@ of many packages of the [scverse](https://doi.org/10.1038/s41587-023-01733-8) su [squidpy](https://squidpy.readthedocs.io/en/stable/index.html) for spatial omics analysis. Another supported format that is part of the [scverse](https://doi.org/10.1038/s41587-023-01733-8) -is [SpatialData](https://spatialdata.scverse.org/en/latest/) for storage, alignment, and processing -of spatial omics data. This enables users to easily align and integrate METASPACE datasets +is [SpatialData](https://spatialdata.scverse.org/en/latest/) for storing, aligning, and processing spatial omics data. +This enables users to easily align and integrate METASPACE datasets to other spatial omics modalities. If you encounter any bugs or have suggestions for new features, please open an issue in the @@ -32,20 +32,14 @@ You can install the package directly from [PyPI](https://pypi.org/project/metasp pip install metaspace-converter ``` -### Import package - -```python -import metaspace_converter -``` - ## Short tutorial The full documentation for the package can be found here: [https://metaspace2020.github.io/metaspace-converter/](https://metaspace2020.github.io/metaspace-converter/) -The METASPACE-converter package is using the +The METASPACE-converter package uses the [python client](https://github.com/metaspace2020/metaspace/tree/master/metaspace/python-client) -download datasets from METASPACE. -It serves as a wrapper that downloads converts datasets directly to +to download datasets from METASPACE. +It serves as a wrapper that downloads and converts datasets directly to [AnnData](https://anndata.readthedocs.io/en/stable/index.html) and [SpatialData](https://spatialdata.scverse.org/en/latest/) objects. @@ -85,8 +79,8 @@ sc.pl.spatial( #### Squidpy -Optical images can also be downloaded and save in the object if available. -Squidpy allows for an easy overlay of ion image and optical image. +Optical images can also be downloaded, if available, and saved in the object if available. +Squidpy allows for an easy overlay of ion images and the optical image. ```python from metaspace_converter import metaspace_to_anndata @@ -130,7 +124,7 @@ print(ion_images.shape) Download to the [SpatialData](https://spatialdata.scverse.org/en/latest/) format equally easy and can be done with the `metaspace_to_spatialdata` function. -Here using a reversed colormap which better represents intense values on bright background. +Here using a reversed colormap which better represents intense values on a bright background. ```python from metaspace_converter import metaspace_to_spatialdata From f24138e7df84a5506cc3ba6a2a6c3cbd542fe000 Mon Sep 17 00:00:00 2001 From: Tim Daniel Rose <34072286+tdrose@users.noreply.github.com> Date: Thu, 30 Nov 2023 11:36:15 +0100 Subject: [PATCH 4/7] Update index.rst --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 094a033..3282026 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -25,7 +25,7 @@ is `SpatialData`_ for storing, aligning, and processing spatial omics data. This enables users to easily align and integrate METASPACE datasets to other spatial omics modalities. The METASPACE-converter package uses the `METASPACE python client`_ -download datasets from METASPACE. +to download datasets from METASPACE. If you also need to upload or modify datasets on METASPACE, please check the `Python client documentation`_. If you encounter bugs or have suggestions for new features, please open an issue on `GitHub`_. From 83b6ee314c3d1d429889b46e60f7c840f85c8a32 Mon Sep 17 00:00:00 2001 From: Tim Daniel Rose <34072286+tdrose@users.noreply.github.com> Date: Thu, 30 Nov 2023 17:31:52 +0100 Subject: [PATCH 5/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a9e157..04e4627 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ sc.pl.spatial( #### Squidpy -Optical images can also be downloaded, if available, and saved in the object if available. +Optical images can also be downloaded, if available, and saved in the AnnData object. Squidpy allows for an easy overlay of ion images and the optical image. ```python From 7e6ff7b8d68ddb855acb9f97ff2abaa7ff791968 Mon Sep 17 00:00:00 2001 From: Tim Daniel Rose <34072286+tdrose@users.noreply.github.com> Date: Thu, 30 Nov 2023 17:47:31 +0100 Subject: [PATCH 6/7] Fixed example output Just realized that I used the wrong array dimensions in the output. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 04e4627..6054664 100644 --- a/README.md +++ b/README.md @@ -114,9 +114,9 @@ adata2 = metaspace_to_anndata(dataset_id="2023-11-14_21h58m39s", fdr=0.1) ion_images = anndata_to_image_array(adata2) -# 6 ion images of shape 61x78 +# 20 ion images of shape 130x143 print(ion_images.shape) -# > (6, 61, 78) +# > (20, 130, 143) ``` ### SpatialData From c2b78cb5f25b3e210849c3637522dd23480f6bc5 Mon Sep 17 00:00:00 2001 From: Tim Daniel Rose <34072286+tdrose@users.noreply.github.com> Date: Thu, 30 Nov 2023 17:48:49 +0100 Subject: [PATCH 7/7] Fixed array dimensions in comment. --- docs/examples.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples.rst b/docs/examples.rst index 4437811..2a4dfae 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -66,7 +66,7 @@ convert previously downloaded AnnData objects to numpy arrays. ion_images = anndata_to_image_array(adata2) - # 6 ion images of shape 61x78 + # 20 ion images of shape 130x143 print(ion_images.shape) .. testoutput::