Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation updates #12

Merged
merged 7 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
20 changes: 20 additions & 0 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great you found testoutput!
# > (6, 61, 78) is now not needed anymore.



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

Expand Down
21 changes: 21 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The directive testcode is from the Sphinx extension doctest, as configured here. It is derived from the code directive and runs the Python code with pytest. Because of this, the doctests fail. It should be ignored if you replace it by just code.


pip install metaspace-converter


.. toctree::
:maxdepth: 2
:caption: Contents:
Expand All @@ -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/
Loading