moscot 0.4.2__tar.gz → 0.4.3__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.
Files changed (81) hide show
  1. {moscot-0.4.2 → moscot-0.4.3}/.pre-commit-config.yaml +1 -1
  2. {moscot-0.4.2 → moscot-0.4.3}/PKG-INFO +6 -6
  3. {moscot-0.4.2 → moscot-0.4.3}/pyproject.toml +6 -8
  4. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/backends/ott/output.py +3 -5
  5. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/base/problems/_mixins.py +1 -1
  6. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/base/problems/birth_death.py +1 -1
  7. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/costs/_costs.py +3 -3
  8. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/datasets.py +1 -1
  9. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/problems/spatiotemporal/_spatio_temporal.py +1 -1
  10. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/utils/subset_policy.py +7 -0
  11. {moscot-0.4.2 → moscot-0.4.3}/src/moscot.egg-info/PKG-INFO +6 -6
  12. {moscot-0.4.2 → moscot-0.4.3}/src/moscot.egg-info/requires.txt +5 -6
  13. {moscot-0.4.2 → moscot-0.4.3}/.gitignore +0 -0
  14. {moscot-0.4.2 → moscot-0.4.3}/.gitmodules +0 -0
  15. {moscot-0.4.2 → moscot-0.4.3}/.readthedocs.yml +0 -0
  16. {moscot-0.4.2 → moscot-0.4.3}/.run_notebooks.sh +0 -0
  17. {moscot-0.4.2 → moscot-0.4.3}/LICENSE +0 -0
  18. {moscot-0.4.2 → moscot-0.4.3}/MANIFEST.in +0 -0
  19. {moscot-0.4.2 → moscot-0.4.3}/README.rst +0 -0
  20. {moscot-0.4.2 → moscot-0.4.3}/codecov.yml +0 -0
  21. {moscot-0.4.2 → moscot-0.4.3}/setup.cfg +0 -0
  22. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/__init__.py +0 -0
  23. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/_constants.py +0 -0
  24. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/_logging.py +0 -0
  25. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/_registry.py +0 -0
  26. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/_types.py +0 -0
  27. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/backends/__init__.py +0 -0
  28. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/backends/ott/__init__.py +0 -0
  29. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/backends/ott/_utils.py +0 -0
  30. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/backends/ott/solver.py +0 -0
  31. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/backends/utils.py +0 -0
  32. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/base/__init__.py +0 -0
  33. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/base/cost.py +0 -0
  34. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/base/output.py +0 -0
  35. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/base/problems/__init__.py +0 -0
  36. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/base/problems/_utils.py +0 -0
  37. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/base/problems/compound_problem.py +0 -0
  38. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/base/problems/manager.py +0 -0
  39. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/base/problems/problem.py +0 -0
  40. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/base/solver.py +0 -0
  41. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/costs/__init__.py +0 -0
  42. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/costs/_utils.py +0 -0
  43. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/neural/base/__init__.py +0 -0
  44. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/neural/base/problems/__init__.py +0 -0
  45. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/neural/base/problems/problem.py +0 -0
  46. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/neural/problems/__init__.py +0 -0
  47. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/neural/problems/generic/__init__.py +0 -0
  48. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/neural/problems/generic/_generic.py +0 -0
  49. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/plotting/__init__.py +0 -0
  50. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/plotting/_plotting.py +0 -0
  51. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/plotting/_utils.py +0 -0
  52. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/problems/__init__.py +0 -0
  53. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/problems/_utils.py +0 -0
  54. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/problems/cross_modality/__init__.py +0 -0
  55. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/problems/cross_modality/_mixins.py +0 -0
  56. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/problems/cross_modality/_translation.py +0 -0
  57. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/problems/generic/__init__.py +0 -0
  58. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/problems/generic/_generic.py +0 -0
  59. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/problems/generic/_mixins.py +0 -0
  60. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/problems/space/__init__.py +0 -0
  61. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/problems/space/_alignment.py +0 -0
  62. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/problems/space/_mapping.py +0 -0
  63. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/problems/space/_mixins.py +0 -0
  64. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/problems/spatiotemporal/__init__.py +0 -0
  65. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/problems/time/__init__.py +0 -0
  66. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/problems/time/_lineage.py +0 -0
  67. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/problems/time/_mixins.py +0 -0
  68. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/py.typed +0 -0
  69. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/utils/__init__.py +0 -0
  70. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/utils/_data/allTFs_dmel.txt +0 -0
  71. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/utils/_data/allTFs_hg38.txt +0 -0
  72. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/utils/_data/allTFs_mm.txt +0 -0
  73. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/utils/_data/human_apoptosis.txt +0 -0
  74. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/utils/_data/human_proliferation.txt +0 -0
  75. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/utils/_data/mouse_apoptosis.txt +0 -0
  76. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/utils/_data/mouse_proliferation.txt +0 -0
  77. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/utils/data.py +0 -0
  78. {moscot-0.4.2 → moscot-0.4.3}/src/moscot/utils/tagged_array.py +0 -0
  79. {moscot-0.4.2 → moscot-0.4.3}/src/moscot.egg-info/SOURCES.txt +0 -0
  80. {moscot-0.4.2 → moscot-0.4.3}/src/moscot.egg-info/dependency_links.txt +0 -0
  81. {moscot-0.4.2 → moscot-0.4.3}/src/moscot.egg-info/top_level.txt +0 -0
@@ -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.10
66
+ rev: v0.11.7
67
67
  hooks:
68
68
  - id: ruff
69
69
  args: [--fix, --exit-non-zero-on-fix]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: moscot
3
- Version: 0.4.2
3
+ Version: 0.4.3
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>
@@ -65,18 +65,18 @@ Requires-Dist: anndata>=0.9.1
65
65
  Requires-Dist: scanpy>=1.9.3
66
66
  Requires-Dist: wrapt>=1.13.2
67
67
  Requires-Dist: docrep>=0.3.2
68
+ Requires-Dist: jax>=0.6.1
68
69
  Requires-Dist: ott-jax>=0.5.0
69
70
  Requires-Dist: cloudpickle>=2.2.0
70
71
  Requires-Dist: rich>=13.5
71
72
  Requires-Dist: docstring_inheritance>=2.0.0
72
73
  Requires-Dist: mudata>=0.2.2
74
+ Requires-Dist: optax
75
+ Requires-Dist: flax
76
+ Requires-Dist: diffrax
77
+ Requires-Dist: ott-jax[neural]>=0.5.0
73
78
  Provides-Extra: spatial
74
79
  Requires-Dist: squidpy>=1.2.3; extra == "spatial"
75
- Provides-Extra: neural
76
- Requires-Dist: optax; extra == "neural"
77
- Requires-Dist: flax; extra == "neural"
78
- Requires-Dist: diffrax; extra == "neural"
79
- Requires-Dist: ott-jax[neural]>=0.5.0; extra == "neural"
80
80
  Provides-Extra: dev
81
81
  Requires-Dist: pre-commit>=3.0.0; extra == "dev"
82
82
  Requires-Dist: tox>=4; extra == "dev"
@@ -54,11 +54,16 @@ dependencies = [
54
54
  "scanpy>=1.9.3",
55
55
  "wrapt>=1.13.2",
56
56
  "docrep>=0.3.2",
57
+ "jax>=0.6.1",
57
58
  "ott-jax>=0.5.0",
58
59
  "cloudpickle>=2.2.0",
59
60
  "rich>=13.5",
60
61
  "docstring_inheritance>=2.0.0",
61
- "mudata>=0.2.2"
62
+ "mudata>=0.2.2",
63
+ "optax",
64
+ "flax",
65
+ "diffrax",
66
+ "ott-jax[neural]>=0.5.0"
62
67
  ]
63
68
 
64
69
  [project.optional-dependencies]
@@ -66,13 +71,6 @@ spatial = [
66
71
  "squidpy>=1.2.3"
67
72
  ]
68
73
 
69
- neural = [
70
- "optax",
71
- "flax",
72
- "diffrax",
73
- "ott-jax[neural]>=0.5.0",
74
-
75
- ]
76
74
  dev = [
77
75
  "pre-commit>=3.0.0",
78
76
  "tox>=4",
@@ -1,7 +1,5 @@
1
1
  from typing import Any, Callable, List, Optional, Tuple, Union
2
2
 
3
- import jaxlib.xla_extension as xla_ext
4
-
5
3
  import jax
6
4
  import jax.numpy as jnp
7
5
  import numpy as np
@@ -209,7 +207,7 @@ class OTTOutput(BaseDiscreteSolverOutput):
209
207
  else:
210
208
  idx = 0
211
209
 
212
- if not isinstance(device, xla_ext.Device):
210
+ if not isinstance(device, jax.Device):
213
211
  try:
214
212
  device = jax.devices(device)[idx]
215
213
  except IndexError:
@@ -441,7 +439,7 @@ class NeuralOutput(BaseNeuralOutput):
441
439
  # else:
442
440
  # idx = 0
443
441
 
444
- # if not isinstance(device, xla_ext.Device):
442
+ # if not isinstance(device, jax.Device):
445
443
  # try:
446
444
  # device = jax.devices(device)[idx]
447
445
  # except IndexError as err:
@@ -509,7 +507,7 @@ class GraphOTTOutput(OTTOutput):
509
507
  else:
510
508
  idx = 0
511
509
 
512
- if not isinstance(device, xla_ext.Device):
510
+ if not isinstance(device, jax.Device):
513
511
  try:
514
512
  device = jax.devices(device)[idx]
515
513
  except IndexError:
@@ -394,7 +394,7 @@ class AnalysisMixin(Generic[K, B], AbstractPushPullAdata, AbstractSolutionsProbl
394
394
 
395
395
  def _interpolate_transport(
396
396
  self,
397
- # TODO(@giovp): rename this to 'explicit_steps', pass to policy.plan() and reintroduce (source_key, target_key)
397
+ # TODO(@giovp): rename this to 'explicit_steps'; pass to policy.plan() and reintroduce (source_key, target_key)
398
398
  path: Sequence[tuple[K, K]],
399
399
  scale_by_marginals: bool = True,
400
400
  **_: Any,
@@ -188,7 +188,7 @@ class BirthDeathProblem(BirthDeathMixin, OTProblem):
188
188
 
189
189
  Examples
190
190
  --------
191
- - See :doc:`../../notebooks/examples/problems/800_score_genes_for_marginals`
191
+ - See :doc:`../../notebooks/examples/problems/TemporalProblem/800_score_genes_for_marginals`
192
192
  on examples how to use :meth:`~moscot.problems.time.TemporalProblem.score_genes_for_marginals`.
193
193
 
194
194
  """ # noqa: D205
@@ -18,8 +18,8 @@ class BarcodeDistance(BaseCost):
18
18
  """Scaled `Hamming distance <https://en.wikipedia.org/wiki/Hamming_distance>`_ between barcodes.
19
19
 
20
20
  .. seealso::
21
- - See :doc:`../../notebooks/examples/problems/700_barcode_distance` on how to use this cost
22
- in the :class:`~moscot.problems.time.LineageProblem`.
21
+ - See :doc:`../../notebooks/examples/problems/LineageProblem/700_barcode_distance` on
22
+ how to use this cost in the :class:`~moscot.problems.time.LineageProblem`.
23
23
 
24
24
  Parameters
25
25
  ----------
@@ -68,7 +68,7 @@ class LeafDistance(BaseCost):
68
68
  This class ignores `attr` which is always set to `uns`.
69
69
 
70
70
  .. seealso::
71
- - See :doc:`../../notebooks/examples/problems/600_leaf_distance` on how to use this cost
71
+ - See :doc:`../../notebooks/examples/problems/LineageProblem/600_leaf_distance` on how to use this cost
72
72
  in the :class:`~moscot.problems.time.LineageProblem`.
73
73
 
74
74
  Parameters
@@ -369,7 +369,7 @@ def sciplex(
369
369
  """Perturbation dataset published in :cite:`srivatsan:20`.
370
370
 
371
371
  Transcriptomes of A549, K562, and mCF7 cells exposed to 188 compounds.
372
- Data obtained from http://projects.sanderlab.org/scperturb/.
372
+ Data obtained from :cite:`scperturb:24`.
373
373
 
374
374
  Parameters
375
375
  ----------
@@ -67,7 +67,7 @@ class SpatioTemporalProblem( # type: ignore[misc]
67
67
  .. seealso::
68
68
  - See :doc:`../../notebooks/tutorials/500_spatiotemporal` on how to
69
69
  prepare and solve the :class:`~moscot.problems.spatiotemporal.SpatioTemporalProblem`.
70
- - See :doc:`../../notebooks/examples/problems/800_score_genes_for_marginals` on how to
70
+ - See :doc:`../../notebooks/examples/problems/TemporalProblem/800_score_genes_for_marginals` on how to
71
71
  :meth:`score genes for proliferation and apoptosis <score_genes_for_marginals>`.
72
72
 
73
73
  Parameters
@@ -348,6 +348,13 @@ class StarPolicy(OrderedPolicy[K]):
348
348
  node = (node, self.reference)
349
349
  return super().remove_node(node) # type: ignore[return-value]
350
350
 
351
+ def _plan(self, start: Optional[K] = None, end: Optional[K] = None, **_: Any) -> Sequence[Tuple[K, K]]:
352
+ if start is None and end is None:
353
+ return list(self._graph)
354
+ if start is not None and end is not None:
355
+ return [(start, end)]
356
+ raise ValueError("For `StarPolicy`, the start and end node must both be `None` or both must be specified.")
357
+
351
358
  @property
352
359
  def reference(self) -> K:
353
360
  """Central node."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: moscot
3
- Version: 0.4.2
3
+ Version: 0.4.3
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>
@@ -65,18 +65,18 @@ Requires-Dist: anndata>=0.9.1
65
65
  Requires-Dist: scanpy>=1.9.3
66
66
  Requires-Dist: wrapt>=1.13.2
67
67
  Requires-Dist: docrep>=0.3.2
68
+ Requires-Dist: jax>=0.6.1
68
69
  Requires-Dist: ott-jax>=0.5.0
69
70
  Requires-Dist: cloudpickle>=2.2.0
70
71
  Requires-Dist: rich>=13.5
71
72
  Requires-Dist: docstring_inheritance>=2.0.0
72
73
  Requires-Dist: mudata>=0.2.2
74
+ Requires-Dist: optax
75
+ Requires-Dist: flax
76
+ Requires-Dist: diffrax
77
+ Requires-Dist: ott-jax[neural]>=0.5.0
73
78
  Provides-Extra: spatial
74
79
  Requires-Dist: squidpy>=1.2.3; extra == "spatial"
75
- Provides-Extra: neural
76
- Requires-Dist: optax; extra == "neural"
77
- Requires-Dist: flax; extra == "neural"
78
- Requires-Dist: diffrax; extra == "neural"
79
- Requires-Dist: ott-jax[neural]>=0.5.0; extra == "neural"
80
80
  Provides-Extra: dev
81
81
  Requires-Dist: pre-commit>=3.0.0; extra == "dev"
82
82
  Requires-Dist: tox>=4; extra == "dev"
@@ -7,11 +7,16 @@ anndata>=0.9.1
7
7
  scanpy>=1.9.3
8
8
  wrapt>=1.13.2
9
9
  docrep>=0.3.2
10
+ jax>=0.6.1
10
11
  ott-jax>=0.5.0
11
12
  cloudpickle>=2.2.0
12
13
  rich>=13.5
13
14
  docstring_inheritance>=2.0.0
14
15
  mudata>=0.2.2
16
+ optax
17
+ flax
18
+ diffrax
19
+ ott-jax[neural]>=0.5.0
15
20
 
16
21
  [dev]
17
22
  pre-commit>=3.0.0
@@ -29,12 +34,6 @@ myst-nb>=0.17.1
29
34
  ipython>=7.20.0
30
35
  sphinx_design>=0.3.0
31
36
 
32
- [neural]
33
- optax
34
- flax
35
- diffrax
36
- ott-jax[neural]>=0.5.0
37
-
38
37
  [spatial]
39
38
  squidpy>=1.2.3
40
39
 
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