pertpy 0.9.3__tar.gz → 0.9.5__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (188) hide show
  1. {pertpy-0.9.3 → pertpy-0.9.5}/.github/release-drafter.yml +2 -2
  2. {pertpy-0.9.3 → pertpy-0.9.5}/.github/workflows/release.yml +2 -2
  3. {pertpy-0.9.3 → pertpy-0.9.5}/.github/workflows/test.yml +7 -7
  4. {pertpy-0.9.3 → pertpy-0.9.5}/.gitignore +11 -0
  5. {pertpy-0.9.3 → pertpy-0.9.5}/.pre-commit-config.yaml +1 -1
  6. pertpy-0.9.5/.readthedocs.yml +18 -0
  7. {pertpy-0.9.3 → pertpy-0.9.5}/PKG-INFO +5 -4
  8. pertpy-0.9.5/docs/_static/docstring_previews/de_fold_change.png +0 -0
  9. pertpy-0.9.5/docs/_static/docstring_previews/de_multicomparison_fc.png +0 -0
  10. pertpy-0.9.5/docs/_static/docstring_previews/de_paired_expression.png +0 -0
  11. pertpy-0.9.5/docs/_static/docstring_previews/de_volcano.png +0 -0
  12. pertpy-0.9.5/docs/_static/docstring_previews/pseudobulk_samples.png +0 -0
  13. pertpy-0.9.5/docs/_static/tutorials/mcfarland.png +0 -0
  14. pertpy-0.9.5/docs/_static/tutorials/norman.png +0 -0
  15. pertpy-0.9.5/docs/_static/tutorials/zhang.png +0 -0
  16. {pertpy-0.9.3 → pertpy-0.9.5}/docs/conf.py +3 -0
  17. {pertpy-0.9.3 → pertpy-0.9.5}/docs/installation.md +2 -2
  18. {pertpy-0.9.3 → pertpy-0.9.5}/docs/tutorials/index.md +28 -5
  19. {pertpy-0.9.3 → pertpy-0.9.5}/docs/usage/usage.md +1 -1
  20. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/__init__.py +1 -1
  21. pertpy-0.9.5/pertpy/_doc.py +20 -0
  22. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/data/_dataloader.py +4 -4
  23. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/data/_datasets.py +3 -3
  24. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/metadata/_cell_line.py +19 -7
  25. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/metadata/_compound.py +3 -4
  26. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/metadata/_metadata.py +1 -1
  27. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/preprocessing/_guide_rna.py +19 -6
  28. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/__init__.py +12 -15
  29. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_augur.py +36 -46
  30. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_cinemaot.py +24 -18
  31. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_coda/_base_coda.py +87 -106
  32. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_dialogue.py +17 -21
  33. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_differential_gene_expression/__init__.py +1 -2
  34. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_differential_gene_expression/_base.py +495 -113
  35. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_differential_gene_expression/_edger.py +30 -21
  36. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_differential_gene_expression/_pydeseq2.py +15 -29
  37. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_differential_gene_expression/_statsmodels.py +0 -11
  38. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_distances/_distances.py +15 -8
  39. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_enrichment.py +18 -8
  40. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_milo.py +58 -46
  41. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_mixscape.py +111 -100
  42. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_perturbation_space/_perturbation_space.py +40 -31
  43. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_perturbation_space/_simple.py +50 -0
  44. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_scgen/_scgen.py +35 -25
  45. {pertpy-0.9.3 → pertpy-0.9.5}/pyproject.toml +21 -7
  46. pertpy-0.9.5/tests/tools/_differential_gene_expression/test_edger.py +62 -0
  47. pertpy-0.9.5/tests/tools/_differential_gene_expression/test_pydeseq2.py +65 -0
  48. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/_distances/test_distances.py +3 -0
  49. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/_perturbation_space/test_simple_perturbation_space.py +10 -2
  50. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/test_augur.py +1 -2
  51. pertpy-0.9.3/.readthedocs.yml +0 -23
  52. pertpy-0.9.3/pertpy/tools/_differential_gene_expression/_formulaic.py +0 -189
  53. pertpy-0.9.3/tests/tools/_differential_gene_expression/test_edger.py +0 -33
  54. pertpy-0.9.3/tests/tools/_differential_gene_expression/test_formulaic.py +0 -208
  55. pertpy-0.9.3/tests/tools/_differential_gene_expression/test_pydeseq2.py +0 -33
  56. {pertpy-0.9.3 → pertpy-0.9.5}/.editorconfig +0 -0
  57. {pertpy-0.9.3 → pertpy-0.9.5}/.gitattributes +0 -0
  58. {pertpy-0.9.3 → pertpy-0.9.5}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  59. {pertpy-0.9.3 → pertpy-0.9.5}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  60. {pertpy-0.9.3 → pertpy-0.9.5}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  61. {pertpy-0.9.3 → pertpy-0.9.5}/.github/labels.yml +0 -0
  62. {pertpy-0.9.3 → pertpy-0.9.5}/.github/pull_request_template.md +0 -0
  63. {pertpy-0.9.3 → pertpy-0.9.5}/.github/workflows/build.yml +0 -0
  64. {pertpy-0.9.3 → pertpy-0.9.5}/.github/workflows/labeler.yml +0 -0
  65. {pertpy-0.9.3 → pertpy-0.9.5}/.github/workflows/release_drafter.yml +0 -0
  66. {pertpy-0.9.3 → pertpy-0.9.5}/.gitmodules +0 -0
  67. {pertpy-0.9.3 → pertpy-0.9.5}/CODE_OF_CONDUCT.md +0 -0
  68. {pertpy-0.9.3 → pertpy-0.9.5}/LICENSE +0 -0
  69. {pertpy-0.9.3 → pertpy-0.9.5}/README.md +0 -0
  70. {pertpy-0.9.3 → pertpy-0.9.5}/codecov.yml +0 -0
  71. {pertpy-0.9.3 → pertpy-0.9.5}/docs/Makefile +0 -0
  72. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_ext/edit_on_github.py +0 -0
  73. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_ext/typed_returns.py +0 -0
  74. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/SCVI_LICENSE +0 -0
  75. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/css/overwrite.css +0 -0
  76. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/css/sphinx_gallery.css +0 -0
  77. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/docstring_previews/augur_dp_scatter.png +0 -0
  78. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/docstring_previews/augur_important_features.png +0 -0
  79. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/docstring_previews/augur_lollipop.png +0 -0
  80. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/docstring_previews/augur_scatterplot.png +0 -0
  81. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/docstring_previews/dialogue_pairplot.png +0 -0
  82. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/docstring_previews/dialogue_violin.png +0 -0
  83. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/docstring_previews/enrichment_dotplot.png +0 -0
  84. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/docstring_previews/enrichment_gsea.png +0 -0
  85. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/docstring_previews/milo_da_beeswarm.png +0 -0
  86. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/docstring_previews/milo_nhood.png +0 -0
  87. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/docstring_previews/milo_nhood_graph.png +0 -0
  88. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/docstring_previews/mixscape_barplot.png +0 -0
  89. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/docstring_previews/mixscape_heatmap.png +0 -0
  90. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/docstring_previews/mixscape_lda.png +0 -0
  91. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/docstring_previews/mixscape_perturbscore.png +0 -0
  92. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/docstring_previews/mixscape_violin.png +0 -0
  93. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/docstring_previews/sccoda_boxplots.png +0 -0
  94. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/docstring_previews/sccoda_effects_barplot.png +0 -0
  95. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/docstring_previews/sccoda_rel_abundance_dispersion_plot.png +0 -0
  96. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/docstring_previews/sccoda_stacked_barplot.png +0 -0
  97. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/docstring_previews/scgen_reg_mean.png +0 -0
  98. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/docstring_previews/tasccoda_draw_effects.png +0 -0
  99. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/docstring_previews/tasccoda_draw_tree.png +0 -0
  100. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/docstring_previews/tasccoda_effects_umap.png +0 -0
  101. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/icons/code-24px.svg +0 -0
  102. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/icons/computer-24px.svg +0 -0
  103. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/icons/library_books-24px.svg +0 -0
  104. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/icons/play_circle_outline-24px.svg +0 -0
  105. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/placeholder.png +0 -0
  106. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/tutorials/augur.png +0 -0
  107. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/tutorials/cinemaot.png +0 -0
  108. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/tutorials/dge.png +0 -0
  109. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/tutorials/dialogue.png +0 -0
  110. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/tutorials/distances.png +0 -0
  111. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/tutorials/distances_tests.png +0 -0
  112. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/tutorials/enrichment.png +0 -0
  113. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/tutorials/guide_rna_assignment.png +0 -0
  114. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/tutorials/metadata.png +0 -0
  115. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/tutorials/milo.png +0 -0
  116. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/tutorials/mixscape.png +0 -0
  117. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/tutorials/ontology.png +0 -0
  118. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/tutorials/perturbation_space.png +0 -0
  119. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/tutorials/placeholder.png +0 -0
  120. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/tutorials/sccoda.png +0 -0
  121. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/tutorials/sccoda_extended.png +0 -0
  122. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/tutorials/scgen_perturbation_prediction.png +0 -0
  123. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_static/tutorials/tasccoda.png +0 -0
  124. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_templates/autosummary/class.rst +0 -0
  125. {pertpy-0.9.3 → pertpy-0.9.5}/docs/_templates/class_no_inherited.rst +0 -0
  126. {pertpy-0.9.3 → pertpy-0.9.5}/docs/code_of_conduct.md +0 -0
  127. {pertpy-0.9.3 → pertpy-0.9.5}/docs/contributing.md +0 -0
  128. {pertpy-0.9.3 → pertpy-0.9.5}/docs/index.md +0 -0
  129. {pertpy-0.9.3 → pertpy-0.9.5}/docs/make.bat +0 -0
  130. {pertpy-0.9.3 → pertpy-0.9.5}/docs/references.bib +0 -0
  131. {pertpy-0.9.3 → pertpy-0.9.5}/docs/references.md +0 -0
  132. {pertpy-0.9.3 → pertpy-0.9.5}/docs/utils.py +0 -0
  133. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/data/__init__.py +0 -0
  134. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/metadata/__init__.py +0 -0
  135. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/metadata/_drug.py +0 -0
  136. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/metadata/_look_up.py +0 -0
  137. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/metadata/_moa.py +0 -0
  138. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/plot/__init__.py +0 -0
  139. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/preprocessing/__init__.py +0 -0
  140. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/py.typed +0 -0
  141. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_coda/__init__.py +0 -0
  142. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_coda/_sccoda.py +0 -0
  143. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_coda/_tasccoda.py +0 -0
  144. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_differential_gene_expression/_checks.py +0 -0
  145. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_differential_gene_expression/_dge_comparison.py +0 -0
  146. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_differential_gene_expression/_simple_tests.py +0 -0
  147. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_distances/__init__.py +0 -0
  148. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_distances/_distance_tests.py +0 -0
  149. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_kernel_pca.py +0 -0
  150. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_perturbation_space/__init__.py +0 -0
  151. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_perturbation_space/_clustering.py +0 -0
  152. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_perturbation_space/_comparison.py +0 -0
  153. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_perturbation_space/_discriminator_classifiers.py +0 -0
  154. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_perturbation_space/_metrics.py +0 -0
  155. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_scgen/__init__.py +0 -0
  156. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_scgen/_base_components.py +0 -0
  157. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_scgen/_scgenvae.py +0 -0
  158. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/_scgen/_utils.py +0 -0
  159. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/decoupler_LICENSE +0 -0
  160. {pertpy-0.9.3 → pertpy-0.9.5}/pertpy/tools/transferlearning_MMD_LICENSE +0 -0
  161. {pertpy-0.9.3 → pertpy-0.9.5}/tests/conftest.py +0 -0
  162. {pertpy-0.9.3 → pertpy-0.9.5}/tests/metadata/test_cell_line.py +0 -0
  163. {pertpy-0.9.3 → pertpy-0.9.5}/tests/metadata/test_compound.py +0 -0
  164. {pertpy-0.9.3 → pertpy-0.9.5}/tests/metadata/test_drug.py +0 -0
  165. {pertpy-0.9.3 → pertpy-0.9.5}/tests/metadata/test_moa.py +0 -0
  166. {pertpy-0.9.3 → pertpy-0.9.5}/tests/preprocessing/test_grna_assignment.py +0 -0
  167. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/_coda/test_sccoda.py +0 -0
  168. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/_coda/test_tasccoda.py +0 -0
  169. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/_differential_gene_expression/__init__.py +0 -0
  170. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/_differential_gene_expression/conftest.py +0 -0
  171. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/_differential_gene_expression/test_base.py +0 -0
  172. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/_differential_gene_expression/test_compare_groups.py +0 -0
  173. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/_differential_gene_expression/test_dge.py +0 -0
  174. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/_differential_gene_expression/test_input_checks.py +0 -0
  175. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/_differential_gene_expression/test_simple_tests.py +0 -0
  176. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/_differential_gene_expression/test_statsmodels.py +0 -0
  177. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/_distances/test_distance_tests.py +0 -0
  178. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/_perturbation_space/test_comparison.py +0 -0
  179. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/_perturbation_space/test_discriminator_classifiers.py +0 -0
  180. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/_perturbation_space/test_simple_cluster_space.py +0 -0
  181. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/haber_data.csv +0 -0
  182. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/r_result.csv +0 -0
  183. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/test_cinemaot.py +0 -0
  184. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/test_dialogue.py +0 -0
  185. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/test_enrichment.py +0 -0
  186. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/test_milo.py +0 -0
  187. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/test_mixscape.py +0 -0
  188. {pertpy-0.9.3 → pertpy-0.9.5}/tests/tools/test_scgen.py +0 -0
@@ -1,5 +1,5 @@
1
- name-template: "0.9.3 🌈"
2
- tag-template: 0.9.3
1
+ name-template: "0.9.5 🌈"
2
+ tag-template: 0.9.5
3
3
  exclude-labels:
4
4
  - "skip-changelog"
5
5
 
@@ -13,10 +13,10 @@ jobs:
13
13
  - name: Checkout code
14
14
  uses: actions/checkout@v4
15
15
 
16
- - name: Set up Python 3.11
16
+ - name: Set up Python 3.12
17
17
  uses: actions/setup-python@v5
18
18
  with:
19
- python-version: "3.11"
19
+ python-version: "3.12"
20
20
 
21
21
  - name: Install hatch
22
22
  run: pip install hatch
@@ -27,13 +27,13 @@ jobs:
27
27
  - os: ubuntu-latest
28
28
  python: "3.12"
29
29
  run_mode: "slow"
30
- - os: ubuntu-latest
31
- python: "3.12"
32
- run_mode: "fast"
33
- - os: ubuntu-latest
34
- python: "3.12"
35
- run_mode: slow
36
- pip-flags: "--pre"
30
+ # - os: ubuntu-latest
31
+ # python: "3.12"
32
+ # run_mode: "fast"
33
+ # - os: ubuntu-latest
34
+ # python: "3.12"
35
+ # run_mode: slow
36
+ # pip-flags: "--pre"
37
37
 
38
38
  env:
39
39
  OS: ${{ matrix.os }}
@@ -137,6 +137,9 @@ dmypy.json
137
137
  # Jetbrains IDE
138
138
  .idea/
139
139
 
140
+ # VSCode
141
+ .vscode
142
+
140
143
  # Coala
141
144
  *.orig
142
145
 
@@ -155,3 +158,11 @@ lightning_logs/*
155
158
  */lightning_logs/*
156
159
 
157
160
  node_modules
161
+
162
+ # lamindb
163
+ test.ipynb
164
+ test-perturbation
165
+ test-bug
166
+
167
+ # uv
168
+ uv.lock
@@ -32,7 +32,7 @@ repos:
32
32
  - id: mypy
33
33
  args: [--no-strict-optional, --ignore-missing-imports]
34
34
  additional_dependencies:
35
- ["types-pkg-resources", "types-requests", "types-attrs"]
35
+ ["types-setuptools", "types-requests", "types-attrs"]
36
36
  - repo: local
37
37
  hooks:
38
38
  - id: forbid-to-commit
@@ -0,0 +1,18 @@
1
+ version: 2
2
+ build:
3
+ os: ubuntu-24.04
4
+ tools:
5
+ python: "3.12"
6
+ commands:
7
+ - asdf plugin add uv
8
+ - asdf install uv latest
9
+ - asdf global uv latest
10
+ - uv venv
11
+ - uv pip install .[doc,coda,de]
12
+ - .venv/bin/python -m sphinx -T -b html -d docs/_build/doctrees -D language=en docs $READTHEDOCS_OUTPUT/html
13
+ sphinx:
14
+ configuration: docs/conf.py
15
+ fail_on_warning: false
16
+
17
+ submodules:
18
+ include: all
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: pertpy
3
- Version: 0.9.3
3
+ Version: 0.9.5
4
4
  Summary: Perturbation Analysis in the scverse ecosystem.
5
5
  Project-URL: Documentation, https://pertpy.readthedocs.io
6
6
  Project-URL: Source, https://github.com/scverse/pertpy
@@ -44,7 +44,7 @@ Classifier: Programming Language :: Python :: 3.11
44
44
  Classifier: Programming Language :: Python :: 3.12
45
45
  Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
46
46
  Classifier: Topic :: Scientific/Engineering :: Visualization
47
- Requires-Python: >=3.10
47
+ Requires-Python: <3.13,>=3.10
48
48
  Requires-Dist: adjusttext
49
49
  Requires-Dist: blitzgsea
50
50
  Requires-Dist: decoupler
@@ -68,7 +68,8 @@ Requires-Dist: pyqt5; extra == 'coda'
68
68
  Requires-Dist: toytree; extra == 'coda'
69
69
  Provides-Extra: de
70
70
  Requires-Dist: formulaic; extra == 'de'
71
- Requires-Dist: pydeseq2; extra == 'de'
71
+ Requires-Dist: formulaic-contrasts>=0.2.0; extra == 'de'
72
+ Requires-Dist: pydeseq2>=v0.5.0pre1; extra == 'de'
72
73
  Provides-Extra: dev
73
74
  Requires-Dist: pre-commit; extra == 'dev'
74
75
  Provides-Extra: doc
@@ -195,4 +195,7 @@ nbsphinx_thumbnails = {
195
195
  "tutorials/notebooks/differential_gene_expression": "_static/tutorials/dge.png",
196
196
  "tutorials/notebooks/metadata_annotation": "_static/tutorials/metadata.png",
197
197
  "tutorials/notebooks/ontology_mapping": "_static/tutorials/ontology.png",
198
+ "tutorials/notebooks/norman_use_case": "_static/tutorials/norman.png",
199
+ "tutorials/notebooks/mcfarland_use_case": "_static/tutorials/mcfarland.png",
200
+ "tutorials/notebooks/zhang_use_case": "_static/tutorials/zhang.png",
198
201
  }
@@ -78,10 +78,10 @@ Follow these steps to install pertpy on an Apple Silicon machine (tested on a Ma
78
78
  brew install --cask mambaforge
79
79
  ```
80
80
 
81
- 3. Create a new environment using mamba (here with python 3.10) and activate it
81
+ 3. Create a new environment using mamba and activate it
82
82
 
83
83
  ```console
84
- mamba create -n pertpy-env python=3.11
84
+ mamba create -n pertpy-env
85
85
  mamba activate pertpy-env
86
86
  ```
87
87
 
@@ -11,13 +11,25 @@ Many are also designed to work seamlessly in Google colab.
11
11
  For questions about the usage of pertpy use the [scverse discourse](https://discourse.scverse.org/).
12
12
  :::
13
13
 
14
- ## Quick start
14
+ ## Quick start: Tool specific tutorials
15
+
16
+ ### Data transformation
15
17
 
16
18
  ```{eval-rst}
17
19
  .. nbgallery::
18
20
 
19
21
  notebooks/guide_rna_assignment
20
22
  notebooks/mixscape
23
+ notebooks/perturbation_space
24
+ notebooks/metadata_annotation
25
+ notebooks/ontology_mapping
26
+ ```
27
+
28
+ ### Knowledge inference
29
+
30
+ ```{eval-rst}
31
+ .. nbgallery::
32
+
21
33
  notebooks/augur
22
34
  notebooks/sccoda
23
35
  notebooks/sccoda_extended
@@ -29,13 +41,24 @@ For questions about the usage of pertpy use the [scverse discourse](https://disc
29
41
  notebooks/distance_tests
30
42
  notebooks/cinemaot
31
43
  notebooks/scgen_perturbation_prediction
32
- notebooks/perturbation_space
33
44
  notebooks/differential_gene_expression
34
- notebooks/metadata_annotation
35
- notebooks/ontology_mapping
36
45
  ```
37
46
 
38
- ### Glossary
47
+ ## Use cases
48
+
49
+ Our use cases showcase a variety of pertpy tools applied to one dataset.
50
+ They are designed to give you a sense of how to use pertpy in a real-world scenario.
51
+ The use cases featured here are those we present in the pertpy [preprint](https://www.biorxiv.org/content/10.1101/2024.08.04.606516v1).
52
+
53
+ ```{eval-rst}
54
+ .. nbgallery::
55
+
56
+ notebooks/norman_use_case
57
+ notebooks/mcfarland_use_case
58
+ notebooks/zhang_use_case
59
+ ```
60
+
61
+ ## Glossary
39
62
 
40
63
  ```{eval-rst}
41
64
  .. tab-set::
@@ -450,7 +450,7 @@ See [scGen predicts single-cell perturbation responses](https://www.nature.com/a
450
450
  .. autosummary::
451
451
  :toctree: tools
452
452
 
453
- tools.SCGEN
453
+ tools.Scgen
454
454
  ```
455
455
 
456
456
  Example implementation:
@@ -2,7 +2,7 @@
2
2
 
3
3
  __author__ = "Lukas Heumos"
4
4
  __email__ = "lukas.heumos@posteo.net"
5
- __version__ = "0.9.3"
5
+ __version__ = "0.9.5"
6
6
 
7
7
  import warnings
8
8
 
@@ -0,0 +1,20 @@
1
+ from textwrap import dedent
2
+
3
+
4
+ def _doc_params(**kwds): # pragma: no cover
5
+ """\
6
+ Docstrings should start with "\" in the first line for proper formatting.
7
+ """
8
+
9
+ def dec(obj):
10
+ obj.__orig_doc__ = obj.__doc__
11
+ obj.__doc__ = dedent(obj.__doc__.format_map(kwds))
12
+ return obj
13
+
14
+ return dec
15
+
16
+
17
+ doc_common_plot_args = """\
18
+ show: if `True`, shows the plot.
19
+ return_fig: if `True`, returns figure of the plot.\
20
+ """
@@ -23,10 +23,10 @@ def _download( # pragma: no cover
23
23
  Args:
24
24
  url: URL to download
25
25
  output_file_name: Name of the downloaded file
26
- output_path: Path to download/extract the files to (default: OS tmpdir)
27
- block_size: Block size for downloads in bytes (default: 1024)
28
- overwrite: Whether to overwrite existing files (default: False)
29
- is_zip: Whether the downloaded file needs to be unzipped (default: False)
26
+ output_path: Path to download/extract the files to.
27
+ block_size: Block size for downloads in bytes.
28
+ overwrite: Whether to overwrite existing files.
29
+ is_zip: Whether the downloaded file needs to be unzipped.
30
30
  """
31
31
  if output_file_name is None:
32
32
  letters = ascii_lowercase
@@ -66,7 +66,7 @@ def sc_sim_augur() -> AnnData: # pragma: no cover
66
66
  output_file_path = settings.datasetdir / output_file_name
67
67
  if not Path(output_file_path).exists():
68
68
  _download(
69
- url="https://figshare.com/ndownloader/files/31645886",
69
+ url="https://figshare.com/ndownloader/files/49828902",
70
70
  output_file_name=output_file_name,
71
71
  output_path=settings.datasetdir,
72
72
  is_zip=False,
@@ -1100,7 +1100,7 @@ def shifrut_2018() -> AnnData: # pragma: no cover
1100
1100
  output_file_path = settings.datasetdir / output_file_name
1101
1101
  if not Path(output_file_path).exists():
1102
1102
  _download(
1103
- url="https://zenodo.org/record/10044268/files/ShifrutMarson2018.h5ad?download=1",
1103
+ url="https://zenodo.org/record/13350497/files/ShifrutMarson2018.h5ad?download=1",
1104
1104
  output_file_name=output_file_name,
1105
1105
  output_path=settings.datasetdir,
1106
1106
  is_zip=False,
@@ -1160,7 +1160,7 @@ def srivatsan_2020_sciplex3() -> AnnData: # pragma: no cover
1160
1160
  output_file_path = settings.datasetdir / output_file_name
1161
1161
  if not Path(output_file_path).exists():
1162
1162
  _download(
1163
- url="https://zenodo.org/records/10044268/files/SrivatsanTrapnell2020_sciplex3.h5ad?download=1",
1163
+ url="https://zenodo.org/records/13350497/files/SrivatsanTrapnell2020_sciplex3.h5ad?download=1",
1164
1164
  output_file_name=output_file_name,
1165
1165
  output_path=settings.datasetdir,
1166
1166
  is_zip=False,
@@ -8,12 +8,15 @@ from lamin_utils import logger
8
8
  if TYPE_CHECKING:
9
9
  from collections.abc import Iterable
10
10
 
11
+ from matplotlib.pyplot import Figure
12
+
11
13
  import matplotlib.pyplot as plt
12
14
  import numpy as np
13
15
  import pandas as pd
14
16
  from scanpy import settings
15
17
  from scipy import stats
16
18
 
19
+ from pertpy._doc import _doc_params, doc_common_plot_args
17
20
  from pertpy.data._dataloader import _download
18
21
 
19
22
  from ._look_up import LookUp
@@ -338,8 +341,8 @@ class CellLine(MetaData):
338
341
  # then we can compare these keys and fetch the corresponding metadata.
339
342
  if query_id not in adata.obs.columns:
340
343
  raise ValueError(
341
- f"The specified `query_id` {query_id} can't be found in the `adata.obs`.\n"
342
- "Ensure that you are using one of the available query IDs present in the adata.obs for the annotation.\n"
344
+ f"The specified `query_id` {query_id} can't be found in the `adata.obs`. \n"
345
+ "Ensure that you are using one of the available query IDs present in the adata.obs for the annotation."
343
346
  "If the desired query ID is not available, you can fetch the cell line metadata "
344
347
  "using the `annotate()` function before calling 'annotate_bulk_rna()'. "
345
348
  "This ensures that the required query ID is included in your data, e.g. stripped_cell_line_name, DepMap ID."
@@ -356,9 +359,8 @@ class CellLine(MetaData):
356
359
  else:
357
360
  reference_id = "DepMap_ID"
358
361
  logger.warning(
359
- "To annotate bulk RNA data from Broad Institue, `DepMap_ID` is used as default reference and query identifier if no `reference_id` is given.\n"
360
- "Ensure that `DepMap_ID` is available in 'adata.obs'.\n"
361
- "Alternatively, use `annotate()` to annotate the cell line first "
362
+ "To annotate bulk RNA data from Broad Institue, `DepMap_ID` is used as default reference and query identifier if no `reference_id` is given."
363
+ "If `DepMap_ID` isn't available in 'adata.obs', use `annotate()` to annotate the cell line first."
362
364
  )
363
365
  if self.bulk_rna_broad is None:
364
366
  self._download_bulk_rna(cell_line_source="broad")
@@ -690,6 +692,7 @@ class CellLine(MetaData):
690
692
 
691
693
  return corr, pvals, new_corr, new_pvals
692
694
 
695
+ @_doc_params(common_plot_args=doc_common_plot_args)
693
696
  def plot_correlation(
694
697
  self,
695
698
  adata: AnnData,
@@ -700,7 +703,9 @@ class CellLine(MetaData):
700
703
  metadata_key: str = "bulk_rna_broad",
701
704
  category: str = "cell line",
702
705
  subset_identifier: str | int | Iterable[str] | Iterable[int] | None = None,
703
- ) -> None:
706
+ show: bool = True,
707
+ return_fig: bool = False,
708
+ ) -> Figure | None:
704
709
  """Visualise the correlation of cell lines with annotated metadata.
705
710
 
706
711
  Args:
@@ -713,6 +718,8 @@ class CellLine(MetaData):
713
718
  subset_identifier: Selected identifiers for scatter plot visualization between the X matrix and `metadata_key`.
714
719
  If not None, only the chosen cell line will be plotted, either specified as a value in `identifier` (string) or as an index number.
715
720
  If None, all cell lines will be plotted.
721
+ {common_plot_args}
722
+
716
723
  Returns:
717
724
  Pearson correlation coefficients and their corresponding p-values for matched and unmatched cell lines separately.
718
725
  """
@@ -790,6 +797,11 @@ class CellLine(MetaData):
790
797
  "edgecolor": "black",
791
798
  },
792
799
  )
793
- plt.show()
800
+
801
+ if show:
802
+ plt.show()
803
+ if return_fig:
804
+ return plt.gcf()
805
+ return None
794
806
  else:
795
807
  raise NotImplementedError
@@ -42,7 +42,7 @@ class Compound(MetaData):
42
42
  adata = adata.copy()
43
43
 
44
44
  if query_id not in adata.obs.columns:
45
- raise ValueError(f"The requested query_id {query_id} is not in `adata.obs`.\n" f"Please check again. ")
45
+ raise ValueError(f"The requested query_id {query_id} is not in `adata.obs`.\n Please check again.")
46
46
 
47
47
  query_dict = {}
48
48
  not_matched_identifiers = []
@@ -84,7 +84,7 @@ class Compound(MetaData):
84
84
  query_df = pd.DataFrame.from_dict(query_dict, orient="index", columns=["pubchem_name", "pubchem_ID", "smiles"])
85
85
  # Merge and remove duplicate columns
86
86
  # Column is converted to float after merging due to unmatches
87
- # Convert back to integers
87
+ # Convert back to integers afterwards
88
88
  if query_id_type == "cid":
89
89
  query_df.pubchem_ID = query_df.pubchem_ID.astype("Int64")
90
90
  adata.obs = (
@@ -119,8 +119,7 @@ class Compound(MetaData):
119
119
 
120
120
  The LookUp object provides an overview of the metadata to annotate.
121
121
  Each annotate_{metadata} function has a corresponding lookup function in the LookUp object,
122
- where users can search the reference_id in the metadata and
123
- compare with the query_id in their own data.
122
+ where users can search the reference_id in the metadata and compare with the query_id in their own data.
124
123
 
125
124
  Returns:
126
125
  Returns a LookUp object specific for compound annotation.
@@ -62,7 +62,7 @@ class MetaData:
62
62
  if verbosity > 0:
63
63
  logger.info(
64
64
  f"There are {total_identifiers} identifiers in `adata.obs`."
65
- f"However, {len(unmatched_identifiers)} identifiers can't be found in the {metadata_type} annotation,"
65
+ f"However, {len(unmatched_identifiers)} identifiers can't be found in the {metadata_type} annotation, "
66
66
  "leading to the presence of NA values for their respective metadata.\n"
67
67
  f"Please check again: *unmatched_identifiers[:verbosity]..."
68
68
  )
@@ -3,14 +3,17 @@ from __future__ import annotations
3
3
  import uuid
4
4
  from typing import TYPE_CHECKING
5
5
 
6
+ import matplotlib.pyplot as plt
6
7
  import numpy as np
7
8
  import pandas as pd
8
9
  import scanpy as sc
9
10
  import scipy
10
11
 
12
+ from pertpy._doc import _doc_params, doc_common_plot_args
13
+
11
14
  if TYPE_CHECKING:
12
15
  from anndata import AnnData
13
- from matplotlib.axes import Axes
16
+ from matplotlib.pyplot import Figure
14
17
 
15
18
 
16
19
  class GuideAssignment:
@@ -106,14 +109,18 @@ class GuideAssignment:
106
109
 
107
110
  return None
108
111
 
112
+ @_doc_params(common_plot_args=doc_common_plot_args)
109
113
  def plot_heatmap(
110
114
  self,
111
115
  adata: AnnData,
116
+ *,
112
117
  layer: str | None = None,
113
118
  order_by: np.ndarray | str | None = None,
114
119
  key_to_save_order: str = None,
120
+ show: bool = True,
121
+ return_fig: bool = False,
115
122
  **kwargs,
116
- ) -> list[Axes]:
123
+ ) -> Figure | None:
117
124
  """Heatmap plotting of guide RNA expression matrix.
118
125
 
119
126
  Assuming guides have sparse expression, this function reorders cells
@@ -131,11 +138,12 @@ class GuideAssignment:
131
138
  If a string is provided, adata.obs[order_by] will be used as the order.
132
139
  If a numpy array is provided, the array will be used for ordering.
133
140
  key_to_save_order: The obs key to save cell orders in the current plot. Only saves if not None.
141
+ {common_plot_args}
134
142
  kwargs: Are passed to sc.pl.heatmap.
135
143
 
136
144
  Returns:
137
- List of Axes. Alternatively you can pass save or show parameters as they will be passed to sc.pl.heatmap.
138
- Order of cells in the y-axis will be saved on adata.obs[key_to_save_order] if provided.
145
+ If `return_fig` is `True`, returns the figure, otherwise `None`.
146
+ Order of cells in the y-axis will be saved on `adata.obs[key_to_save_order]` if provided.
139
147
 
140
148
  Examples:
141
149
  Each cell is assigned to gRNA that occurs at least 5 times in the respective cell, which is then
@@ -172,7 +180,7 @@ class GuideAssignment:
172
180
  adata.obs[key_to_save_order] = pd.Categorical(order)
173
181
 
174
182
  try:
175
- axis_group = sc.pl.heatmap(
183
+ fig = sc.pl.heatmap(
176
184
  adata[order, :],
177
185
  var_names=adata.var.index.tolist(),
178
186
  groupby=temp_col_name,
@@ -180,9 +188,14 @@ class GuideAssignment:
180
188
  use_raw=False,
181
189
  dendrogram=False,
182
190
  layer=layer,
191
+ show=False,
183
192
  **kwargs,
184
193
  )
185
194
  finally:
186
195
  del adata.obs[temp_col_name]
187
196
 
188
- return axis_group
197
+ if show:
198
+ plt.show()
199
+ if return_fig:
200
+ return fig
201
+ return None
@@ -1,25 +1,22 @@
1
- from functools import wraps
2
1
  from importlib import import_module
3
2
 
4
3
 
5
4
  def lazy_import(module_path, class_name, extras):
6
- def _import():
7
- try:
8
- for extra in extras:
9
- import_module(extra)
10
- except ImportError as e:
11
- raise ImportError(
12
- f"Extra dependencies required: {', '.join(extras)}. "
13
- f"Please install with: pip install {' '.join(extras)}"
14
- ) from e
5
+ try:
6
+ for extra in extras:
7
+ import_module(extra)
15
8
  module = import_module(module_path)
16
9
  return getattr(module, class_name)
10
+ except ImportError:
17
11
 
18
- @wraps(_import)
19
- def wrapper(*args, **kwargs):
20
- return _import()(*args, **kwargs)
12
+ class Placeholder:
13
+ def __init__(self, *args, **kwargs):
14
+ raise ImportError(
15
+ f"Extra dependencies required: {', '.join(extras)}. "
16
+ f"Please install with: pip install {' '.join(extras)}"
17
+ )
21
18
 
22
- return wrapper
19
+ return Placeholder
23
20
 
24
21
 
25
22
  from pertpy.tools._augur import Augur
@@ -49,7 +46,7 @@ Sccoda = lazy_import("pertpy.tools._coda._sccoda", "Sccoda", CODA_EXTRAS)
49
46
  Tasccoda = lazy_import("pertpy.tools._coda._tasccoda", "Tasccoda", CODA_EXTRAS)
50
47
 
51
48
  DE_EXTRAS = ["formulaic", "pydeseq2"]
52
- EdgeR = lazy_import("pertpy.tools._differential_gene_expression", "EdgeR", DE_EXTRAS + ["edger"])
49
+ EdgeR = lazy_import("pertpy.tools._differential_gene_expression", "EdgeR", DE_EXTRAS) # edgeR will be imported via rpy2
53
50
  PyDESeq2 = lazy_import("pertpy.tools._differential_gene_expression", "PyDESeq2", DE_EXTRAS)
54
51
  Statsmodels = lazy_import("pertpy.tools._differential_gene_expression", "Statsmodels", DE_EXTRAS + ["statsmodels"])
55
52
  TTest = lazy_import("pertpy.tools._differential_gene_expression", "TTest", DE_EXTRAS)