From 765392ddce1aeeee8c40991f9d2c26fe726d9da7 Mon Sep 17 00:00:00 2001 From: Tim Daniel Rose <34072286+tdrose@users.noreply.github.com> Date: Wed, 29 Nov 2023 16:50:58 +0100 Subject: [PATCH 1/7] Update README.md --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index dbded8a..df17de6 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,9 @@ If you encounter any bugs or have suggestions for new features, please open an i Our package requires `python >= 3.9`. +You can install the package directly from [PyPI](https://pypi.org/project/metaspace-converter/): ```bash -pip install -U git+https://github.com/metaspace2020/metaspace-converter@master +pip install metaspace-converter ``` ### Import package @@ -39,6 +40,8 @@ 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 [python client](https://github.com/metaspace2020/metaspace/tree/master/metaspace/python-client) download datasets from METASPACE. @@ -160,6 +163,11 @@ sdata.points["maldi_points"] = sdata.transform_element_to_coordinate_system( ![Image](docs/_static/img/example_img_sd.png) +## License + +Unless specified otherwise in file headers or LICENSE files present in subdirectories, all files are licensed under the [Apache 2.0 license](https://github.com/metaspace2020/metaspace/blob/master/LICENSE). + + [badge-docs]: https://img.shields.io/github/actions/workflow/status/metaspace2020/metaspace-converter/docs.yml?label=documentation [badge-pypi]: https://img.shields.io/pypi/v/metaspace-converter [badge-tests]: https://img.shields.io/github/actions/workflow/status/metaspace2020/metaspace-converter/tests.yml?branch=master&label=tests From bb1fb9c584b1bf9a19cebf0e416137339dd124e8 Mon Sep 17 00:00:00 2001 From: Tim Daniel Rose <34072286+tdrose@users.noreply.github.com> Date: Wed, 29 Nov 2023 16:55:39 +0100 Subject: [PATCH 2/7] Added anndata_to_image_array to examples.rst --- docs/examples.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/examples.rst b/docs/examples.rst index c6b06af..6a8347c 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -51,6 +51,26 @@ SquidPy .. image:: ./_static/img/example_img_sq.png :alt: Visualization with SquidPy +Convert AnnData objects to ion image arrays +------------------------------------------- + +If you want to work with the ion images as numpy arrays, the function `anndata_to_image_array` can +convert previously downloaded AnnData objects to numpy arrays. + +.. testcode:: + + from metaspace_converter import metaspace_to_anndata, anndata_to_image_array + + # Download data + 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 + print(ion_images.shape) + # > (6, 61, 78) + + SpatialData ----------- From 75452e4aa95502844ee15e355cc38cd63f342da8 Mon Sep 17 00:00:00 2001 From: Tim Daniel Rose <34072286+tdrose@users.noreply.github.com> Date: Wed, 29 Nov 2023 17:06:31 +0100 Subject: [PATCH 3/7] Added badges and installation instructions to docs index. --- docs/index.rst | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/index.rst b/docs/index.rst index cce353e..9449f5d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -6,10 +6,23 @@ Welcome to METASPACE Converter's documentation! =============================================== +|Tests badge| +|Docs badge| +|PyPI badge| + Functions to convert `METASPACE`_ datasets to `AnnData`_ objects. This makes it easy to work with the `ScanPy`_, `SquidPy`_ and `SpatialData`_ ecosystem with METASPACE data. +Installation +------------ +You can install the package via pip: + +.. testcode:: + + pip install metaspace-converter + + .. toctree:: :maxdepth: 2 :caption: Contents: @@ -22,3 +35,11 @@ This makes it easy to work with the `ScanPy`_, `SquidPy`_ and `SpatialData`_ eco .. _ScanPy: https://scanpy.readthedocs.io/en/stable/ .. _SquidPy: https://squidpy.readthedocs.io/en/stable/ .. _SpatialData: https://spatialdata.scverse.org/en/latest/ + + +.. |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 +.. |Docs badge| image:: https://img.shields.io/github/actions/workflow/status/metaspace2020/metaspace-converter/docs.yml?label=documentation + :target: https://metaspace2020.github.io/metaspace-converter/ +.. |PyPI badge| image:: https://img.shields.io/pypi/v/metaspace-converter + :target: https://pypi.org/project/metaspace-converter/ From b555f4eddd26787b58af4919df643cdaffc756fe Mon Sep 17 00:00:00 2001 From: Tim Daniel Rose <34072286+tdrose@users.noreply.github.com> Date: Wed, 29 Nov 2023 17:08:36 +0100 Subject: [PATCH 4/7] Updated authors --- docs/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index ed364dd..ff16b8f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,8 +18,8 @@ # -- Project information ----------------------------------------------------- project = "METASPACE Converter" -copyright = "2023, Tim Daniel Rose" -author = "Tim Daniel Rose" +copyright = "2023; Tim Daniel Rose, Andreas Eisenbarth, Theodore Alexandrov" +author = "Tim Daniel Rose, Andreas Eisenbarth" # -- General configuration --------------------------------------------------- From b1cc83e832a2b60d44a7eb7bc7680bd9d039a9c3 Mon Sep 17 00:00:00 2001 From: Tim Daniel Rose <34072286+tdrose@users.noreply.github.com> Date: Wed, 29 Nov 2023 17:24:24 +0100 Subject: [PATCH 5/7] Testcode fix. --- docs/examples.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/examples.rst b/docs/examples.rst index 6a8347c..f8423b4 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -70,6 +70,8 @@ convert previously downloaded AnnData objects to numpy arrays. print(ion_images.shape) # > (6, 61, 78) +.. testoutput:: + (20, 130, 143) SpatialData ----------- From 853181118dfcea5e054d7ccda8fb9755c2478c20 Mon Sep 17 00:00:00 2001 From: Tim Daniel Rose <34072286+tdrose@users.noreply.github.com> Date: Wed, 29 Nov 2023 17:32:38 +0100 Subject: [PATCH 6/7] Update index.rst --- docs/index.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 9449f5d..599efc3 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -18,7 +18,8 @@ Installation ------------ You can install the package via pip: -.. testcode:: + +.. code-block:: pip install metaspace-converter From 114d68bf2b411f68b7569a9f1b77dc9ed31ecd17 Mon Sep 17 00:00:00 2001 From: Tim Daniel Rose <34072286+tdrose@users.noreply.github.com> Date: Wed, 29 Nov 2023 17:33:15 +0100 Subject: [PATCH 7/7] Update examples.rst --- docs/examples.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples.rst b/docs/examples.rst index f8423b4..4437811 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -68,9 +68,9 @@ convert previously downloaded AnnData objects to numpy arrays. # 6 ion images of shape 61x78 print(ion_images.shape) - # > (6, 61, 78) .. testoutput:: + (20, 130, 143) SpatialData