stlearn 1.2.2__tar.gz → 1.4.0__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 (232) hide show
  1. {stlearn-1.2.2 → stlearn-1.4.0}/CONTRIBUTING.rst +5 -10
  2. {stlearn-1.2.2 → stlearn-1.4.0}/HISTORY.rst +22 -0
  3. {stlearn-1.2.2 → stlearn-1.4.0}/LICENSE +1 -1
  4. {stlearn-1.2.2 → stlearn-1.4.0}/PKG-INFO +29 -21
  5. {stlearn-1.2.2 → stlearn-1.4.0}/docs/api.rst +13 -13
  6. {stlearn-1.2.2 → stlearn-1.4.0}/docs/conf.py +2 -2
  7. {stlearn-1.2.2 → stlearn-1.4.0}/docs/index.rst +4 -0
  8. {stlearn-1.2.2 → stlearn-1.4.0}/docs/references.rst +1 -5
  9. stlearn-1.4.0/docs/release_notes/1.3.0.rst +10 -0
  10. stlearn-1.4.0/docs/release_notes/1.4.0.rst +14 -0
  11. {stlearn-1.2.2 → stlearn-1.4.0}/docs/release_notes/index.rst +4 -0
  12. stlearn-1.4.0/pyproject.toml +131 -0
  13. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/__init__.py +20 -20
  14. stlearn-1.4.0/stlearn/_compat.py +16 -0
  15. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/_datasets/_datasets.py +4 -4
  16. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/_settings.py +10 -12
  17. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/add.py +15 -11
  18. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/adds/add_mask.py +27 -35
  19. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/adds/annotation.py +1 -1
  20. stlearn-1.2.2/stlearn/adds/add_image.py → stlearn-1.4.0/stlearn/adds/image.py +5 -9
  21. stlearn-1.4.0/stlearn/adds/polygon_annotations.py +57 -0
  22. stlearn-1.4.0/stlearn/adds/row_annotations.py +128 -0
  23. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/embedding/pca.py +1 -1
  24. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/embedding/umap.py +1 -1
  25. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/image_preprocessing/feature_extractor.py +1 -1
  26. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/image_preprocessing/image_tiling.py +6 -6
  27. stlearn-1.4.0/stlearn/image_preprocessing/model_zoo.py +119 -0
  28. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/logging.py +10 -10
  29. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/pl/__init__.py +5 -7
  30. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/pl/_docs.py +1 -1
  31. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/pl/cci_plot.py +7 -7
  32. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/pl/cci_plot_helpers.py +48 -24
  33. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/pl/classes.py +6 -5
  34. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/pl/classes_bokeh.py +10 -12
  35. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/pl/cluster_plot.py +1 -1
  36. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/pl/deconvolution_plot.py +3 -3
  37. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/pl/mask_plot.py +3 -3
  38. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/pl/non_spatial_plot.py +2 -2
  39. stlearn-1.2.2/stlearn/pl/QC_plot.py → stlearn-1.4.0/stlearn/pl/qc_plot.py +2 -2
  40. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/pl/stack_3d_plot.py +4 -2
  41. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/pl/subcluster_plot.py +1 -1
  42. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/pl/trajectory/__init__.py +5 -7
  43. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/pl/trajectory/check_trajectory.py +3 -3
  44. stlearn-1.2.2/stlearn/pl/trajectory/DE_transition_plot.py → stlearn-1.4.0/stlearn/pl/trajectory/de_transition_plot.py +7 -8
  45. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/pl/trajectory/local_plot.py +2 -2
  46. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/pl/trajectory/pseudotime_plot.py +2 -2
  47. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/pl/trajectory/transition_markers_plot.py +2 -2
  48. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/pl/trajectory/tree_plot.py +39 -15
  49. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/pl/trajectory/utils.py +1 -1
  50. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/pl/utils.py +2 -4
  51. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/preprocessing/filter_cells.py +1 -1
  52. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/preprocessing/filter_genes.py +1 -1
  53. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/preprocessing/graph.py +1 -1
  54. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/preprocessing/log_scale.py +2 -2
  55. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/preprocessing/normalize.py +2 -2
  56. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/spatial/__init__.py +3 -3
  57. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/spatial/clustering/localization.py +3 -4
  58. stlearn-1.4.0/stlearn/spatial/morphology/adjust.py +157 -0
  59. stlearn-1.4.0/stlearn/spatial/sme/__init__.py +9 -0
  60. {stlearn-1.2.2/stlearn/spatial/SME → stlearn-1.4.0/stlearn/spatial/sme}/_weighting_matrix.py +2 -4
  61. {stlearn-1.2.2/stlearn/spatial/SME → stlearn-1.4.0/stlearn/spatial/sme}/pseudo_spot.py +2 -4
  62. {stlearn-1.2.2/stlearn/spatial/SME → stlearn-1.4.0/stlearn/spatial/sme}/sme_impute0.py +6 -8
  63. {stlearn-1.2.2/stlearn/spatial/SME → stlearn-1.4.0/stlearn/spatial/sme}/sme_normalize.py +3 -5
  64. stlearn-1.4.0/stlearn/spatial/smooth/disk.py +57 -0
  65. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/spatial/trajectory/__init__.py +9 -9
  66. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/spatial/trajectory/detect_transition_markers.py +37 -46
  67. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/spatial/trajectory/global_level.py +16 -16
  68. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/spatial/trajectory/local_level.py +1 -1
  69. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/spatial/trajectory/pseudotime.py +34 -19
  70. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/spatial/trajectory/pseudotimespace.py +4 -4
  71. stlearn-1.2.2/stlearn/spatial/trajectory/shortest_path_spatial_PAGA.py → stlearn-1.4.0/stlearn/spatial/trajectory/shortest_path_spatial_paga.py +2 -2
  72. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/spatial/trajectory/utils.py +9 -12
  73. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/spatial/trajectory/weight_optimization.py +4 -4
  74. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/tl/cci/__init__.py +1 -1
  75. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/tl/cci/analysis.py +28 -16
  76. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/tl/cci/base.py +2 -2
  77. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/tl/cci/base_grouping.py +1 -1
  78. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/tl/cci/go.py +1 -1
  79. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/tl/cci/het.py +89 -200
  80. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/tl/cci/het_helpers.py +20 -69
  81. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/tl/cci/perm_utils.py +35 -34
  82. stlearn-1.4.0/stlearn/tl/cci/permutation.py +271 -0
  83. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/tl/clustering/__init__.py +0 -2
  84. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/tl/clustering/leiden.py +19 -6
  85. stlearn-1.4.0/stlearn/tl/label/__init__.py +7 -0
  86. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/tl/label/label.py +6 -9
  87. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/types.py +1 -1
  88. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/utils.py +1 -1
  89. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/wrapper/concatenate_spatial_adata.py +23 -31
  90. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/wrapper/convert_scanpy.py +1 -1
  91. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/wrapper/read.py +11 -12
  92. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn.egg-info/PKG-INFO +29 -21
  93. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn.egg-info/SOURCES.txt +34 -68
  94. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn.egg-info/requires.txt +19 -17
  95. stlearn-1.4.0/tests/adds/test_row_annotations.py +59 -0
  96. stlearn-1.4.0/tests/image_processing/test_model_zoo.py +53 -0
  97. {stlearn-1.2.2/tests → stlearn-1.4.0/tests/pl}/test_cluster_plot.py +12 -13
  98. {stlearn-1.2.2/tests → stlearn-1.4.0/tests/pp}/test_extract_features.py +1 -3
  99. {stlearn-1.2.2/tests → stlearn-1.4.0/tests/pp}/test_tiling.py +4 -5
  100. stlearn-1.4.0/tests/spatial/test_psts.py +38 -0
  101. stlearn-1.4.0/tests/spatial/test_sme.py +37 -0
  102. {stlearn-1.2.2 → stlearn-1.4.0}/tests/test_data/test_data.h5 +0 -0
  103. stlearn-1.4.0/tests/test_data/v1_human_breast_cancer_block_a_section_1.csv +3799 -0
  104. stlearn-1.4.0/tests/test_data/v1_human_breast_cancer_block_a_section_1_proportions.csv +3799 -0
  105. stlearn-1.2.2/tests/test_Spatial.py → stlearn-1.4.0/tests/test_spatial.py +1 -2
  106. {stlearn-1.2.2 → stlearn-1.4.0}/tests/test_tools.py +0 -5
  107. stlearn-1.4.0/tests/tl/__init__.py +0 -0
  108. stlearn-1.2.2/tests/test_CCI.py → stlearn-1.4.0/tests/tl/test_cci.py +0 -58
  109. stlearn-1.4.0/tests/utils.py +23 -0
  110. stlearn-1.2.2/docs/interactive.rst +0 -16
  111. stlearn-1.2.2/pyproject.toml +0 -89
  112. stlearn-1.2.2/requirements.txt +0 -15
  113. stlearn-1.2.2/stlearn/__main__.py +0 -8
  114. stlearn-1.2.2/stlearn/app/app.py +0 -481
  115. stlearn-1.2.2/stlearn/app/cli.py +0 -40
  116. stlearn-1.2.2/stlearn/app/requirements.txt +0 -4
  117. stlearn-1.2.2/stlearn/app/source/forms/form_validators.py +0 -18
  118. stlearn-1.2.2/stlearn/app/source/forms/forms.py +0 -366
  119. stlearn-1.2.2/stlearn/app/source/forms/helper_functions.py +0 -64
  120. stlearn-1.2.2/stlearn/app/source/forms/utils.py +0 -31
  121. stlearn-1.2.2/stlearn/app/source/forms/view_helpers.py +0 -38
  122. stlearn-1.2.2/stlearn/app/source/forms/views.py +0 -388
  123. stlearn-1.2.2/stlearn/app/source/readme.md +0 -28
  124. stlearn-1.2.2/stlearn/app/static/css/material-dashboard.min.css +0 -14
  125. stlearn-1.2.2/stlearn/app/static/css/style.css +0 -95
  126. stlearn-1.2.2/stlearn/app/static/img/Settings.gif +0 -0
  127. stlearn-1.2.2/stlearn/app/static/img/favicon.png +0 -0
  128. stlearn-1.2.2/stlearn/app/static/img/loading_gif.gif +0 -0
  129. stlearn-1.2.2/stlearn/app/static/js/core/bootstrap-material-design.min.js +0 -1
  130. stlearn-1.2.2/stlearn/app/static/js/core/jquery.min.js +0 -3240
  131. stlearn-1.2.2/stlearn/app/static/js/core/popper.min.js +0 -834
  132. stlearn-1.2.2/stlearn/app/static/js/plugins/perfect-scrollbar.jquery.min.js +0 -2
  133. stlearn-1.2.2/stlearn/app/templates/annotate_plot.html +0 -20
  134. stlearn-1.2.2/stlearn/app/templates/base.html +0 -213
  135. stlearn-1.2.2/stlearn/app/templates/cci.html +0 -24
  136. stlearn-1.2.2/stlearn/app/templates/cci_old.html +0 -29
  137. stlearn-1.2.2/stlearn/app/templates/cci_plot.html +0 -20
  138. stlearn-1.2.2/stlearn/app/templates/choose_cluster.html +0 -37
  139. stlearn-1.2.2/stlearn/app/templates/cluster_plot.html +0 -22
  140. stlearn-1.2.2/stlearn/app/templates/clustering.html +0 -46
  141. stlearn-1.2.2/stlearn/app/templates/dea.html +0 -24
  142. stlearn-1.2.2/stlearn/app/templates/flash_header.html +0 -15
  143. stlearn-1.2.2/stlearn/app/templates/gene_plot.html +0 -23
  144. stlearn-1.2.2/stlearn/app/templates/index.html +0 -79
  145. stlearn-1.2.2/stlearn/app/templates/lr.html +0 -24
  146. stlearn-1.2.2/stlearn/app/templates/lr_plot.html +0 -20
  147. stlearn-1.2.2/stlearn/app/templates/preprocessing.html +0 -24
  148. stlearn-1.2.2/stlearn/app/templates/progress.html +0 -19
  149. stlearn-1.2.2/stlearn/app/templates/psts.html +0 -28
  150. stlearn-1.2.2/stlearn/app/templates/spatial_cci_plot.html +0 -20
  151. stlearn-1.2.2/stlearn/app/templates/superform.html +0 -76
  152. stlearn-1.2.2/stlearn/app/templates/upload.html +0 -80
  153. stlearn-1.2.2/stlearn/image_preprocessing/model_zoo.py +0 -54
  154. stlearn-1.2.2/stlearn/pl/trajectory/tree_plot_simple.py +0 -212
  155. stlearn-1.2.2/stlearn/spatial/SME/__init__.py +0 -9
  156. stlearn-1.2.2/stlearn/spatial/morphology/adjust.py +0 -142
  157. stlearn-1.2.2/stlearn/spatial/smooth/disk.py +0 -54
  158. stlearn-1.2.2/stlearn/tl/cci/permutation.py +0 -671
  159. stlearn-1.2.2/stlearn/tl/clustering/louvain.py +0 -109
  160. stlearn-1.2.2/stlearn/tl/label/__init__.py +0 -7
  161. stlearn-1.2.2/tests/test_PSTS.py +0 -40
  162. stlearn-1.2.2/tests/test_SME.py +0 -29
  163. stlearn-1.2.2/tests/utils.py +0 -17
  164. {stlearn-1.2.2 → stlearn-1.4.0}/AUTHORS.rst +0 -0
  165. {stlearn-1.2.2 → stlearn-1.4.0}/MANIFEST.in +0 -0
  166. {stlearn-1.2.2 → stlearn-1.4.0}/README.md +0 -0
  167. {stlearn-1.2.2 → stlearn-1.4.0}/docs/Makefile +0 -0
  168. {stlearn-1.2.2 → stlearn-1.4.0}/docs/_static/images/any.png +0 -0
  169. {stlearn-1.2.2 → stlearn-1.4.0}/docs/_static/images/scanpy.png +0 -0
  170. {stlearn-1.2.2 → stlearn-1.4.0}/docs/authors.rst +0 -0
  171. {stlearn-1.2.2 → stlearn-1.4.0}/docs/images/logo.png +0 -0
  172. {stlearn-1.2.2 → stlearn-1.4.0}/docs/installation.rst +0 -0
  173. {stlearn-1.2.2 → stlearn-1.4.0}/docs/make.bat +0 -0
  174. {stlearn-1.2.2 → stlearn-1.4.0}/docs/release_notes/0.3.2.rst +0 -0
  175. {stlearn-1.2.2 → stlearn-1.4.0}/docs/release_notes/0.4.6.rst +0 -0
  176. {stlearn-1.2.2 → stlearn-1.4.0}/docs/release_notes/1.1.1.rst +0 -0
  177. {stlearn-1.2.2 → stlearn-1.4.0}/docs/release_notes/1.1.5.rst +0 -0
  178. {stlearn-1.2.2 → stlearn-1.4.0}/docs/release_notes/1.2.2.rst +0 -0
  179. {stlearn-1.2.2 → stlearn-1.4.0}/docs/tutorials.rst +0 -0
  180. {stlearn-1.2.2 → stlearn-1.4.0}/setup.cfg +0 -0
  181. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/_datasets/__init__.py +0 -0
  182. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/adds/__init__.py +0 -0
  183. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/adds/add_deconvolution.py +0 -0
  184. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/adds/add_loupe_clusters.py +0 -0
  185. stlearn-1.2.2/stlearn/adds/add_labels.py → stlearn-1.4.0/stlearn/adds/labels.py +0 -0
  186. stlearn-1.2.2/stlearn/adds/add_lr.py → stlearn-1.4.0/stlearn/adds/lr.py +0 -0
  187. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/adds/parsing.py +0 -0
  188. stlearn-1.2.2/stlearn/adds/add_positions.py → stlearn-1.4.0/stlearn/adds/positions.py +0 -0
  189. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/classes.py +0 -0
  190. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/datasets.py +0 -0
  191. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/em.py +3 -3
  192. {stlearn-1.2.2/stlearn/app → stlearn-1.4.0/stlearn/embedding}/__init__.py +0 -0
  193. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/embedding/diffmap.py +0 -0
  194. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/embedding/fa.py +0 -0
  195. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/embedding/ica.py +0 -0
  196. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/gui.py +0 -0
  197. {stlearn-1.2.2/stlearn/app/source → stlearn-1.4.0/stlearn/image_preprocessing}/__init__.py +0 -0
  198. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/pl/feat_plot.py +0 -0
  199. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/pl/gene_plot.py +0 -0
  200. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/pl/palettes_st.py +0 -0
  201. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/pp.py +3 -3
  202. {stlearn-1.2.2/stlearn/app/source/forms → stlearn-1.4.0/stlearn/preprocessing}/__init__.py +0 -0
  203. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/spatial/clustering/__init__.py +0 -0
  204. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/spatial/morphology/__init__.py +0 -0
  205. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/spatial/smooth/__init__.py +0 -0
  206. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/spatial/trajectory/compare_transitions.py +0 -0
  207. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/spatial/trajectory/set_root.py +0 -0
  208. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/tl/__init__.py +1 -1
  209. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/tl/cache/__init__.py +1 -1
  210. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/tl/cache/anndata.py +0 -0
  211. {stlearn-1.2.2/stlearn/app/templates → stlearn-1.4.0/stlearn/tl/cci/databases}/__init__.py +0 -0
  212. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/tl/cci/databases/connectomeDB2020_lit.txt +0 -0
  213. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/tl/cci/databases/connectomeDB2020_put.txt +0 -0
  214. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/tl/cci/go.R +0 -0
  215. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/tl/cci/merge.py +0 -0
  216. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/tl/cci/r_helpers.py +0 -0
  217. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/tl/clustering/annotate.py +0 -0
  218. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/tl/clustering/kmeans.py +0 -0
  219. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/tl/label/label_transfer.R +0 -0
  220. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/tl/label/rctd.R +0 -0
  221. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/tl/label/singleR.R +0 -0
  222. {stlearn-1.2.2/stlearn/embedding → stlearn-1.4.0/stlearn/wrapper}/__init__.py +0 -0
  223. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn/wrapper/xenium_alignment.py +0 -0
  224. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn.egg-info/dependency_links.txt +0 -0
  225. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn.egg-info/entry_points.txt +0 -0
  226. {stlearn-1.2.2 → stlearn-1.4.0}/stlearn.egg-info/top_level.txt +0 -0
  227. {stlearn-1.2.2 → stlearn-1.4.0}/tests/__init__.py +0 -0
  228. {stlearn-1.2.2/stlearn/image_preprocessing → stlearn-1.4.0/tests/adds}/__init__.py +0 -0
  229. {stlearn-1.2.2/stlearn/preprocessing → stlearn-1.4.0/tests/pl}/__init__.py +0 -0
  230. {stlearn-1.2.2/stlearn/tl/cci/databases → stlearn-1.4.0/tests/pp}/__init__.py +0 -0
  231. {stlearn-1.2.2/stlearn/wrapper → stlearn-1.4.0/tests/spatial}/__init__.py +0 -0
  232. {stlearn-1.2.2 → stlearn-1.4.0}/tests/test_data/test_image.jpg +0 -0
@@ -15,7 +15,7 @@ Types of Contributions
15
15
  Report Bugs
16
16
  ~~~~~~~~~~~
17
17
 
18
- Report bugs at https://github.com/duypham2108/stlearn/issues.
18
+ Report bugs at https://github.com/BiomedicalMachineLearning/stLearn/issues
19
19
 
20
20
  If you are reporting a bug, please include:
21
21
 
@@ -70,20 +70,17 @@ Ready to contribute? Here's how to set up `stlearn` for local development.
70
70
  $ conda create -n stlearn-dev python=3.12 --y
71
71
  $ conda activate stlearn-dev
72
72
  $ cd stlearn/
73
- $ pip install -e .[dev,test]
74
-
75
- If you get an error for louvain package on MacOS, make sure you have cmake installed first (if you have brew):
76
- $ brew install cmake
73
+ $ pip install -e ".[dev,test]"
77
74
 
78
75
  You can also use conda to install these dependencies (after creating the environment):
79
- $ conda install -c conda-forge louvain leidenalg python-igraph
76
+ $ conda install -c conda-forge leidenalg python-igraph
80
77
 
81
78
  Or if you prefer pip/virtualenv::
82
79
 
83
80
  $ python -m venv stlearn-env
84
81
  $ source stlearn-env/bin/activate # On Windows: stlearn-env\Scripts\activate
85
82
  $ cd stlearn/
86
- $ pip install -e .[dev,test]
83
+ $ pip install -e ".[dev,test]"
87
84
 
88
85
  4. Create a branch for local development::
89
86
 
@@ -119,9 +116,7 @@ Before you submit a pull request, check that it meets these guidelines:
119
116
  2. If the pull request adds functionality, the docs should be updated. Put
120
117
  your new functionality into a function with a docstring, and add the
121
118
  feature to the list in README.rst.
122
- 3. The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy. Check
123
- https://travis-ci.org/duypham2108/stlearn/pull_requests
124
- and make sure that the tests pass for all supported Python versions.
119
+ 3. The pull request should work for Python 3.12 and above.
125
120
 
126
121
  Tips
127
122
  ----
@@ -2,6 +2,27 @@
2
2
  History
3
3
  =======
4
4
 
5
+ 1.4.0 (2026-05-01)
6
+ ------------------
7
+ * Removed tensorflow and keras and replaced with torch and torchvision.
8
+ * The CCI implementation removed string comparisons for LR pairs lists and replaced it with one set of two
9
+ packed 32 bit integers. Removed deduplication pass (m^2) with a hash lookup (O(n)).
10
+ * Upgrade libraries: numpy >=2.4.0, scanpy >= 1.12.0, scipy >= 1.17.0, added spatialdata, shapely, geopandas.
11
+
12
+ API and Bug Fixes:
13
+ * Added row and polygon annotations.
14
+ * Fixed exception handling to catch previous exceptions when rethrown.
15
+
16
+ 1.3.0 (2026-02-24)
17
+ ------------------
18
+ * Removed interactive stLearn/embedded web application.
19
+ * Removed louvain clustering - replaced with leiden.
20
+
21
+ API and Bug Fixes:
22
+ * Fix import on MutableVertexPartition to use leidenalg.VertexPartition.
23
+ * Switch default flavour in leiden to use igraph (and its required parameters).
24
+ * Renamed methods and classes to follow lowercase standard.
25
+
5
26
  1.2.2 (2025-10-20)
6
27
  ------------------
7
28
  * Added support for Python 3.11 and 3.12.
@@ -25,6 +46,7 @@ API and Bug Fixes:
25
46
  * datasets.xenium_sge - loads Xenium data (and caches it) similar to scanpy.visium_sge.
26
47
 
27
48
  API and Bug Fixes:
49
+
28
50
  * Xenium TIFF and cell positions are now aligned.
29
51
  * Consistent with type annotations - mainly missing None annotations.
30
52
  * pl.cluster_plot - Does not keep colours from previous runs when clustering.
@@ -1,6 +1,6 @@
1
1
  BSD License
2
2
 
3
- Copyright (c) 2020-2025, Genomics and Machine Learning lab
3
+ Copyright (c) 2020-2026, Genomics and Machine Learning lab
4
4
  All rights reserved.
5
5
 
6
6
  Redistribution and use in source and binary forms, with or without modification,
@@ -1,38 +1,51 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stlearn
3
- Version: 1.2.2
3
+ Version: 1.4.0
4
4
  Summary: A downstream analysis toolkit for Spatial Transcriptomic data
5
- Author-email: Genomics and Machine Learning lab <andrew.newman@uq.edu.au>
5
+ Author-email: Genomics and Machine Learning Lab <andrew.newman@uq.edu.au>
6
6
  License: BSD license
7
7
  Project-URL: Homepage, https://github.com/BiomedicalMachineLearning/stLearn
8
8
  Project-URL: Repository, https://github.com/BiomedicalMachineLearning/stLearn
9
9
  Keywords: stlearn
10
10
  Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Environment :: Console
12
+ Classifier: Framework :: Jupyter
11
13
  Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Science/Research
12
15
  Classifier: License :: OSI Approved :: BSD License
13
16
  Classifier: Natural Language :: English
14
- Classifier: Programming Language :: Python :: 3.10
15
- Classifier: Programming Language :: Python :: 3.11
16
17
  Classifier: Programming Language :: Python :: 3.12
17
- Requires-Python: <3.13,>=3.10
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
21
+ Classifier: Topic :: Scientific/Engineering :: Visualization
22
+ Requires-Python: >=3.12
18
23
  Description-Content-Type: text/markdown
19
24
  License-File: LICENSE
20
25
  License-File: AUTHORS.rst
26
+ Requires-Dist: anndata>=0.12.0
21
27
  Requires-Dist: bokeh<4.0,>=3.7.0
22
28
  Requires-Dist: click<9.0,>=8.2.0
23
- Requires-Dist: leidenalg<0.11,>=0.10.0
24
- Requires-Dist: louvain>=0.8.2
29
+ Requires-Dist: igraph>=1.0.0
30
+ Requires-Dist: leidenalg>=0.11.0
25
31
  Requires-Dist: numba>=0.58.1
26
- Requires-Dist: numpy<2.0,>=1.26.0
32
+ Requires-Dist: numpy>=2.4.0
27
33
  Requires-Dist: pillow<12.0,>=11.0.0
28
- Requires-Dist: scanpy<2.0,>=1.11.0
29
- Requires-Dist: scikit-image<0.23,>=0.22.0
30
- Requires-Dist: tensorflow>=2.14.1
31
- Requires-Dist: keras>=2.14.0
34
+ Requires-Dist: scanpy>=1.12.0
35
+ Requires-Dist: scikit-image>=0.22.0
32
36
  Requires-Dist: pandas>=2.3.0
33
37
  Requires-Dist: imageio<3.0,>=2.37.0
34
- Requires-Dist: scipy<2.0,>=1.11.0
35
- Requires-Dist: scikit-learn<2.0,>=1.7.0
38
+ Requires-Dist: scipy<2.0,>=1.17.0
39
+ Requires-Dist: scikit-learn<2.0,>=1.8.0
40
+ Requires-Dist: zarr>=3.1
41
+ Requires-Dist: dask>=2024.11.2
42
+ Requires-Dist: spatialdata>=0.7.0
43
+ Requires-Dist: spatialdata-io>=0.6.0
44
+ Requires-Dist: spatialdata-plot>=0.3.0
45
+ Requires-Dist: torch>=2.0
46
+ Requires-Dist: torchvision>=0.15
47
+ Requires-Dist: geopandas<2.0,>=1.0.0
48
+ Requires-Dist: shapely<3.0,>=2.0.0
36
49
  Provides-Extra: dev
37
50
  Requires-Dist: black>=23.0; extra == "dev"
38
51
  Requires-Dist: ruff>=0.1.0; extra == "dev"
@@ -50,17 +63,12 @@ Requires-Dist: sphinx-autosummary-accessors>=2023.4.0; extra == "dev"
50
63
  Provides-Extra: test
51
64
  Requires-Dist: pytest; extra == "test"
52
65
  Requires-Dist: pytest-cov; extra == "test"
53
- Provides-Extra: webapp
54
- Requires-Dist: flask>=2.0.0; extra == "webapp"
55
- Requires-Dist: flask-wtf>=1.0.0; extra == "webapp"
56
- Requires-Dist: wtforms>=3.0.0; extra == "webapp"
57
- Requires-Dist: markupsafe>2.1.0; extra == "webapp"
58
66
  Provides-Extra: jupyter
59
67
  Requires-Dist: jupyter>=1.0.0; extra == "jupyter"
60
68
  Requires-Dist: jupyterlab>=3.0.0; extra == "jupyter"
61
- Requires-Dist: ipywidgets>=7.6.0; extra == "jupyter"
69
+ Requires-Dist: ipywidgets>=8.0.0; extra == "jupyter"
62
70
  Requires-Dist: plotly>=5.0.0; extra == "jupyter"
63
- Requires-Dist: bokeh>=2.4.0; extra == "jupyter"
71
+ Requires-Dist: bokeh<4.0,>=3.7.0; extra == "jupyter"
64
72
  Requires-Dist: rpy2>=3.4.0; extra == "jupyter"
65
73
  Dynamic: license-file
66
74
 
@@ -18,13 +18,14 @@ Wrapper functions: `wrapper`
18
18
  .. autosummary::
19
19
  :toctree: api/
20
20
 
21
- Read10X
22
- ReadOldST
23
- ReadSlideSeq
24
- ReadMERFISH
25
- ReadSeqFish
26
- convert_scanpy
21
+ read_10x
22
+ read_old_st
23
+ read_slide_seq
24
+ read_merfish
25
+ read_seq_fish
26
+ read_xenium
27
27
  create_stlearn
28
+ convert_scanpy
28
29
 
29
30
 
30
31
  Add: `add`
@@ -115,15 +116,15 @@ Spatial: `spatial`
115
116
 
116
117
  spatial.morphology.adjust
117
118
 
118
- .. module:: stlearn.spatial.SME
119
+ .. module:: stlearn.spatial.sme
119
120
  .. currentmodule:: stlearn
120
121
 
121
122
  .. autosummary::
122
123
  :toctree: api/
123
124
 
124
- spatial.SME.SME_impute0
125
- spatial.SME.pseudo_spot
126
- spatial.SME.SME_normalize
125
+ spatial.sme.sme_impute0
126
+ spatial.sme.pseudo_spot
127
+ spatial.sme.sme_normalize
127
128
 
128
129
  Tools: `tl`
129
130
  -------------------
@@ -135,7 +136,6 @@ Tools: `tl`
135
136
 
136
137
  tl.clustering.kmeans
137
138
  tl.clustering.leiden
138
- tl.clustering.louvain
139
139
  tl.cci.load_lrs
140
140
  tl.cci.grid
141
141
  tl.cci.run
@@ -151,7 +151,7 @@ Plot: `pl`
151
151
  .. autosummary::
152
152
  :toctree: api/
153
153
 
154
- pl.QC_plot
154
+ pl.qc_plot
155
155
  pl.gene_plot
156
156
  pl.gene_plot_interactive
157
157
  pl.cluster_plot
@@ -183,7 +183,7 @@ Plot: `pl`
183
183
  pl.trajectory.local_plot
184
184
  pl.trajectory.tree_plot
185
185
  pl.trajectory.transition_markers_plot
186
- pl.trajectory.DE_transition_plot
186
+ pl.trajectory.de_transition_plot
187
187
 
188
188
  Datasets: `datasets`
189
189
  ---------------------------
@@ -34,7 +34,7 @@ def download_gdrive_file(file_id, filename):
34
34
  # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
35
35
 
36
36
  project = 'stLearn'
37
- copyright = '2022-2025, Genomics and Machine Learning Lab'
37
+ copyright = '2022-2026, Genomics and Machine Learning Lab'
38
38
  author = 'Genomics and Machine Learning Lab'
39
39
  html_logo = "images/logo.png"
40
40
 
@@ -56,7 +56,7 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
56
56
  # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
57
57
  def setup(app):
58
58
  if not os.path.isdir("./tutorials"):
59
- download_gdrive_file("1FNMzO4-KsHK8tPd8k5-sTiRS40S97Qs4", "tutorials.zip")
59
+ download_gdrive_file("1DZ57n1S9_LYTyG10F6VXmo5lQ58wxvOC", "tutorials.zip")
60
60
  os.system("unzip tutorials.zip")
61
61
  return
62
62
 
@@ -38,6 +38,10 @@ undissociated tissue sample.
38
38
  Latest Additions
39
39
  ----------------
40
40
 
41
+ .. include:: release_notes/1.4.0.rst
42
+
43
+ .. include:: release_notes/1.3.0.rst
44
+
41
45
  .. include:: release_notes/1.2.2.rst
42
46
 
43
47
  .. include:: release_notes/1.1.5.rst
@@ -24,7 +24,7 @@ References
24
24
  *UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction*,
25
25
  `arXiv <https://arxiv.org/abs/1802.03426>`__.
26
26
 
27
- .. [Weinreb16] Weinreb *et al.* (2016),
27
+ .. [Weinreb17] Weinreb *et al.* (2017),
28
28
  *SPRING: a kinetic interface for visualizing high dimensional single-cell expression data*,
29
29
  `bioRxiv <https://doi.org/10.1101/090332>`__.
30
30
 
@@ -36,10 +36,6 @@ References
36
36
  *Massively parallel digital transcriptional profiling of single cells*,
37
37
  `Nature Communications <https://doi.org/10.1038/ncomms14049>`__.
38
38
 
39
- .. [Weinreb17] Weinreb *et al.* (2016),
40
- *SPRING: a kinetic interface for visualizing high dimensional single-cell expression data*,
41
- `bioRxiv <https://doi.org/10.1101/090332>`__.
42
-
43
39
  .. [Blondel08] Blondel *et al.* (2008),
44
40
  *Fast unfolding of communities in large networks*,
45
41
  `J. Stat. Mech. <https://doi.org/10.1088/1742-5468/2008/10/P10008>`__.
@@ -0,0 +1,10 @@
1
+ 1.3.0 `2026-02-24`
2
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
3
+
4
+ .. rubric:: Features
5
+
6
+ * Removed interactive stLearn/embedded web application.
7
+ * Removed louvain clustering.
8
+ * Renamed methods and classes to follow lowercase standard.
9
+
10
+
@@ -0,0 +1,14 @@
1
+ 1.4.0 `2026-05-01`
2
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
3
+
4
+ .. rubric:: Features
5
+
6
+ * Removed tensorflow and keras and replaced with torch and torchvision.
7
+ * The CCI implementation removed string comparisons for LR pairs lists and replaced it with one set of two
8
+ packed 32 bit integers. Removed deduplication pass (m^2) with a hash lookup (O(n)).
9
+ * Added row and polygon annotations.
10
+ * Upgrade libraries: numpy >=2.4.0, scanpy >= 1.12.0, scipy >= 1.17.0, added spatialdata, shapely, geopandas.
11
+
12
+ .. rubric:: Bugs
13
+
14
+ * Fixed exception handling to catch previous exceptions when rethrown.
@@ -1,6 +1,10 @@
1
1
  Release Notes
2
2
  ===================================================
3
3
 
4
+ .. include:: 1.4.0.rst
5
+
6
+ .. include:: 1.3.0.rst
7
+
4
8
  .. include:: 1.2.2.rst
5
9
 
6
10
  .. include:: 1.1.5.rst
@@ -0,0 +1,131 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "stlearn"
7
+ version = "1.4.0"
8
+ authors = [
9
+ { name = "Genomics and Machine Learning Lab", email = "andrew.newman@uq.edu.au" },
10
+ ]
11
+ description = "A downstream analysis toolkit for Spatial Transcriptomic data"
12
+ readme = { file = "README.md", content-type = "text/markdown" }
13
+ license = { text = "BSD license" }
14
+ requires-python = ">=3.12"
15
+ dependencies = [
16
+ "anndata>=0.12.0",
17
+ "bokeh>=3.7.0,<4.0",
18
+ "click>=8.2.0,<9.0",
19
+ "igraph>=1.0.0",
20
+ "leidenalg>=0.11.0",
21
+ "numba>=0.58.1",
22
+ "numpy>=2.4.0",
23
+ "pillow>=11.0.0,<12.0",
24
+ "scanpy>=1.12.0",
25
+ "scikit-image>=0.22.0",
26
+ "pandas>=2.3.0",
27
+ "imageio>=2.37.0,<3.0",
28
+ "scipy>=1.17.0,<2.0",
29
+ "scikit-learn>=1.8.0,<2.0",
30
+ "zarr>=3.1",
31
+ "dask>=2024.11.2",
32
+ "spatialdata>=0.7.0",
33
+ "spatialdata-io>=0.6.0",
34
+ "spatialdata-plot>=0.3.0",
35
+ "torch>=2.0",
36
+ "torchvision>=0.15",
37
+ "geopandas>=1.0.0,<2.0",
38
+ "shapely>=2.0.0,<3.0",
39
+ ]
40
+ keywords = ["stlearn"]
41
+ classifiers = [
42
+ "Development Status :: 5 - Production/Stable",
43
+ "Environment :: Console",
44
+ "Framework :: Jupyter",
45
+ "Intended Audience :: Developers",
46
+ "Intended Audience :: Science/Research",
47
+ "License :: OSI Approved :: BSD License",
48
+ "Natural Language :: English",
49
+ "Programming Language :: Python :: 3.12",
50
+ "Programming Language :: Python :: 3.13",
51
+ "Programming Language :: Python :: 3.14",
52
+ "Topic :: Scientific/Engineering :: Bio-Informatics",
53
+ "Topic :: Scientific/Engineering :: Visualization",
54
+ ]
55
+ [project.optional-dependencies]
56
+ dev = [
57
+ "black>=23.0",
58
+ "ruff>=0.1.0",
59
+ "mypy>=1.16",
60
+ "pytest>=7.0",
61
+ "tox>=4.0",
62
+ "ghp-import>=2.1.0",
63
+ "sphinx>=4.0",
64
+ "furo==2024.8.6",
65
+ "myst-parser>=0.18",
66
+ "nbsphinx>=0.9.0",
67
+ "types-tensorflow>=2.8.0",
68
+ "sphinx-autodoc-typehints>=1.24.0",
69
+ "sphinx-autosummary-accessors>=2023.4.0",
70
+ ]
71
+ test = [
72
+ "pytest",
73
+ "pytest-cov",
74
+ ]
75
+ jupyter = [
76
+ "jupyter>=1.0.0",
77
+ "jupyterlab>=3.0.0",
78
+ "ipywidgets>=8.0.0",
79
+ "plotly>=5.0.0",
80
+ "bokeh>=3.7.0,<4.0",
81
+ "rpy2>=3.4.0",
82
+ ]
83
+
84
+ [project.urls]
85
+ Homepage = "https://github.com/BiomedicalMachineLearning/stLearn"
86
+ Repository = "https://github.com/BiomedicalMachineLearning/stLearn"
87
+
88
+ [project.scripts]
89
+ stlearn = "stlearn.app.cli:main"
90
+
91
+ [tool.setuptools.packages.find]
92
+ include = ["stlearn", "stlearn.*"]
93
+
94
+ [tool.setuptools.package-data]
95
+ "*" = ["*"]
96
+
97
+ [tool.ruff]
98
+ target-version = "py312"
99
+ line-length = 88
100
+ exclude = [".git", "__pycache__", "build", "dist", "docs/_build"]
101
+
102
+ [tool.ruff.lint]
103
+ select = [
104
+ "E", "F", "W", # pycodestyle + pyflakes
105
+ "I", # isort
106
+ "N", # pep8-naming
107
+ "UP", # pyupgrade
108
+ "NPY", # numpy-specific (NPY001, NPY002, NPY003, NPY201)
109
+ "PD", # pandas-vet
110
+ "B", # flake8-bugbear (catches real bugs)
111
+ "SIM", # flake8-simplify
112
+ "RUF", # ruff-specific rules
113
+ ]
114
+ ignore = [
115
+ "E722", # bare except — you've already accepted these
116
+ "F811", # redefinition — accepted
117
+ "N803", "N806", # naming: lowercase args/vars — too invasive to fix
118
+ "N818", # exception naming
119
+ "PD011", # .values vs .to_numpy() — too noisy, mostly false positives
120
+ "B008", # function calls in default args — used by typer/click
121
+ "SIM108", # ternary suggestions can hurt readability
122
+ ]
123
+
124
+ [tool.ruff.lint.per-file-ignores]
125
+ "tests/*" = ["B", "N"] # tests can be loose
126
+ "docs/conf.py" = ["E", "F", "UP"] # generated/config file
127
+ "**/__init__.py" = ["F401"] # re-exports
128
+
129
+ [tool.ruff.format]
130
+ quote-style = "double"
131
+ indent-style = "space"
@@ -2,7 +2,7 @@
2
2
 
3
3
  __author__ = """Genomics and Machine Learning Lab"""
4
4
  __email__ = "andrew.newman@uq.edu.au"
5
- __version__ = "1.1.1"
5
+ __version__ = "1.4.0"
6
6
 
7
7
  from . import add, datasets, em, pl, pp, spatial, tl, types
8
8
  from ._settings import settings
@@ -11,33 +11,33 @@ from .wrapper.convert_scanpy import convert_scanpy
11
11
 
12
12
  # Wrapper
13
13
  from .wrapper.read import (
14
- Read10X,
15
- ReadMERFISH,
16
- ReadOldST,
17
- ReadSeqFish,
18
- ReadSlideSeq,
19
- ReadXenium,
20
14
  create_stlearn,
15
+ read_10x,
16
+ read_merfish,
17
+ read_old_st,
18
+ read_seq_fish,
19
+ read_slide_seq,
20
+ read_xenium,
21
21
  )
22
22
 
23
23
  # from . import cli
24
24
  __all__ = [
25
25
  "add",
26
- "pp",
26
+ "concatenate_spatial_adata",
27
+ "convert_scanpy",
28
+ "create_stlearn",
29
+ "datasets",
27
30
  "em",
28
- "tl",
29
31
  "pl",
30
- "spatial",
31
- "datasets",
32
- "ReadSlideSeq",
33
- "Read10X",
34
- "ReadOldST",
35
- "ReadMERFISH",
36
- "ReadSeqFish",
37
- "ReadXenium",
38
- "create_stlearn",
32
+ "pp",
33
+ "read_10x",
34
+ "read_merfish",
35
+ "read_old_st",
36
+ "read_seq_fish",
37
+ "read_slide_seq",
38
+ "read_xenium",
39
39
  "settings",
40
+ "spatial",
41
+ "tl",
40
42
  "types",
41
- "convert_scanpy",
42
- "concatenate_spatial_adata",
43
43
  ]
@@ -0,0 +1,16 @@
1
+ import spatialdata as sd
2
+ from anndata import AnnData
3
+
4
+
5
+ def get_adata(data, table_key="table"):
6
+ """Extract AnnData from either SpatialData or AnnData input."""
7
+ if isinstance(data, sd.SpatialData):
8
+ return data.tables[table_key]
9
+ elif isinstance(data, AnnData):
10
+ return data
11
+ else:
12
+ raise TypeError(f"Expected SpatialData or AnnData, got {type(data)}")
13
+
14
+
15
+ def is_spatial_data(data):
16
+ return isinstance(data, sd.SpatialData)
@@ -12,7 +12,7 @@ def visium_sge(
12
12
  *,
13
13
  include_hires_tiff: bool = False,
14
14
  ) -> AnnData:
15
- """Processed Visium Spatial Gene Expression data from 10x Genomics’ database.
15
+ """Processed Visium Spatial Gene Expression data from 10x Genomics' database.
16
16
 
17
17
  The database_ can be browsed online to find the ``sample_id`` you want.
18
18
 
@@ -21,7 +21,7 @@ def visium_sge(
21
21
  Parameters
22
22
  ----------
23
23
  sample_id
24
- The ID of the data sample in 10x’s spatial database.
24
+ The ID of the data sample in 10x's spatial database.
25
25
  include_hires_tiff
26
26
  Download and include the high-resolution tissue image (tiff) in
27
27
  `adata.uns["spatial"][sample_id]["metadata"]["source_image_path"]`.
@@ -85,5 +85,5 @@ def xenium_sge(
85
85
  for zip_filename in files_to_extract:
86
86
  with open(library_dir / zip_filename, "wb") as file_name:
87
87
  file_name.write(zip_ref.read(f"outs/{zip_filename}"))
88
- except zf.BadZipFile:
89
- raise ValueError(f"Invalid zip file: {library_dir / zip_filename}")
88
+ except zf.BadZipFile as b:
89
+ raise ValueError(f"Invalid zip file: {library_dir / zip_filename}") from b
@@ -1,3 +1,4 @@
1
+ import builtins
1
2
  import inspect
2
3
  import sys
3
4
  from collections.abc import Iterable, Iterator
@@ -56,7 +57,8 @@ def _type_check(var: Any, varname: str, types: type | tuple[type, ...]):
56
57
  else:
57
58
  type_names = [t.__name__ for t in types]
58
59
  possible_types_str = "{} or {}".format(
59
- ", ".join(type_names[:-1]), type_names[-1]
60
+ ", ".join(type_names[:-1]),
61
+ type_names[-1],
60
62
  )
61
63
  raise TypeError(f"{varname} must be of type {possible_types_str}")
62
64
 
@@ -155,7 +157,7 @@ class stLearnConfig: # noqa N801
155
157
  if verbosity not in verbosity_str_options:
156
158
  raise ValueError(
157
159
  f"Cannot set verbosity to {verbosity}. "
158
- f"Accepted string values are: {verbosity_str_options}"
160
+ f"Accepted string values are: {verbosity_str_options}",
159
161
  )
160
162
  else:
161
163
  new_verbosity = Verbosity(verbosity_str_options.index(verbosity))
@@ -188,7 +190,7 @@ class stLearnConfig: # noqa N801
188
190
  if file_format not in file_format_options:
189
191
  raise ValueError(
190
192
  f"Cannot set file_format_data to {file_format}. "
191
- f"Must be one of {file_format_options}"
193
+ f"Must be one of {file_format_options}",
192
194
  )
193
195
  self._file_format_data = file_format
194
196
 
@@ -297,7 +299,7 @@ class stLearnConfig: # noqa N801
297
299
  if cache_compression not in {"lzf", "gzip", None}:
298
300
  raise ValueError(
299
301
  f"`cache_compression` ({cache_compression}) "
300
- "must be in {'lzf', 'gzip', None}"
302
+ "must be in {'lzf', 'gzip', None}",
301
303
  )
302
304
  self._cache_compression = cache_compression
303
305
 
@@ -341,7 +343,7 @@ class stLearnConfig: # noqa N801
341
343
  else:
342
344
  _type_check(logpath, "logpath", (str, Path))
343
345
  # set via “file object” branch of logfile.setter
344
- self.logfile = Path(logpath).open("a")
346
+ self.logfile = Path(logpath).open("a") # noqa: SIM115
345
347
  self._logpath = Path(logpath)
346
348
 
347
349
  @property
@@ -424,7 +426,7 @@ class stLearnConfig: # noqa N801
424
426
  Parameters
425
427
  ----------
426
428
  dpi
427
- Resolution of rendered figures – this influences the size of figures
429
+ Resolution of rendered figures - this influences the size of figures
428
430
  in notebooks.
429
431
  dpi_save
430
432
  Resolution of saved figures. This should typically be higher to achieve
@@ -472,17 +474,13 @@ class stLearnConfig: # noqa N801
472
474
 
473
475
  Only affects progress bars.
474
476
  """
475
- try:
476
- __IPYTHON__
477
- return True
478
- except NameError:
479
- return False
477
+ return getattr(builtins, "__IPYTHON__", False)
480
478
 
481
479
  def __str__(self) -> str:
482
480
  return "\n".join(
483
481
  f"{k} = {v!r}"
484
482
  for k, v in inspect.getmembers(self)
485
- if not k.startswith("_") and not k == "getdoc"
483
+ if not k.startswith("_") and k != "getdoc"
486
484
  )
487
485
 
488
486