Skip to content

Commit

Permalink
Merge pull request #12 from metaspace2020/documentation-updates
Browse files Browse the repository at this point in the history
Documentation updates
  • Loading branch information
tdrose authored Nov 29, 2023
2 parents 9c8e1bb + 114d68b commit 91b77dc
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 3 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---------------------------------------------------
Expand Down
22 changes: 22 additions & 0 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,28 @@ 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)

.. testoutput::

(20, 130, 143)

SpatialData
-----------

Expand Down
22 changes: 22 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,24 @@
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:


.. code-block::
pip install metaspace-converter
.. toctree::
:maxdepth: 2
:caption: Contents:
Expand All @@ -22,3 +36,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/

0 comments on commit 91b77dc

Please sign in to comment.