cellmapper 0.2.1__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cellmapper-0.2.1 → cellmapper-0.2.2}/CHANGELOG.md +11 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/PKG-INFO +19 -19
- {cellmapper-0.2.1 → cellmapper-0.2.2}/README.md +18 -18
- {cellmapper-0.2.1 → cellmapper-0.2.2}/docs/notebooks/tutorials/data_denoising.ipynb +42 -58
- cellmapper-0.2.2/docs/notebooks/tutorials/query_to_reference_mapping.ipynb +1029 -0
- cellmapper-0.2.2/docs/notebooks/tutorials/spatial_mapping.ipynb +978 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/docs/notebooks/tutorials/spatial_smoothing.ipynb +17 -17
- {cellmapper-0.2.1 → cellmapper-0.2.2}/src/cellmapper/_docs.py +8 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/src/cellmapper/model/cellmapper.py +98 -29
- {cellmapper-0.2.1 → cellmapper-0.2.2}/src/cellmapper/model/embedding.py +4 -6
- {cellmapper-0.2.1 → cellmapper-0.2.2}/tests/model/test_query_to_reference_mapping.py +132 -0
- cellmapper-0.2.1/docs/notebooks/tutorials/query_to_reference_mapping.ipynb +0 -1028
- cellmapper-0.2.1/docs/notebooks/tutorials/spatial_mapping.ipynb +0 -956
- {cellmapper-0.2.1 → cellmapper-0.2.2}/.codecov.yaml +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/.cruft.json +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/.editorconfig +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/.github/workflows/build.yaml +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/.github/workflows/release.yaml +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/.github/workflows/test.yaml +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/.gitignore +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/.pre-commit-config.yaml +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/.readthedocs.yaml +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/.vscode/extensions.json +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/.vscode/launch.json +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/.vscode/settings.json +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/LICENSE +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/biome.jsonc +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/docs/_static/.gitkeep +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/docs/_static/css/custom.css +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/docs/_static/images/cellmapper_logo_dark.svg +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/docs/_static/images/cellmapper_logo_light.svg +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/docs/_templates/.gitkeep +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/docs/_templates/autosummary/class.rst +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/docs/api.md +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/docs/changelog.md +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/docs/conf.py +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/docs/contributing.md +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/docs/extensions/typed_returns.py +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/docs/index.md +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/docs/notebooks/tutorials/index.rst +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/docs/references.bib +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/docs/references.md +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/pyproject.toml +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/src/cellmapper/__init__.py +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/src/cellmapper/check.py +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/src/cellmapper/constants.py +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/src/cellmapper/logging.py +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/src/cellmapper/model/_knn_backend.py +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/src/cellmapper/model/evaluate.py +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/src/cellmapper/model/kernel.py +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/src/cellmapper/model/mapping_operator.py +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/src/cellmapper/model/neighbors.py +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/src/cellmapper/utils.py +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/tests/conftest.py +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/tests/data/precomputed_leiden.csv +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/tests/model/test_embedding.py +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/tests/model/test_evaluate.py +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/tests/model/test_kernel.py +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/tests/model/test_mapping_operator.py +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/tests/model/test_neighbors.py +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/tests/model/test_self_mapping.py +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/tests/test_basic.py +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/tests/test_check.py +0 -0
- {cellmapper-0.2.1 → cellmapper-0.2.2}/tests/test_utils.py +0 -0
|
@@ -10,6 +10,17 @@ and this project adheres to [Semantic Versioning][].
|
|
|
10
10
|
|
|
11
11
|
## [Unreleased]
|
|
12
12
|
|
|
13
|
+
## [v0.2.2]
|
|
14
|
+
### Added
|
|
15
|
+
- Enabled subsetting categories before mapping .obs values {pr}`46`
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
- Updated the README a bit {pr}`44`
|
|
19
|
+
- Updated tutorials to work with new parameter names {pr}`43`
|
|
20
|
+
|
|
21
|
+
### Fices
|
|
22
|
+
- Fixed a small bug where hvg masks would not be propagated correctly to joint pca computation {pr}`48`
|
|
23
|
+
|
|
13
24
|
## [v0.2.1]
|
|
14
25
|
### Changed
|
|
15
26
|
- Move some duplicated docstrings into a central _docs.py file {pr}`41`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cellmapper
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: k-NN-based mapping of cells across representations
|
|
5
5
|
Project-URL: Documentation, https://cellmapper.readthedocs.io/
|
|
6
6
|
Project-URL: Homepage, https://github.com/quadbio/cellmapper
|
|
@@ -96,42 +96,42 @@ Description-Content-Type: text/markdown
|
|
|
96
96
|
[badge-downloads]: https://static.pepy.tech/badge/cellmapper
|
|
97
97
|
[badge-zenodo]: https://zenodo.org/badge/973714072.svg
|
|
98
98
|
|
|
99
|
-
k-NN-based mapping of cells across representations to
|
|
99
|
+
k-NN-based mapping of cells across representations to transfer labels, embeddings and expression values. Works for millions of cells, on CPU and GPU, across molecular modalities, between spatial and non-spatial data, for arbitrary query and reference datasets. Using [faiss][] to compute k-NN graphs, CellMapper takes about 30 seconds to transfer cell type labels from 1.5M cells to 1.5M cells on a single RTX 4090 with 60 GB CPU memory.
|
|
100
100
|
|
|
101
|
-
Inspired by scanpy's [ingest][] and the [HNOCA-tools][] packages. Check out the [docs][] to learn more, in particular our [tutorials][].
|
|
101
|
+
Inspired by previous tools, including scanpy's [ingest][] and the [HNOCA-tools][] packages. Check out the 📚 [docs][] to learn more, in particular our [tutorials][].
|
|
102
102
|
|
|
103
|
-
## Key use cases
|
|
103
|
+
## ✨ Key use cases
|
|
104
104
|
|
|
105
|
-
- Transfer cell type labels and expression values from dissociated to spatial datasets.
|
|
106
|
-
- Transfer embeddings between arbitrary query and reference datasets.
|
|
107
|
-
- Compute presence scores for query datasets in large reference atlasses.
|
|
108
|
-
- Identify niches in spatial datasets by contextualizing latent spaces in spatial coordinates.
|
|
109
|
-
- Evaluate the results of transferring labels, embeddings and feature spaces using a variety of metrics.
|
|
105
|
+
- 🧬 Transfer cell type labels and expression values from dissociated to spatial datasets.
|
|
106
|
+
- ↔️ Transfer embeddings between arbitrary query and reference datasets.
|
|
107
|
+
- 📊 Compute presence scores for query datasets in large reference atlasses.
|
|
108
|
+
- 🗺️ Identify niches in spatial datasets by contextualizing latent spaces in spatial coordinates.
|
|
109
|
+
- 📈 Evaluate the results of transferring labels, embeddings and feature spaces using a variety of metrics.
|
|
110
110
|
|
|
111
111
|
The core idea of `CellMapper` is to separate the method (k-NN graph with some kernel applied to get a mapping matrix) from the application (mapping across arbitrary representations), to be flexible and fast. The tool currently supports [pynndescent][], [sklearn][], [faiss][] and [rapids][] for neighborhood search, implements a variety of graph kernels, and is closely integrated with `AnnData` objects.
|
|
112
112
|
|
|
113
|
-
## Installation
|
|
113
|
+
## 📦 Installation
|
|
114
114
|
|
|
115
|
-
You need to have Python 3.10 or newer installed on your system.
|
|
115
|
+
You need to have 🐍 Python 3.10 or newer installed on your system.
|
|
116
116
|
If you don't have Python installed, we recommend installing [uv][].
|
|
117
117
|
|
|
118
118
|
There are two alternative options to install ``cellmapper``:
|
|
119
119
|
|
|
120
|
-
- Install the latest release from [PyPI][]:
|
|
120
|
+
- 🚀 Install the latest release from [PyPI][]:
|
|
121
121
|
|
|
122
122
|
```bash
|
|
123
123
|
pip install cellmapper
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
-
- Install the latest development version:
|
|
126
|
+
- 🛠️ Install the latest development version:
|
|
127
127
|
|
|
128
128
|
```bash
|
|
129
129
|
pip install git+https://github.com/quadbio/cellmapper.git@main
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
-
## Getting started
|
|
132
|
+
## 🏁 Getting started
|
|
133
133
|
|
|
134
|
-
This package assumes that you have ``query`` and ``reference`` AnnData objects, with a joint embedding computed and stored in ``.obsm``.
|
|
134
|
+
This package assumes that you have ``query`` and ``reference`` AnnData objects, with a joint embedding computed and stored in ``.obsm``. While we implement some baseline approaches to compute joint embeddings (PCA and a fast reimplementation of CCA), we typically expect you to provide a pre-computed joint embedding from some task-specific representation learning tools, e.g. [GimVI][] or [ENVI][] for spatial mapping, [GLUE][], [MIDAS][] and [MOFA+][] for modality translation, and [scVI][], [scANVI][] and [scArches][] for query-to-reference mapping - this is just a small selection!
|
|
135
135
|
|
|
136
136
|
With a joint embedding in ``.obsm["X_joint"]`` at hand, the simplest way to use ``CellMapper`` is as follows:
|
|
137
137
|
```Python
|
|
@@ -144,17 +144,17 @@ cmap = CellMapper(query, reference).map(
|
|
|
144
144
|
|
|
145
145
|
This will transfer data from the reference to the query dataset, including celltype labels stored in ``reference.obs``, a UMAP embedding stored in ``reference.obsm``, and expression values stored in ``reference.X``.
|
|
146
146
|
|
|
147
|
-
There are many ways to customize this, e.g. use different ways to compute k-NN graphs and to turn them into mapping matrices, and we implement a few methods to evaluate whether your k-NN transfer was sucessful. The tool also implements a `self-mapping` mode (only a query object, no reference), which is useful for spatial contextualization. Check out the [docs][] to learn more.
|
|
147
|
+
There are many ways to customize this, e.g. use different ways to compute k-NN graphs and to turn them into mapping matrices, and we implement a few methods to evaluate whether your k-NN transfer was sucessful. The tool also implements a `self-mapping` mode (only a query object, no reference), which is useful for spatial contextualization and data denoising. Check out the 📚 [docs][] to learn more.
|
|
148
148
|
|
|
149
|
-
## Release notes
|
|
149
|
+
## 📝 Release notes
|
|
150
150
|
|
|
151
151
|
See the [changelog][].
|
|
152
152
|
|
|
153
|
-
## Contact
|
|
153
|
+
## 📬 Contact
|
|
154
154
|
|
|
155
155
|
If you found a bug, please use the [issue tracker][].
|
|
156
156
|
|
|
157
|
-
## Citation
|
|
157
|
+
## 📖 Citation
|
|
158
158
|
Please use our [zenodo][] entry to cite this software.
|
|
159
159
|
|
|
160
160
|
[uv]: https://github.com/astral-sh/uv
|
|
@@ -16,42 +16,42 @@
|
|
|
16
16
|
[badge-downloads]: https://static.pepy.tech/badge/cellmapper
|
|
17
17
|
[badge-zenodo]: https://zenodo.org/badge/973714072.svg
|
|
18
18
|
|
|
19
|
-
k-NN-based mapping of cells across representations to
|
|
19
|
+
k-NN-based mapping of cells across representations to transfer labels, embeddings and expression values. Works for millions of cells, on CPU and GPU, across molecular modalities, between spatial and non-spatial data, for arbitrary query and reference datasets. Using [faiss][] to compute k-NN graphs, CellMapper takes about 30 seconds to transfer cell type labels from 1.5M cells to 1.5M cells on a single RTX 4090 with 60 GB CPU memory.
|
|
20
20
|
|
|
21
|
-
Inspired by scanpy's [ingest][] and the [HNOCA-tools][] packages. Check out the [docs][] to learn more, in particular our [tutorials][].
|
|
21
|
+
Inspired by previous tools, including scanpy's [ingest][] and the [HNOCA-tools][] packages. Check out the 📚 [docs][] to learn more, in particular our [tutorials][].
|
|
22
22
|
|
|
23
|
-
## Key use cases
|
|
23
|
+
## ✨ Key use cases
|
|
24
24
|
|
|
25
|
-
- Transfer cell type labels and expression values from dissociated to spatial datasets.
|
|
26
|
-
- Transfer embeddings between arbitrary query and reference datasets.
|
|
27
|
-
- Compute presence scores for query datasets in large reference atlasses.
|
|
28
|
-
- Identify niches in spatial datasets by contextualizing latent spaces in spatial coordinates.
|
|
29
|
-
- Evaluate the results of transferring labels, embeddings and feature spaces using a variety of metrics.
|
|
25
|
+
- 🧬 Transfer cell type labels and expression values from dissociated to spatial datasets.
|
|
26
|
+
- ↔️ Transfer embeddings between arbitrary query and reference datasets.
|
|
27
|
+
- 📊 Compute presence scores for query datasets in large reference atlasses.
|
|
28
|
+
- 🗺️ Identify niches in spatial datasets by contextualizing latent spaces in spatial coordinates.
|
|
29
|
+
- 📈 Evaluate the results of transferring labels, embeddings and feature spaces using a variety of metrics.
|
|
30
30
|
|
|
31
31
|
The core idea of `CellMapper` is to separate the method (k-NN graph with some kernel applied to get a mapping matrix) from the application (mapping across arbitrary representations), to be flexible and fast. The tool currently supports [pynndescent][], [sklearn][], [faiss][] and [rapids][] for neighborhood search, implements a variety of graph kernels, and is closely integrated with `AnnData` objects.
|
|
32
32
|
|
|
33
|
-
## Installation
|
|
33
|
+
## 📦 Installation
|
|
34
34
|
|
|
35
|
-
You need to have Python 3.10 or newer installed on your system.
|
|
35
|
+
You need to have 🐍 Python 3.10 or newer installed on your system.
|
|
36
36
|
If you don't have Python installed, we recommend installing [uv][].
|
|
37
37
|
|
|
38
38
|
There are two alternative options to install ``cellmapper``:
|
|
39
39
|
|
|
40
|
-
- Install the latest release from [PyPI][]:
|
|
40
|
+
- 🚀 Install the latest release from [PyPI][]:
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
43
|
pip install cellmapper
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
- Install the latest development version:
|
|
46
|
+
- 🛠️ Install the latest development version:
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
49
|
pip install git+https://github.com/quadbio/cellmapper.git@main
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
## Getting started
|
|
52
|
+
## 🏁 Getting started
|
|
53
53
|
|
|
54
|
-
This package assumes that you have ``query`` and ``reference`` AnnData objects, with a joint embedding computed and stored in ``.obsm``.
|
|
54
|
+
This package assumes that you have ``query`` and ``reference`` AnnData objects, with a joint embedding computed and stored in ``.obsm``. While we implement some baseline approaches to compute joint embeddings (PCA and a fast reimplementation of CCA), we typically expect you to provide a pre-computed joint embedding from some task-specific representation learning tools, e.g. [GimVI][] or [ENVI][] for spatial mapping, [GLUE][], [MIDAS][] and [MOFA+][] for modality translation, and [scVI][], [scANVI][] and [scArches][] for query-to-reference mapping - this is just a small selection!
|
|
55
55
|
|
|
56
56
|
With a joint embedding in ``.obsm["X_joint"]`` at hand, the simplest way to use ``CellMapper`` is as follows:
|
|
57
57
|
```Python
|
|
@@ -64,17 +64,17 @@ cmap = CellMapper(query, reference).map(
|
|
|
64
64
|
|
|
65
65
|
This will transfer data from the reference to the query dataset, including celltype labels stored in ``reference.obs``, a UMAP embedding stored in ``reference.obsm``, and expression values stored in ``reference.X``.
|
|
66
66
|
|
|
67
|
-
There are many ways to customize this, e.g. use different ways to compute k-NN graphs and to turn them into mapping matrices, and we implement a few methods to evaluate whether your k-NN transfer was sucessful. The tool also implements a `self-mapping` mode (only a query object, no reference), which is useful for spatial contextualization. Check out the [docs][] to learn more.
|
|
67
|
+
There are many ways to customize this, e.g. use different ways to compute k-NN graphs and to turn them into mapping matrices, and we implement a few methods to evaluate whether your k-NN transfer was sucessful. The tool also implements a `self-mapping` mode (only a query object, no reference), which is useful for spatial contextualization and data denoising. Check out the 📚 [docs][] to learn more.
|
|
68
68
|
|
|
69
|
-
## Release notes
|
|
69
|
+
## 📝 Release notes
|
|
70
70
|
|
|
71
71
|
See the [changelog][].
|
|
72
72
|
|
|
73
|
-
## Contact
|
|
73
|
+
## 📬 Contact
|
|
74
74
|
|
|
75
75
|
If you found a bug, please use the [issue tracker][].
|
|
76
76
|
|
|
77
|
-
## Citation
|
|
77
|
+
## 📖 Citation
|
|
78
78
|
Please use our [zenodo][] entry to cite this software.
|
|
79
79
|
|
|
80
80
|
[uv]: https://github.com/astral-sh/uv
|