moscot 0.4.1__tar.gz → 0.4.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.
- {moscot-0.4.1 → moscot-0.4.2}/.pre-commit-config.yaml +4 -4
- {moscot-0.4.1 → moscot-0.4.2}/PKG-INFO +3 -2
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/base/solver.py +1 -1
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/plotting/_utils.py +1 -1
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/problems/space/_mixins.py +18 -5
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/utils/subset_policy.py +1 -1
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot.egg-info/PKG-INFO +3 -2
- {moscot-0.4.1 → moscot-0.4.2}/.gitignore +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/.gitmodules +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/.readthedocs.yml +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/.run_notebooks.sh +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/LICENSE +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/MANIFEST.in +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/README.rst +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/codecov.yml +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/pyproject.toml +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/setup.cfg +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/__init__.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/_constants.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/_logging.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/_registry.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/_types.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/backends/__init__.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/backends/ott/__init__.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/backends/ott/_utils.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/backends/ott/output.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/backends/ott/solver.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/backends/utils.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/base/__init__.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/base/cost.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/base/output.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/base/problems/__init__.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/base/problems/_mixins.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/base/problems/_utils.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/base/problems/birth_death.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/base/problems/compound_problem.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/base/problems/manager.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/base/problems/problem.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/costs/__init__.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/costs/_costs.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/costs/_utils.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/datasets.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/neural/base/__init__.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/neural/base/problems/__init__.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/neural/base/problems/problem.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/neural/problems/__init__.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/neural/problems/generic/__init__.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/neural/problems/generic/_generic.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/plotting/__init__.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/plotting/_plotting.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/problems/__init__.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/problems/_utils.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/problems/cross_modality/__init__.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/problems/cross_modality/_mixins.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/problems/cross_modality/_translation.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/problems/generic/__init__.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/problems/generic/_generic.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/problems/generic/_mixins.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/problems/space/__init__.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/problems/space/_alignment.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/problems/space/_mapping.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/problems/spatiotemporal/__init__.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/problems/spatiotemporal/_spatio_temporal.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/problems/time/__init__.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/problems/time/_lineage.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/problems/time/_mixins.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/py.typed +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/utils/__init__.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/utils/_data/allTFs_dmel.txt +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/utils/_data/allTFs_hg38.txt +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/utils/_data/allTFs_mm.txt +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/utils/_data/human_apoptosis.txt +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/utils/_data/human_proliferation.txt +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/utils/_data/mouse_apoptosis.txt +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/utils/_data/mouse_proliferation.txt +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/utils/data.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot/utils/tagged_array.py +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot.egg-info/SOURCES.txt +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot.egg-info/dependency_links.txt +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot.egg-info/requires.txt +0 -0
- {moscot-0.4.1 → moscot-0.4.2}/src/moscot.egg-info/top_level.txt +0 -0
|
@@ -7,13 +7,13 @@ default_stages:
|
|
|
7
7
|
minimum_pre_commit_version: 3.0.0
|
|
8
8
|
repos:
|
|
9
9
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
10
|
-
rev: v1.
|
|
10
|
+
rev: v1.15.0
|
|
11
11
|
hooks:
|
|
12
12
|
- id: mypy
|
|
13
13
|
additional_dependencies: [numpy>=1.25.0]
|
|
14
14
|
files: ^src
|
|
15
15
|
- repo: https://github.com/psf/black
|
|
16
|
-
rev:
|
|
16
|
+
rev: 25.1.0
|
|
17
17
|
hooks:
|
|
18
18
|
- id: black
|
|
19
19
|
additional_dependencies: [toml]
|
|
@@ -23,7 +23,7 @@ repos:
|
|
|
23
23
|
- id: prettier
|
|
24
24
|
language_version: system
|
|
25
25
|
- repo: https://github.com/PyCQA/isort
|
|
26
|
-
rev:
|
|
26
|
+
rev: 6.0.1
|
|
27
27
|
hooks:
|
|
28
28
|
- id: isort
|
|
29
29
|
additional_dependencies: [toml]
|
|
@@ -63,7 +63,7 @@ repos:
|
|
|
63
63
|
- id: doc8
|
|
64
64
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
65
65
|
# Ruff version.
|
|
66
|
-
rev: v0.9.
|
|
66
|
+
rev: v0.9.10
|
|
67
67
|
hooks:
|
|
68
68
|
- id: ruff
|
|
69
69
|
args: [--fix, --exit-non-zero-on-fix]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: moscot
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.2
|
|
4
4
|
Summary: Multi-omic single-cell optimal transport tools
|
|
5
5
|
Author: Dominik Klein, Giovanni Palla, Michal Klein, Zoe Piran, Marius Lange
|
|
6
6
|
Maintainer-email: Dominik Klein <dominik.klein@helmholtz-muenchen.de>, Giovanni Palla <giovanni.palla@helmholtz-muenchen.de>, Michal Klein <michal.klein@helmholtz-muenchen.de>
|
|
@@ -98,6 +98,7 @@ Requires-Dist: sphinx-tippy>=0.4.1; extra == "docs"
|
|
|
98
98
|
Requires-Dist: myst-nb>=0.17.1; extra == "docs"
|
|
99
99
|
Requires-Dist: ipython>=7.20.0; extra == "docs"
|
|
100
100
|
Requires-Dist: sphinx_design>=0.3.0; extra == "docs"
|
|
101
|
+
Dynamic: license-file
|
|
101
102
|
|
|
102
103
|
|PyPI| |Downloads| |CI| |Pre-commit| |Codecov| |Docs|
|
|
103
104
|
|
|
@@ -41,7 +41,7 @@ class TagConverter: # noqa: D101
|
|
|
41
41
|
**kwargs: Any,
|
|
42
42
|
) -> TaggedArrayData:
|
|
43
43
|
def to_tuple(
|
|
44
|
-
data: Optional[Union[ArrayLike, Tuple[ArrayLike, ArrayLike]]]
|
|
44
|
+
data: Optional[Union[ArrayLike, Tuple[ArrayLike, ArrayLike]]],
|
|
45
45
|
) -> Tuple[Optional[ArrayLike], Optional[ArrayLike]]:
|
|
46
46
|
if not isinstance(data, tuple):
|
|
47
47
|
return data, None
|
|
@@ -358,7 +358,7 @@ def _contrasting_color(r: int, g: int, b: int) -> str:
|
|
|
358
358
|
|
|
359
359
|
|
|
360
360
|
def _input_to_adatas(
|
|
361
|
-
inp: Union[AnnData, Tuple[AnnData, AnnData], "CompoundProblem"] # type: ignore[type-arg]
|
|
361
|
+
inp: Union[AnnData, Tuple[AnnData, AnnData], "CompoundProblem"], # type: ignore[type-arg]
|
|
362
362
|
) -> Tuple[AnnData, AnnData]:
|
|
363
363
|
from moscot.base.problems import CompoundProblem
|
|
364
364
|
|
|
@@ -138,15 +138,29 @@ class SpatialAlignmentMixin(AnalysisMixin[K, B]):
|
|
|
138
138
|
aligned_maps, aligned_metadata = self._interpolate_scheme(
|
|
139
139
|
reference=reference, mode=mode, spatial_key=spatial_key # type: ignore[arg-type]
|
|
140
140
|
)
|
|
141
|
-
|
|
141
|
+
|
|
142
|
+
batch_categories = self.adata.obs[self._policy.key].cat.categories
|
|
143
|
+
batch_indices = {}
|
|
144
|
+
result = np.zeros((self.adata.n_obs, aligned_maps[list(aligned_maps.keys())[0]].shape[1]))
|
|
145
|
+
|
|
146
|
+
# Create batch to index mapping
|
|
147
|
+
for cat in batch_categories:
|
|
148
|
+
batch_indices[cat] = np.where(self.adata.obs[self._policy.key] == cat)[0]
|
|
149
|
+
|
|
150
|
+
# Assign aligned coordinates to the correct positions in result array
|
|
151
|
+
for cat, indices in batch_indices.items():
|
|
152
|
+
if cat in aligned_maps:
|
|
153
|
+
result[indices] = aligned_maps[cat]
|
|
142
154
|
|
|
143
155
|
if key_added is None:
|
|
144
|
-
return
|
|
156
|
+
return result, aligned_metadata
|
|
145
157
|
|
|
146
|
-
self.adata.obsm[key_added] =
|
|
158
|
+
self.adata.obsm[key_added] = result
|
|
147
159
|
if mode == "affine": # noqa: RET503
|
|
148
160
|
self.adata.uns.setdefault(key_added, {})
|
|
149
|
-
self.adata.uns[key_added]["alignment_metadata"] = aligned_metadata
|
|
161
|
+
self.adata.uns[key_added]["alignment_metadata"] = aligned_metadata
|
|
162
|
+
|
|
163
|
+
return None
|
|
150
164
|
|
|
151
165
|
def cell_transition(
|
|
152
166
|
self,
|
|
@@ -399,7 +413,6 @@ class SpatialMappingMixin(AnalysisMixin[K, B], AbstractSpSc):
|
|
|
399
413
|
|
|
400
414
|
corrs: Union[Dict[Tuple[K, K], Dict[Any, pd.Series]], Dict[Tuple[K, K], pd.Series]] = {}
|
|
401
415
|
for key, val in self.solutions.items():
|
|
402
|
-
|
|
403
416
|
# create mask corresponding to the current batch of spatial data
|
|
404
417
|
index_obs = (
|
|
405
418
|
(self.adata_sp.obs[self._policy.key] == key[0])
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: moscot
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.2
|
|
4
4
|
Summary: Multi-omic single-cell optimal transport tools
|
|
5
5
|
Author: Dominik Klein, Giovanni Palla, Michal Klein, Zoe Piran, Marius Lange
|
|
6
6
|
Maintainer-email: Dominik Klein <dominik.klein@helmholtz-muenchen.de>, Giovanni Palla <giovanni.palla@helmholtz-muenchen.de>, Michal Klein <michal.klein@helmholtz-muenchen.de>
|
|
@@ -98,6 +98,7 @@ Requires-Dist: sphinx-tippy>=0.4.1; extra == "docs"
|
|
|
98
98
|
Requires-Dist: myst-nb>=0.17.1; extra == "docs"
|
|
99
99
|
Requires-Dist: ipython>=7.20.0; extra == "docs"
|
|
100
100
|
Requires-Dist: sphinx_design>=0.3.0; extra == "docs"
|
|
101
|
+
Dynamic: license-file
|
|
101
102
|
|
|
102
103
|
|PyPI| |Downloads| |CI| |Pre-commit| |Codecov| |Docs|
|
|
103
104
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|