DOTools-py 0.0.4__tar.gz → 0.1__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 (147) hide show
  1. {dotools_py-0.0.4 → dotools_py-0.1}/CHANGELOG.md +31 -0
  2. {dotools_py-0.0.4 → dotools_py-0.1}/PKG-INFO +23 -22
  3. {dotools_py-0.0.4 → dotools_py-0.1}/README.md +16 -19
  4. {dotools_py-0.0.4 → dotools_py-0.1}/docs/api/dt.md +1 -0
  5. dotools_py-0.1/docs/api/generated/MarkersCellsHeart.png +0 -0
  6. {dotools_py-0.0.4 → dotools_py-0.1}/docs/api/get.md +1 -0
  7. {dotools_py-0.0.4 → dotools_py-0.1}/docs/api/pl.md +2 -1
  8. {dotools_py-0.0.4 → dotools_py-0.1}/docs/api/pp.md +12 -3
  9. {dotools_py-0.0.4 → dotools_py-0.1}/docs/api/tl.md +10 -4
  10. {dotools_py-0.0.4 → dotools_py-0.1}/docs/api/utility.md +3 -0
  11. {dotools_py-0.0.4 → dotools_py-0.1}/docs/conf.py +4 -2
  12. {dotools_py-0.0.4 → dotools_py-0.1}/docs/installation.md +17 -20
  13. {dotools_py-0.0.4 → dotools_py-0.1}/pyproject.toml +7 -3
  14. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/_custom_class.py +4 -0
  15. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/bm/_helper.py +2 -4
  16. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/bm/_integration_metrics.py +1 -4
  17. dotools_py-0.1/src/dotools_py/dt/TableGO_Example.parquet +0 -0
  18. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/dt/__init__.py +1 -1
  19. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/dt/_datasets.py +44 -7
  20. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/dt/_markers.py +21 -1
  21. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/get/__init__.py +2 -1
  22. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/get/_generic.py +306 -132
  23. dotools_py-0.1/src/dotools_py/get/_get_classes.py +300 -0
  24. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/io/_dataframes.py +5 -1
  25. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/io/_objects.py +10 -7
  26. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/io/_rds.py +32 -109
  27. dotools_py-0.1/src/dotools_py/pl/_Classes.py +2272 -0
  28. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/pl/_StatsPlotter.py +73 -18
  29. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/pl/__init__.py +1 -1
  30. dotools_py-0.1/src/dotools_py/pl/_dotplot.py +233 -0
  31. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/pl/_downstream.py +259 -34
  32. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/pl/_embeddings.py +17 -13
  33. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/pl/_experimental.py +9 -9
  34. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/pl/_expression.py +34 -25
  35. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/pl/_heatmap.py +162 -398
  36. dotools_py-0.1/src/dotools_py/pl/_plot_utils.py +591 -0
  37. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/pl/_visium.py +8 -9
  38. dotools_py-0.1/src/dotools_py/pp/__init__.py +9 -0
  39. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/pp/_cellbender.py +136 -3
  40. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/pp/_importer.py +277 -44
  41. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/pp/_utils.py +19 -19
  42. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/settings/_configure.py +26 -12
  43. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/settings/_global_parameters.py +1 -1
  44. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/tl/_CCA/cca.py +1 -1
  45. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/tl/_Statistical.py +6 -7
  46. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/tl/_analysis.py +39 -24
  47. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/tl/_get_stats.py +18 -20
  48. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/tl/_rankGenes.py +20 -19
  49. dotools_py-0.1/src/dotools_py/util_scripts/_ReadWrite_RDS_anndataR.R +177 -0
  50. dotools_py-0.1/src/dotools_py/utility/__init__.py +5 -0
  51. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/utility/_general.py +213 -6
  52. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/utility/_plotting.py +55 -3
  53. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/utility/_spatial.py +3 -3
  54. {dotools_py-0.0.4 → dotools_py-0.1}/tests/data/test_datasets.py +7 -2
  55. {dotools_py-0.0.4 → dotools_py-0.1}/tests/data/test_markers.py +3 -2
  56. {dotools_py-0.0.4 → dotools_py-0.1}/tests/get/test_generic.py +42 -15
  57. {dotools_py-0.0.4 → dotools_py-0.1}/tests/io/test_IO.py +26 -18
  58. {dotools_py-0.0.4 → dotools_py-0.1}/tests/plotting/test_plotting.py +30 -30
  59. {dotools_py-0.0.4 → dotools_py-0.1}/tests/pp/test_importer.py +10 -4
  60. {dotools_py-0.0.4 → dotools_py-0.1}/tests/tools/test_analysis.py +40 -13
  61. {dotools_py-0.0.4 → dotools_py-0.1}/tests/tools/test_statistic.py +15 -4
  62. {dotools_py-0.0.4 → dotools_py-0.1}/tests/utility/test_anndata.py +2 -2
  63. {dotools_py-0.0.4 → dotools_py-0.1}/tests/utility/test_general.py +50 -8
  64. {dotools_py-0.0.4 → dotools_py-0.1}/tests/utility/test_logger.py +1 -1
  65. {dotools_py-0.0.4 → dotools_py-0.1}/tests/utility/test_plotting.py +16 -1
  66. dotools_py-0.0.4/docs/api/generated/MarkersCellsHeart.png +0 -0
  67. dotools_py-0.0.4/src/dotools_py/pl/_Classes.py +0 -736
  68. dotools_py-0.0.4/src/dotools_py/pl/_dotplot.py +0 -2059
  69. dotools_py-0.0.4/src/dotools_py/pl/_plot_utils.py +0 -281
  70. dotools_py-0.0.4/src/dotools_py/pp/__init__.py +0 -2
  71. dotools_py-0.0.4/src/dotools_py/utility/__init__.py +0 -3
  72. {dotools_py-0.0.4 → dotools_py-0.1}/.codecov.yaml +0 -0
  73. {dotools_py-0.0.4 → dotools_py-0.1}/.cruft.json +0 -0
  74. {dotools_py-0.0.4 → dotools_py-0.1}/.editorconfig +0 -0
  75. {dotools_py-0.0.4 → dotools_py-0.1}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  76. {dotools_py-0.0.4 → dotools_py-0.1}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  77. {dotools_py-0.0.4 → dotools_py-0.1}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  78. {dotools_py-0.0.4 → dotools_py-0.1}/.github/workflows/build.yaml +0 -0
  79. {dotools_py-0.0.4 → dotools_py-0.1}/.github/workflows/release.yaml +0 -0
  80. {dotools_py-0.0.4 → dotools_py-0.1}/.github/workflows/test.yaml +0 -0
  81. {dotools_py-0.0.4 → dotools_py-0.1}/.gitignore +0 -0
  82. {dotools_py-0.0.4 → dotools_py-0.1}/.pre-commit-config.yaml +0 -0
  83. {dotools_py-0.0.4 → dotools_py-0.1}/.readthedocs.yaml +0 -0
  84. {dotools_py-0.0.4 → dotools_py-0.1}/.vscode/extensions.json +0 -0
  85. {dotools_py-0.0.4 → dotools_py-0.1}/.vscode/launch.json +0 -0
  86. {dotools_py-0.0.4 → dotools_py-0.1}/.vscode/settings.json +0 -0
  87. {dotools_py-0.0.4 → dotools_py-0.1}/LICENSE +0 -0
  88. {dotools_py-0.0.4 → dotools_py-0.1}/biome.jsonc +0 -0
  89. {dotools_py-0.0.4 → dotools_py-0.1}/docs/_static/.gitkeep +0 -0
  90. {dotools_py-0.0.4 → dotools_py-0.1}/docs/_static/css/custom.css +0 -0
  91. {dotools_py-0.0.4 → dotools_py-0.1}/docs/_static/figures/DoTools_Overview.png +0 -0
  92. {dotools_py-0.0.4 → dotools_py-0.1}/docs/_static/figures/LogoDoTools.png +0 -0
  93. {dotools_py-0.0.4 → dotools_py-0.1}/docs/_templates/.gitkeep +0 -0
  94. {dotools_py-0.0.4 → dotools_py-0.1}/docs/_templates/autosummary/class.rst +0 -0
  95. {dotools_py-0.0.4 → dotools_py-0.1}/docs/api/bm.md +0 -0
  96. {dotools_py-0.0.4 → dotools_py-0.1}/docs/api/index.md +0 -0
  97. {dotools_py-0.0.4 → dotools_py-0.1}/docs/api/io.md +0 -0
  98. {dotools_py-0.0.4 → dotools_py-0.1}/docs/api/settings.md +0 -0
  99. {dotools_py-0.0.4 → dotools_py-0.1}/docs/changelog.md +0 -0
  100. {dotools_py-0.0.4 → dotools_py-0.1}/docs/cite.md +0 -0
  101. {dotools_py-0.0.4 → dotools_py-0.1}/docs/extensions/typed_returns.py +0 -0
  102. {dotools_py-0.0.4 → dotools_py-0.1}/docs/figures/LogoDoTools.png +0 -0
  103. {dotools_py-0.0.4 → dotools_py-0.1}/docs/figures/split_bar_gsea_example.png +0 -0
  104. {dotools_py-0.0.4 → dotools_py-0.1}/docs/index.md +0 -0
  105. {dotools_py-0.0.4 → dotools_py-0.1}/docs/notebooks/Example_Visium.ipynb +0 -0
  106. {dotools_py-0.0.4 → dotools_py-0.1}/docs/notebooks/Integration.ipynb +0 -0
  107. {dotools_py-0.0.4 → dotools_py-0.1}/docs/notebooks/Running_CellBender.ipynb +0 -0
  108. {dotools_py-0.0.4 → dotools_py-0.1}/docs/notebooks/dea.ipynb +0 -0
  109. {dotools_py-0.0.4 → dotools_py-0.1}/docs/notebooks/example_10X.ipynb +0 -0
  110. {dotools_py-0.0.4 → dotools_py-0.1}/docs/notebooks/example_visualisation.ipynb +0 -0
  111. {dotools_py-0.0.4 → dotools_py-0.1}/docs/notebooks/index.md +0 -0
  112. {dotools_py-0.0.4 → dotools_py-0.1}/docs/references.bib +0 -0
  113. {dotools_py-0.0.4 → dotools_py-0.1}/docs/references.md +0 -0
  114. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/__init__.py +0 -0
  115. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/_experimental/__init__.py +0 -0
  116. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/_experimental/_deprecated/__init__.py +0 -0
  117. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/_experimental/_deprecated/_convertion.py +0 -0
  118. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/_experimental/_deprecated/_expression.py +0 -0
  119. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/_experimental/_deprecated/_importer.py +0 -0
  120. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/_experimental/_deprecated/_language.py +0 -0
  121. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/_experimental/_deprecated/_old_code.py +0 -0
  122. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/_experimental/_deprecated/_statistics.py +0 -0
  123. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/_experimental/gr/__init__.py +0 -0
  124. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/_experimental/gr/_generic.py +0 -0
  125. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/_utils.py +0 -0
  126. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/bm/__init__.py +0 -0
  127. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/dt/example_reduced.h5ad +0 -0
  128. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/dt/example_visium_reduced.h5ad +0 -0
  129. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/io/__init__.py +0 -0
  130. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/io/_utils.py +0 -0
  131. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/logger.py +0 -0
  132. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/pl/_Plotter.py +0 -0
  133. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/settings/__init__.py +0 -0
  134. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/tl/_CCA/_Original.py +0 -0
  135. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/tl/__init__.py +0 -0
  136. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/util_scripts/_ReadWrite_RDS.R +0 -0
  137. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/util_scripts/_run_CCA.R +0 -0
  138. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/util_scripts/_run_CellBender.sh +0 -0
  139. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/util_scripts/_run_MAST.R +0 -0
  140. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/util_scripts/_run_SCTransform.R +0 -0
  141. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/util_scripts/_run_edgeR.R +0 -0
  142. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/util_scripts/_run_scDblFinder.R +0 -0
  143. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/utility/HomoSapiens_GeneMetadata.pickle.gz +0 -0
  144. {dotools_py-0.0.4 → dotools_py-0.1}/src/dotools_py/utility/MusMusculus_GeneMetadata.pickle.gz +0 -0
  145. {dotools_py-0.0.4 → dotools_py-0.1}/tests/bm/test_bm.py +0 -0
  146. {dotools_py-0.0.4 → dotools_py-0.1}/tests/conftest.py +0 -0
  147. {dotools_py-0.0.4 → dotools_py-0.1}/tests/pp/test_complementary.py +0 -0
@@ -8,6 +8,37 @@ and this project adheres to [Semantic Versioning][].
8
8
  [keep a changelog]: https://keepachangelog.com/en/1.0.0/
9
9
  [semantic versioning]: https://semver.org/spec/v2.0.0.html
10
10
 
11
+
12
+ ## Version 0.1 {small}`2026-12-03`
13
+
14
+ ### Changes
15
+ - For the majority of the functions the arguments are now keyword-only except `adata`.
16
+
17
+ ### Features
18
+ - Add ``dotools_py.pl.ora_network`` to visualize overrepresentation results as a network
19
+ - Add ``dotools_py.get.metacells`` to generate metacells
20
+ - Add ``dotools_py.pp.filter_cells`` and ``dotools_py.pp.filter_genes``
21
+ - Add ``dotools_py.pp.run_ambidose`` for ambient RNA removal
22
+ - Add ``do.dt.example_ora`` for tutorial examples
23
+ - Improvement of ``do.pl.heatmap`` to groupby two categories like in ``do.pl.dotplot``
24
+ - Include option to filter-out features not present in the object for ``do.dt.heart_markers``
25
+ - Replace ``zellkonverter`` with ``anndataR`` to improve reading and saving to Seurat/SingleCellExperiment
26
+ - Add ``dotools_py.utility.set_path`` to create and return a normalize path
27
+ - Add ``dotools_py.utility.to_toml`` to save information of the current environment to TOML file for sharing
28
+ - Add utility functions for plotting
29
+ - Improvement of the performance of ``do.get.mean_expr`` and ``do.get.expr``
30
+ - Improvement of performance of ``do.get.pseudobulk`` and allow to use different backends (`scanpy`, `decoupler`, `dotools`)
31
+ - ``dotools_py.pl.cell_composition`` shows the number of cells per condition at the top of the bar
32
+
33
+ ### Bug Fixes
34
+ - Bug fixes for several functions
35
+ - Fix error when saving results in ``do.tl.rank_genes_condition``
36
+ - Improve consistency for the matrix plots (``dotools_py.pl.dotplot`` and ``dotools_py.pl.heatmap``). Both use the same underlying code.
37
+
38
+ ### Documentation
39
+ - Update figure with markers in ``do.dt.heart_markers``
40
+
41
+
11
42
  ## Version 0.0.4 {small}`2026-06-10`
12
43
 
13
44
  ### News
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: DOTools_py
3
- Version: 0.0.4
3
+ Version: 0.1
4
4
  Summary: Convenient functions to streamline sc/snRNAseq data analysis workflow
5
5
  Project-URL: Documentation, https://DOTools_py.readthedocs.io/
6
6
  Project-URL: Homepage, https://github.com/davidrm-bio/DOTools_py
@@ -47,10 +47,12 @@ Requires-Dist: gseapy<1.1.11
47
47
  Requires-Dist: harmony-pytorch
48
48
  Requires-Dist: harmonypy
49
49
  Requires-Dist: jupyter
50
+ Requires-Dist: networkx
50
51
  Requires-Dist: numba
51
52
  Requires-Dist: numpy>=1.26.4
52
53
  Requires-Dist: pandas>=2.2.3
53
54
  Requires-Dist: polars>=1.30
55
+ Requires-Dist: prelude-py
54
56
  Requires-Dist: pydeseq2
55
57
  Requires-Dist: requests
56
58
  Requires-Dist: rich<14
@@ -62,6 +64,7 @@ Requires-Dist: scikit-image
62
64
  Requires-Dist: scipy
63
65
  Requires-Dist: scvi-tools>=1.3
64
66
  Requires-Dist: session-info2
67
+ Requires-Dist: tomlkit
65
68
  Requires-Dist: tqdm
66
69
  Provides-Extra: dev
67
70
  Requires-Dist: pre-commit; extra == 'dev'
@@ -103,6 +106,7 @@ Requires-Dist: appdirs; extra == 'test'
103
106
  Requires-Dist: bbknn; extra == 'test'
104
107
  Requires-Dist: celltypist; extra == 'test'
105
108
  Requires-Dist: coverage; extra == 'test'
109
+ Requires-Dist: decoupler; extra == 'test'
106
110
  Requires-Dist: doubletdetection; extra == 'test'
107
111
  Requires-Dist: fastexcel; extra == 'test'
108
112
  Requires-Dist: gseapy; extra == 'test'
@@ -120,7 +124,7 @@ Requires-Dist: scipy; extra == 'test'
120
124
  Requires-Dist: scvi-tools; extra == 'test'
121
125
  Requires-Dist: seaborn; extra == 'test'
122
126
  Requires-Dist: tqdm; extra == 'test'
123
- Requires-Dist: zarr; extra == 'test'
127
+ Requires-Dist: zarr<3; extra == 'test'
124
128
  Description-Content-Type: text/markdown
125
129
 
126
130
  # DOTools_py
@@ -135,7 +139,7 @@ Description-Content-Type: text/markdown
135
139
  [![PyPI Downloads](https://static.pepy.tech/personalized-badge/dotools-py?period=monthly&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=monthly+downloads)](https://pepy.tech/projects/dotools-py)
136
140
 
137
141
  [badge-tests]: https://img.shields.io/github/actions/workflow/status/davidrm-bio/DOTools_py/test.yaml?branch=main
138
- [badge-docs]: https://img.shields.io/readthedocs/DOTools_py/stable
142
+ [badge-docs]: https://img.shields.io/readthedocs/DOTools_py/latest
139
143
  [badge-issues]: https://img.shields.io/github/issues/davidrm-bio/DOTools_py
140
144
  [badge-stars]: https://img.shields.io/github/stars/davidrm-bio/DOTools_py?style=flat&logo=github&color=yellow
141
145
  [badge-coverage]: https://codecov.io/gh/davidrm-bio/DOTools_py/branch/main/graph/badge.svg
@@ -189,24 +193,22 @@ Some methods are run through R and require additional dependencies
189
193
  including: `Seurat`, `MAST`, `scDblFinder`, `zellkonverter`, `data.table` and `optparse`.
190
194
 
191
195
  ```R
192
- if (!require("BiocManager", quietly = TRUE))
193
- install.packages("BiocManager")
194
-
195
- install.packages("optparse", Ncpus=8)
196
- install.packages('remotes', Ncpus=8)
197
- install.packages('data.table', Ncpus = 8)
198
- remotes::install_github("satijalab/seurat", "seurat5", quiet = TRUE) # Seurat
199
- BiocManager::install("MAST")
200
- BiocManager::install("scDblFinder")
201
- BiocManager::install("zellkonverter")
202
- BiocManager::install('glmGamPoi')
196
+ if (!requireNamespace("pak", quietly = TRUE)) {
197
+ install.packages("pak")
198
+ }
199
+
200
+ pak::pkg_install(c(
201
+ "optparse", "remotes", "data.table", "bioc::MAST", "bioc::scDblFinder",
202
+ "bioc::anndataR", "bioc::glmGamPoi", "github::satijalab/seurat@seurat5"
203
+ ))
204
+
203
205
  ```
204
206
 
205
207
  For old CPU architectures there can be problems with [polars](https://docs.pola.rs/) making the kernel die
206
208
  when importing the package. In this case run
207
209
 
208
210
  ```bash
209
- pip install --no-cache polars-lts-cpu
211
+ uv pip install --no-cache polars-lts-cpu
210
212
  ```
211
213
 
212
214
  ## R version
@@ -215,17 +217,16 @@ We also have an R implementation of the [DOTools](https://github.com/MarianoRuz
215
217
  installed from Bioconductor:
216
218
 
217
219
  ```R
218
- if (!requireNamespace("BiocManager", quietly=TRUE)) {
219
- install.packages("BiocManager")
220
+ if (!requireNamespace("pak", quietly=TRUE)) {
221
+ install.packages("pak")
220
222
  }
221
- BiocManager::install("DOtools")
222
- devtools::install_github("MarianoRuzJurado/DOtools")
223
+ pak::pkg_install("bioc::DOtools")
223
224
  ```
224
225
 
225
- The developmental version can be downloaded using `devtools`:
226
+ The developmental version can be downloaded using `pak`:
226
227
 
227
228
  ```R
228
- devtools::install_github("MarianoRuzJurado/DOtools", ref="devel")
229
+ pak::pkg_install("github::MarianoRuzJurado/DOtools@devel")
229
230
  ```
230
231
 
231
232
  ## Release notes
@@ -10,7 +10,7 @@
10
10
  [![PyPI Downloads](https://static.pepy.tech/personalized-badge/dotools-py?period=monthly&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=monthly+downloads)](https://pepy.tech/projects/dotools-py)
11
11
 
12
12
  [badge-tests]: https://img.shields.io/github/actions/workflow/status/davidrm-bio/DOTools_py/test.yaml?branch=main
13
- [badge-docs]: https://img.shields.io/readthedocs/DOTools_py/stable
13
+ [badge-docs]: https://img.shields.io/readthedocs/DOTools_py/latest
14
14
  [badge-issues]: https://img.shields.io/github/issues/davidrm-bio/DOTools_py
15
15
  [badge-stars]: https://img.shields.io/github/stars/davidrm-bio/DOTools_py?style=flat&logo=github&color=yellow
16
16
  [badge-coverage]: https://codecov.io/gh/davidrm-bio/DOTools_py/branch/main/graph/badge.svg
@@ -64,24 +64,22 @@ Some methods are run through R and require additional dependencies
64
64
  including: `Seurat`, `MAST`, `scDblFinder`, `zellkonverter`, `data.table` and `optparse`.
65
65
 
66
66
  ```R
67
- if (!require("BiocManager", quietly = TRUE))
68
- install.packages("BiocManager")
69
-
70
- install.packages("optparse", Ncpus=8)
71
- install.packages('remotes', Ncpus=8)
72
- install.packages('data.table', Ncpus = 8)
73
- remotes::install_github("satijalab/seurat", "seurat5", quiet = TRUE) # Seurat
74
- BiocManager::install("MAST")
75
- BiocManager::install("scDblFinder")
76
- BiocManager::install("zellkonverter")
77
- BiocManager::install('glmGamPoi')
67
+ if (!requireNamespace("pak", quietly = TRUE)) {
68
+ install.packages("pak")
69
+ }
70
+
71
+ pak::pkg_install(c(
72
+ "optparse", "remotes", "data.table", "bioc::MAST", "bioc::scDblFinder",
73
+ "bioc::anndataR", "bioc::glmGamPoi", "github::satijalab/seurat@seurat5"
74
+ ))
75
+
78
76
  ```
79
77
 
80
78
  For old CPU architectures there can be problems with [polars](https://docs.pola.rs/) making the kernel die
81
79
  when importing the package. In this case run
82
80
 
83
81
  ```bash
84
- pip install --no-cache polars-lts-cpu
82
+ uv pip install --no-cache polars-lts-cpu
85
83
  ```
86
84
 
87
85
  ## R version
@@ -90,17 +88,16 @@ We also have an R implementation of the [DOTools](https://github.com/MarianoRuz
90
88
  installed from Bioconductor:
91
89
 
92
90
  ```R
93
- if (!requireNamespace("BiocManager", quietly=TRUE)) {
94
- install.packages("BiocManager")
91
+ if (!requireNamespace("pak", quietly=TRUE)) {
92
+ install.packages("pak")
95
93
  }
96
- BiocManager::install("DOtools")
97
- devtools::install_github("MarianoRuzJurado/DOtools")
94
+ pak::pkg_install("bioc::DOtools")
98
95
  ```
99
96
 
100
- The developmental version can be downloaded using `devtools`:
97
+ The developmental version can be downloaded using `pak`:
101
98
 
102
99
  ```R
103
- devtools::install_github("MarianoRuzJurado/DOtools", ref="devel")
100
+ pak::pkg_install("github::MarianoRuzJurado/DOtools@devel")
104
101
  ```
105
102
 
106
103
  ## Release notes
@@ -14,6 +14,7 @@ heart and the dataset from PBMC from 10x used in the tutorial.
14
14
  dt.example_10x_processed
15
15
  dt.example_visium
16
16
  dt.example_visium_processed
17
+ dt.example_ora
17
18
  ```
18
19
 
19
20
  ## Utility for heart datasets
@@ -25,5 +25,6 @@ AnnData object.
25
25
  get.subset
26
26
  get.subset_df
27
27
  get.pseudobulk
28
+ get.metacells
28
29
  get.layer_swap
29
30
  ```
@@ -40,13 +40,14 @@ functions for enhance visualization of sc/snRNA-seq data.
40
40
  ```
41
41
 
42
42
 
43
- ## Statistical plots
43
+ ## Downstream and Statistical plots
44
44
  ```{eval-rst}
45
45
  .. autosummary::
46
46
  :toctree: generated
47
47
 
48
48
  pl.cell_composition
49
49
  pl.split_bar_gsea
50
+ pl.ora_network
50
51
  pl.correlation
51
52
  pl.volcano_plot
52
53
  ```
@@ -4,8 +4,7 @@ The preprocessing module {mod}`dotools_py.pp` compiles all the basic quality con
4
4
  analyzing sc/snRNA-seq and Visium with different implementations building on packages from the
5
5
  [scverse ecosystem](https://scverse.org/)
6
6
 
7
-
8
- ## Processing
7
+ ## Ambient RNA removal
9
8
  ```{eval-rst}
10
9
  .. module:: dotools_py.pp
11
10
  .. currentmodule:: dotools_py
@@ -14,10 +13,20 @@ analyzing sc/snRNA-seq and Visium with different implementations building on pac
14
13
  :toctree: generated
15
14
 
16
15
  pp.run_cellbender
16
+ pp.run_ambidose
17
+ ```
18
+
19
+ ## Processing
20
+ ```{eval-rst}
21
+ .. autosummary::
22
+ :toctree: generated
23
+
17
24
  pp.importer_py
18
25
  pp.quality_control
19
26
  pp.log_normalize
20
27
  pp.pearson_residuals_normalize
21
28
  pp.find_doublets
22
-
29
+ pp.filter_cells
30
+ pp.filter_genes
23
31
  ```
32
+
@@ -4,7 +4,7 @@ The tools module {mod}`dotools_py.tl` contains functions for the downstream
4
4
  analysis and statistical methods.
5
5
 
6
6
 
7
- ## Downstream processing
7
+ ## Integration
8
8
  ```{eval-rst}
9
9
  .. module:: dotools_py.tl
10
10
  .. currentmodule:: dotools_py
@@ -17,14 +17,19 @@ analysis and statistical methods.
17
17
  tl.run_scanvi
18
18
  tl.run_harmony
19
19
  tl.run_seurat_integration
20
+ ```
21
+
22
+ ## Clustering and Cell Annotation
23
+ ```{eval-rst}
24
+ .. autosummary::
25
+ :toctree: generated
26
+
27
+ tl.umap_clustering
20
28
  tl.auto_annot
21
29
  tl.reclustering
22
30
  tl.full_recluster
23
- tl.umap_clustering
24
- tl.go_analysis
25
31
  ```
26
32
 
27
-
28
33
  ## Statistical Analysis
29
34
  ```{eval-rst}
30
35
  .. autosummary::
@@ -37,6 +42,7 @@ analysis and statistical methods.
37
42
  tl.rank_genes_consensus
38
43
  tl.grouped_ttest
39
44
  tl.run_mast
45
+ tl.go_analysis
40
46
  ```
41
47
 
42
48
 
@@ -13,9 +13,11 @@ the analysis.
13
13
 
14
14
  utility.free_memory
15
15
  utility.create_report
16
+ utility.to_toml
16
17
  utility.transfer_labels
17
18
  utility.add_gene_metadata
18
19
  utility.live_display
20
+ utility.set_path
19
21
  ```
20
22
 
21
23
 
@@ -28,6 +30,7 @@ the analysis.
28
30
  utility.extended_tab20
29
31
  utility.get_hex_colormaps
30
32
  utility.spine_format
33
+ utility.add_spines
31
34
  utility.tab30
32
35
  ```
33
36
 
@@ -26,6 +26,7 @@ matplotlib.use("agg")
26
26
 
27
27
  # NOTE: If you installed your project in editable mode, this might be stale.
28
28
  # If this is the case, reinstall it to refresh the metadata
29
+
29
30
  info = metadata("DOTools_py")
30
31
  project_name = info["Name"]
31
32
  author = info["Author"]
@@ -34,7 +35,7 @@ version = info["Version"]
34
35
  urls = dict(pu.split(", ") for pu in info.get_all("Project-URL"))
35
36
  repository_url = urls["Source"]
36
37
 
37
- github_repo = "pertpy"
38
+ # github_repo = "pertpy"
38
39
 
39
40
  # The full version, including alpha/beta/rc tags
40
41
  release = info["Version"]
@@ -42,6 +43,7 @@ release = info["Version"]
42
43
  bibtex_bibfiles = ["references.bib"]
43
44
  templates_path = ["_templates"]
44
45
  nitpicky = True # Warn about broken links
46
+
45
47
  needs_sphinx = "4.0"
46
48
 
47
49
  html_context = {
@@ -108,7 +110,7 @@ source_suffix = {
108
110
 
109
111
  intersphinx_mapping = {
110
112
  "python": ("https://docs.python.org/3", None),
111
- "anndata": ("https://anndata.readthedocs.io/en/stable/", None),
113
+ "anndata": ("https://anndata.scverse.org/en/stable/", None),
112
114
  "scanpy": ("https://scanpy.readthedocs.io/en/stable/", None),
113
115
  "numpy": ("https://numpy.org/doc/stable/", None),
114
116
  "matplotlib": ("https://matplotlib.org/stable/", None),
@@ -21,7 +21,7 @@ uv pip install dotools-py
21
21
  uv pip install git+https://github.com/davidrm-bio/DOTools_py.git@main
22
22
  ```
23
23
 
24
- Finally, to use this environment in jupyter notebook, add jupyter kernel for this environment:
24
+ Finally, to use this environment in Jupyter notebook, add jupyter kernel for this environment:
25
25
 
26
26
  ```bash
27
27
  python -m ipykernel install --user --name=scrna_py11 --display-name=scrna_py11
@@ -33,27 +33,25 @@ This package has been tested on macOS, Linux and Windows System. For a standard
33
33
  we suggest 16GB of RAM and at least 5 CPUs.
34
34
 
35
35
  Some methods are run through R and require additional dependencies
36
- including: `Seurat`, `MAST`, `scDblFinder`, `zellkonverter`, `data.table` and `optparse`.
36
+ including: `Seurat`, `MAST`, `scDblFinder`, `anndataR`, `data.table` and `optparse`.
37
37
 
38
38
  ```R
39
- if (!require("BiocManager", quietly = TRUE))
40
- install.packages("BiocManager")
41
-
42
- install.packages("optparse", Ncpus=8)
43
- install.packages('remotes', Ncpus=8)
44
- install.packages('data.table', Ncpus = 8)
45
- remotes::install_github("satijalab/seurat", "seurat5", quiet = TRUE) # Seurat
46
- BiocManager::install("MAST")
47
- BiocManager::install("scDblFinder")
48
- BiocManager::install("zellkonverter")
49
- BiocManager::install('glmGamPoi')
39
+ if (!requireNamespace("pak", quietly = TRUE)) {
40
+ install.packages("pak")
41
+ }
42
+
43
+ pak::pkg_install(c(
44
+ "optparse", "remotes", "data.table", "bioc::MAST", "bioc::scDblFinder",
45
+ "bioc::anndataR", "bioc::glmGamPoi", "github::satijalab/seurat@seurat5"
46
+ ))
47
+
50
48
  ```
51
49
 
52
50
  For old CPU architectures there can be problems with [polars](https://docs.pola.rs/) making the kernel die
53
51
  when importing the package. In this case run
54
52
 
55
53
  ```bash
56
- pip install --no-cache polars-lts-cpu
54
+ uv pip install --no-cache polars-lts-cpu
57
55
  ```
58
56
 
59
57
  # R version
@@ -62,15 +60,14 @@ We also have an R implementation of the [DOTools](https://github.com/MarianoRuz
62
60
  installed from Bioconductor:
63
61
 
64
62
  ```R
65
- if (!requireNamespace("BiocManager", quietly=TRUE)) {
66
- install.packages("BiocManager")
63
+ if (!requireNamespace("pak", quietly=TRUE)) {
64
+ install.packages("pak")
67
65
  }
68
- BiocManager::install("DOtools")
69
- devtools::install_github("MarianoRuzJurado/DOtools")
66
+ pak::pkg_install("bioc::DOtools")
70
67
  ```
71
68
 
72
- The developmental version can be downloaded using `devtools`:
69
+ The developmental version can be downloaded using `pak`:
73
70
 
74
71
  ```R
75
- devtools::install_github("MarianoRuzJurado/DOtools", ref="devel")
72
+ pak::pkg_install("github::MarianoRuzJurado/DOtools@devel")
76
73
  ```
@@ -4,7 +4,7 @@ requires = ["hatchling"]
4
4
 
5
5
  [project]
6
6
  name = "DOTools_py"
7
- version = "0.0.4"
7
+ version = "0.1"
8
8
  description = "Convenient functions to streamline sc/snRNAseq data analysis workflow"
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
@@ -63,6 +63,9 @@ dependencies = [
63
63
  "harmony-pytorch",
64
64
  "appdirs",
65
65
  "rich<14",
66
+ "networkx",
67
+ "prelude_py",
68
+ "tomlkit"
66
69
  ]
67
70
 
68
71
 
@@ -124,9 +127,10 @@ optional-dependencies.test = [
124
127
  "tqdm",
125
128
  "pyarrow",
126
129
  "fastexcel",
127
- "zarr",
130
+ "zarr<3",
128
131
  "appdirs",
129
- "rich<14"
132
+ "rich<14",
133
+ "decoupler"
130
134
  ]
131
135
  # https://docs.pypi.org/project_metadata/#project-urls
132
136
  urls.Documentation = "https://DOTools_py.readthedocs.io/"
@@ -15,6 +15,9 @@ class InputError(Exception):
15
15
  def __str__(self):
16
16
  return f"{self.message}"
17
17
 
18
+ def __repr__(self) -> str:
19
+ return f"InputError: {self.message}"
20
+
18
21
 
19
22
  class EmptyType:
20
23
  """A singleton sentinel representing an 'empty' value."""
@@ -23,3 +26,4 @@ class EmptyType:
23
26
 
24
27
 
25
28
  PathLike = str | os.PathLike[str] | pathlib.Path
29
+ ColorLike = str | tuple[float, float, float] | tuple[float, float, float, float]
@@ -1,7 +1,5 @@
1
- import pandas as pd
2
- import numpy as np
3
- from dotools_py.logger import logger
4
-
1
+ from dotools_py.logger import logger
2
+ from prelude_py import pd, np
5
3
 
6
4
  # Helper functions adapted from scib
7
5
 
@@ -1,9 +1,6 @@
1
1
  from typing import Literal
2
2
 
3
- import anndata as ad
4
- import matplotlib.pyplot as plt
5
- import numpy as np
6
- import pandas as pd
3
+ from prelude_py import ad, plt, np, pd
7
4
  from scipy.sparse.csgraph import connected_components
8
5
  from numba import njit
9
6
 
@@ -1,2 +1,2 @@
1
- from dotools_py.dt._datasets import example_10x, example_10x_processed, example_visium, example_visium_processed
1
+ from dotools_py.dt._datasets import example_10x, example_10x_processed, example_visium, example_visium_processed, example_ora
2
2
  from dotools_py.dt._markers import heart_markers, standard_ct_labels_heart
@@ -2,7 +2,7 @@ import tqdm
2
2
  import appdirs
3
3
  from typing import Literal
4
4
 
5
- import anndata as ad
5
+ from prelude_py import pd, ad
6
6
 
7
7
  from dotools_py import logger
8
8
  from dotools_py._custom_class import PathLike, InputError
@@ -16,7 +16,7 @@ class LoadData:
16
16
 
17
17
  def __init__(
18
18
  self,
19
- path: PathLike = None,
19
+ path: PathLike | None = None,
20
20
  technology: Literal["scrna", "visium"] = "scrna"
21
21
  ):
22
22
  """Initiate the class
@@ -65,7 +65,7 @@ class LoadData:
65
65
  return self
66
66
 
67
67
 
68
- def _create_dir(self, path: PathLike = None) -> tuple | PathLike:
68
+ def _create_dir(self, path: PathLike | None = None) -> tuple | PathLike:
69
69
  """Create a directory in path to save the data
70
70
 
71
71
  :param path: Absolute path where the data is going to be saved. If set to `None` save in the Cache folder.
@@ -136,7 +136,7 @@ class LoadData:
136
136
  return None
137
137
 
138
138
 
139
- def example_10x(path: PathLike = None) -> None:
139
+ def example_10x(*, path: PathLike | None = None) -> None:
140
140
  """Download scRNA 10x dataset.
141
141
 
142
142
  Downloads an example dataset of PBMC from healthy donors and malignant B cells. Two H5 files for each dataset
@@ -148,7 +148,6 @@ def example_10x(path: PathLike = None) -> None:
148
148
 
149
149
  Example
150
150
  -------
151
-
152
151
  >>> import dotools_py as do
153
152
  >>> do.dt.example_10x()
154
153
  2026-04-17 14:37:49,503 - Downloading data to /Users/david/Library/Caches/dotools_datasets
@@ -198,7 +197,7 @@ def example_10x_processed() -> ad.AnnData:
198
197
  return ad.read_h5ad(HERE / "example_reduced.h5ad")
199
198
 
200
199
 
201
- def example_visium(path: PathLike = None) -> None:
200
+ def example_visium(*, path: PathLike | None = None) -> None:
202
201
  """ Download a 10x Visium dataset from the heart.
203
202
 
204
203
  Downloads a dataset of the human heart. The sample comes from fresh frozen tissue and includes the H&E image.
@@ -206,7 +205,7 @@ def example_visium(path: PathLike = None) -> None:
206
205
  :param path: Absolute path where the data is saved. If set to `None`, it will be saved to the user cache folder.
207
206
  :return: Returns `None`.
208
207
 
209
- Examples
208
+ Example
210
209
  --------
211
210
  >>> import dotools_py as do
212
211
  >>> do.dt.example_visium()
@@ -257,3 +256,41 @@ def example_visium_processed()-> ad.AnnData:
257
256
 
258
257
  """
259
258
  return ad.read_h5ad(HERE / "example_visium_reduced.h5ad")
259
+
260
+
261
+ def example_ora() -> pd.DataFrame:
262
+ """Load example table from overrepresentation analysis.
263
+
264
+ :return: Returns a pandas DataFrame
265
+
266
+ Notes
267
+ -----
268
+ To generate the table the following code was used:
269
+
270
+ .. code-block:: python
271
+
272
+ import dotools_py as do
273
+
274
+ adata = do.dt.example_10x_processed()
275
+ do.tl.rank_genes_groups(adata, 'condition')
276
+ table = do.get.dge_results(adata)
277
+ table = table[table.group == 'disease']
278
+ table_go = do.tl.go_analysis(table, 'GeneName', 'padj', 'log2fc', specie='Human', go_catgs = ['GO_Molecular_Function_2023', 'GO_Cellular_Component_2023', 'GO_Biological_Process_2023'])
279
+
280
+ Example
281
+ -------
282
+ >>> import dotools_py as do
283
+ >>> df = do.dt.example_ora()
284
+ >>> print(f'Shape: {df.shape}', df.head())
285
+ Shape: (2704, 11)
286
+ Gene_set ... state
287
+ 0 GO_Molecular_Function_2023 ... enriched
288
+ 1 GO_Molecular_Function_2023 ... enriched
289
+ 2 GO_Molecular_Function_2023 ... enriched
290
+ 3 GO_Molecular_Function_2023 ... enriched
291
+ 4 GO_Molecular_Function_2023 ... enriched
292
+ [5 rows x 11 columns]
293
+
294
+ """
295
+
296
+ return pd.read_parquet(HERE / "TableGO_Example.parquet")