Skip to content

Commit e07bc39

Browse files
authored
Docs and bugfix (#1)
* docs * anndata as dependency * generalize multiplex leiden * readthedocs config * add shashwat * omics instead of transcriptomics * fix leidenalg to 0.10
1 parent 87ae1b0 commit e07bc39

12 files changed

+456
-48
lines changed

.readthedocs.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
build:
3+
os: ubuntu-22.04
4+
tools:
5+
python: "3.10"
6+
sphinx:
7+
configuration: docs/source/conf.py
8+
python:
9+
install:
10+
- method: pip
11+
path: .
12+
extra_requirements:
13+
- docs

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Niklas Müller-Bötticher, Naveed Ishaque, Roland Eils, Berlin Institute of Health @ Charité
3+
Copyright (c) 2024 Niklas Müller-Bötticher, Shashwat Sahay, Naveed Ishaque, Roland Eils, Berlin Institute of Health @ Charité
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+34
Original file line numberDiff line numberDiff line change
@@ -1 +1,35 @@
11
# SpatialLeiden
2+
3+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4+
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
5+
[![Code style: Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
6+
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
7+
[![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
8+
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
9+
10+
``SpatialLeiden`` is an implementation of
11+
[Multiplex Leiden clustering](https://leidenalg.readthedocs.io/en/stable/multiplex.html)
12+
that can be used to cluster spatially resolved omics data.
13+
14+
``SpatialLeiden`` integrates with the [scverse](https://scverse.org/) by leveraging
15+
[scanpy](https://scanpy.readthedocs.io/) and [anndata](https://anndata.readthedocs.io/)
16+
but can also be used independently.
17+
18+
## Installation
19+
20+
`spatialleiden` will be made available on [PyPI](https://pypi.org/) and
21+
[bioconda](https://bioconda.github.io/). For detailed installation instructions
22+
please refer to the [documentation](https://spatialleiden.readthedocs.io/en/stable/installation.html).
23+
24+
## Documentation
25+
26+
For documentation of the package please refer to the [ReadTheDocs page](https://spatialleiden.readthedocs.io/)
27+
28+
## Versioning
29+
30+
This project follows the [SemVer](https://semver.org/) guidelines for versioning.
31+
32+
## License
33+
34+
This project is licensed under the MIT License - for details please refer to the
35+
[LICENSE](./LICENSE) file.

docs/source/api.rst

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
API
2+
===
3+
4+
.. currentmodule:: spatialleiden
5+
6+
Multiplex Leiden
7+
----------------
8+
9+
.. autosummary::
10+
:nosignatures:
11+
:toctree: ./generated/
12+
13+
spatialleiden
14+
multiplex_leiden
15+
16+
17+
Resolution search
18+
-----------------
19+
20+
.. autosummary::
21+
:nosignatures:
22+
:toctree: ./generated/
23+
24+
search_resolution
25+
search_resolution_latent
26+
search_resolution_spatial
27+
28+
29+
Utility functions
30+
-----------------
31+
32+
.. autosummary::
33+
:nosignatures:
34+
:toctree: ./generated/
35+
36+
distance2connectivity

docs/source/conf.py

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import importlib.metadata
2+
import os
3+
import sys
4+
from datetime import datetime
5+
6+
sys.path.insert(0, os.path.abspath("../.."))
7+
8+
# -- Project information -----------------------------------------------------
9+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
10+
11+
project = "SpatialLeiden"
12+
copyright = f"""
13+
{datetime.now():%Y}, Niklas Müller-Bötticher, Shashwat Sahay, Naveed Ishaque, Roland Eils,
14+
Berlin Institute of Health @ Charité"""
15+
author = "Niklas Müller-Bötticher & Shashwat Sahay"
16+
version = importlib.metadata.version("spatialleiden")
17+
release = version
18+
19+
# -- General configuration ---------------------------------------------------
20+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
21+
22+
23+
extensions = [
24+
"sphinx_copybutton",
25+
"sphinx.ext.autodoc",
26+
"sphinx.ext.intersphinx",
27+
"sphinx.ext.napoleon",
28+
"sphinx.ext.autosummary",
29+
"sphinx.ext.mathjax",
30+
]
31+
32+
33+
autodoc_typehints = "none"
34+
autodoc_typehints_format = "short"
35+
36+
python_use_unqualified_type_names = True # still experimental
37+
38+
autosummary_generate = True
39+
autosummary_imported_members = True
40+
41+
nitpicky = True
42+
nitpick_ignore = [("py:class", "optional")]
43+
44+
45+
exclude_patterns: list[str] = []
46+
47+
intersphinx_mapping = dict(
48+
anndata=("https://anndata.readthedocs.io/en/stable/", None),
49+
matplotlib=("https://matplotlib.org/stable/", None),
50+
numpy=("https://numpy.org/doc/stable/", None),
51+
python=("https://docs.python.org/3", None),
52+
scanpy=("https://scanpy.readthedocs.io/en/stable/", None),
53+
scipy=("https://docs.scipy.org/doc/scipy/", None),
54+
)
55+
56+
# -- Options for HTML output -------------------------------------------------
57+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
58+
59+
html_theme = "sphinx_rtd_theme"
60+
html_static_path: list[str] = []

docs/source/index.rst

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
What is ``SpatialLeiden``?
2+
==========================
3+
4+
SpatialLeiden is an implementation of
5+
`Multiplex Leiden clustering <https://leidenalg.readthedocs.io/en/stable/multiplex.html>`_
6+
that can be used to cluster spatially resolved omics data.
7+
8+
SpatialLeiden integrates with the `scverse <https://scverse.org/>`_ by leveraging
9+
`scanpy <https://scanpy.readthedocs.io/>`_ and `anndata <https://anndata.readthedocs.io/>`_
10+
but can also be used independently.
11+
12+
13+
.. toctree::
14+
:maxdepth: 1
15+
:caption: Contents:
16+
17+
self
18+
installation
19+
api
20+
21+
22+
Indices and tables
23+
==================
24+
25+
- :ref:`genindex`
26+
- :ref:`search`

docs/source/installation.rst

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
Installation
2+
============
3+
4+
5+
PyPi and ``pip``
6+
----------------
7+
8+
To install ``spatialleiden`` from `PyPI <https://pypi.org/>`_ using ``pip`` just run
9+
10+
.. code-block:: bash
11+
12+
pip install spatialleiden
13+
14+
15+
bioconda and ``conda``
16+
----------------------
17+
18+
``spatialleiden`` is not yet available for
19+
`Miniconda <https://docs.conda.io/en/latest/miniconda.html>`_ installations. But we are
20+
planning to add it to `bioconda <https://bioconda.github.io/>`_ soon.
21+
22+
23+
.. .. code-block:: bash
24+
25+
.. conda install -c conda-forge spatialleiden
26+
27+
.. .. note::
28+
29+
.. Of course, it is also possible to use ``mamba`` instead of ``conda``
30+
.. to speed up the installation.
31+
32+
33+
From GitHub
34+
-----------
35+
36+
You can install the latest versions directly from
37+
`GitHub <https://github.com/HiDiHlabs/SpatialLeiden>`_. To do so clone the repository
38+
using the ``git clone`` command. Navigate into the downloaded directory and install
39+
using
40+
41+
.. code-block:: bash
42+
43+
pip install -e .
44+
45+
If you want to install the development version you can install the additional optional
46+
dependencies with
47+
48+
.. code-block:: bash
49+
50+
pip install -e '.[dev]'

pyproject.toml

+10-2
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,24 @@ build-backend = "setuptools.build_meta"
55

66
[project]
77
name = "spatialleiden"
8-
description = "Implementation of multiplex Leiden for analysis of spatial tnanscriptomics data."
8+
description = "Implementation of multiplex Leiden for analysis of spatial omics data."
99
readme = { file = "README.md", content-type = "text/markdown" }
1010
license = { file = "LICENSE" }
1111
requires-python = ">=3.10"
1212
dynamic = ["version"]
1313

1414
authors = [
1515
{ name = "Niklas Müller-Bötticher", email = "[email protected]" },
16+
{ name = "Shashwat Sahay", email = "[email protected]" },
17+
]
18+
dependencies = [
19+
"anndata",
20+
"igraph",
21+
"leidenalg~=0.10.2",
22+
"numpy>=1.21",
23+
"scanpy",
24+
"scipy>=1.9",
1625
]
17-
dependencies = ["igraph", "leidenalg>=0.10", "numpy>=1.21", "scanpy", "scipy>=1.9"]
1826
classifiers = [
1927
"Intended Audience :: Science/Research",
2028
"License :: OSI Approved :: MIT License",

spatialleiden/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from importlib.metadata import PackageNotFoundError, version
22

3-
from ._multiplex_leiden import leiden_multiplex, spatialleiden
3+
from ._multiplex_leiden import multiplex_leiden, spatialleiden
44
from ._resolution_search import (
55
search_resolution,
66
search_resolution_latent,
@@ -17,7 +17,7 @@
1717

1818

1919
__all__ = [
20-
"leiden_multiplex",
20+
"multiplex_leiden",
2121
"spatialleiden",
2222
"search_resolution",
2323
"search_resolution_latent",

0 commit comments

Comments
 (0)