Skip to content

Commit

Permalink
Merge pull request #13 from metaspace2020/documentation-updates
Browse files Browse the repository at this point in the history
Documentation updates
  • Loading branch information
tdrose authored Dec 1, 2023
2 parents 91b77dc + c2b78cb commit 320bc1e
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 21 deletions.
28 changes: 11 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ 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.

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
Expand All @@ -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.

Expand Down Expand Up @@ -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 AnnData object.
Squidpy allows for an easy overlay of ion images and the optical image.

```python
from metaspace_converter import metaspace_to_anndata
Expand Down Expand Up @@ -120,17 +114,17 @@ 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

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
Expand Down
2 changes: 1 addition & 1 deletion docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down
34 changes: 31 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`_
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`_.

This makes it easy to work with the `ScanPy`_, `SquidPy`_ and `SpatialData`_ ecosystem with METASPACE data.

Installation
------------
Expand All @@ -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
Expand Down

0 comments on commit 320bc1e

Please sign in to comment.