pertpy 0.11.2__tar.gz → 0.11.4__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.
- {pertpy-0.11.2 → pertpy-0.11.4}/.github/ISSUE_TEMPLATE/bug_report.yml +5 -5
- {pertpy-0.11.2 → pertpy-0.11.4}/.github/release-drafter.yml +2 -2
- {pertpy-0.11.2 → pertpy-0.11.4}/PKG-INFO +33 -6
- {pertpy-0.11.2 → pertpy-0.11.4}/README.md +32 -4
- pertpy-0.11.4/docs/about/background.md +49 -0
- pertpy-0.11.4/docs/about/cite.md +20 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/changelog.md +14 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/conf.py +1 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/index.md +26 -4
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/installation.md +29 -17
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/__init__.py +1 -1
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_coda/_base_coda.py +23 -18
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_dialogue.py +1 -1
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_differential_gene_expression/_base.py +1 -3
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_perturbation_space/_simple.py +10 -53
- {pertpy-0.11.2 → pertpy-0.11.4}/pyproject.toml +1 -2
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/_perturbation_space/test_simple_perturbation_space.py +10 -11
- {pertpy-0.11.2 → pertpy-0.11.4}/.editorconfig +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/.gitattributes +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/.github/labels.yml +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/.github/pull_request_template.md +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/.github/workflows/build.yml +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/.github/workflows/labeler.yml +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/.github/workflows/release.yml +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/.github/workflows/release_drafter.yml +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/.github/workflows/test.yml +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/.gitignore +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/.gitmodules +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/.pre-commit-config.yaml +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/.readthedocs.yml +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/LICENSE +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/biome.jsonc +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/codecov.yml +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/Makefile +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_ext/edit_on_github.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_ext/typed_returns.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/SCVI_LICENSE +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/css/overwrite.css +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/css/sphinx_gallery.css +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/augur_dp_scatter.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/augur_important_features.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/augur_lollipop.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/augur_scatterplot.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/de_fold_change.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/de_multicomparison_fc.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/de_paired_expression.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/de_volcano.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/dialogue_pairplot.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/dialogue_violin.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/enrichment_dotplot.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/enrichment_gsea.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/milo_da_beeswarm.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/milo_nhood.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/milo_nhood_graph.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/mixscape_barplot.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/mixscape_heatmap.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/mixscape_lda.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/mixscape_perturbscore.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/mixscape_violin.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/pseudobulk_samples.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/sccoda_boxplots.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/sccoda_effects_barplot.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/sccoda_rel_abundance_dispersion_plot.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/sccoda_stacked_barplot.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/scgen_reg_mean.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/tasccoda_draw_effects.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/tasccoda_draw_tree.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/docstring_previews/tasccoda_effects_umap.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/icons/code-24px.svg +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/icons/computer-24px.svg +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/icons/library_books-24px.svg +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/icons/play_circle_outline-24px.svg +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/pertpy_logo.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/pertpy_logo.svg +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/placeholder.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/tutorials/augur.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/tutorials/cinemaot.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/tutorials/dge.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/tutorials/dialogue.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/tutorials/distances.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/tutorials/distances_tests.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/tutorials/enrichment.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/tutorials/guide_rna_assignment.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/tutorials/mcfarland.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/tutorials/metadata.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/tutorials/milo.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/tutorials/mixscape.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/tutorials/norman.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/tutorials/ontology.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/tutorials/perturbation_space.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/tutorials/placeholder.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/tutorials/sccoda.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/tutorials/sccoda_extended.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/tutorials/scgen_perturbation_prediction.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/tutorials/tasccoda.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_static/tutorials/zhang.png +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/_templates/autosummary/class.rst +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/api/datasets_index.md +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/api/metadata_index.md +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/api/preprocessing_index.md +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/api/tools_index.md +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/api.md +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/contributing.md +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/make.bat +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/references.bib +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/references.md +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/tutorials/metadata.md +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/tutorials/preprocessing.md +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/tutorials/tools.md +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/tutorials.md +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/usecases.md +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/docs/utils.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/_doc.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/_types.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/data/__init__.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/data/_dataloader.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/data/_datasets.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/metadata/__init__.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/metadata/_cell_line.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/metadata/_compound.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/metadata/_drug.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/metadata/_look_up.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/metadata/_metadata.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/metadata/_moa.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/plot/__init__.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/preprocessing/__init__.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/preprocessing/_guide_rna.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/preprocessing/_guide_rna_mixture.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/py.typed +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/__init__.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_augur.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_cinemaot.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_coda/__init__.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_coda/_sccoda.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_coda/_tasccoda.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_differential_gene_expression/__init__.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_differential_gene_expression/_checks.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_differential_gene_expression/_dge_comparison.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_differential_gene_expression/_edger.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_differential_gene_expression/_pydeseq2.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_differential_gene_expression/_simple_tests.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_differential_gene_expression/_statsmodels.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_distances/__init__.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_distances/_distance_tests.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_distances/_distances.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_enrichment.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_milo.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_mixscape.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_perturbation_space/__init__.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_perturbation_space/_clustering.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_perturbation_space/_comparison.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_perturbation_space/_discriminator_classifiers.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_perturbation_space/_metrics.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_perturbation_space/_perturbation_space.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_scgen/__init__.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_scgen/_base_components.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_scgen/_scgen.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_scgen/_scgenvae.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/_scgen/_utils.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/decoupler_LICENSE +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/pertpy/tools/transferlearning_MMD_LICENSE +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/conftest.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/metadata/test_cell_line.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/metadata/test_compound.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/metadata/test_drug.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/metadata/test_moa.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/preprocessing/test_grna_assignment.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/_coda/test_sccoda.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/_coda/test_tasccoda.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/_differential_gene_expression/__init__.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/_differential_gene_expression/conftest.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/_differential_gene_expression/test_base.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/_differential_gene_expression/test_compare_groups.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/_differential_gene_expression/test_dge.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/_differential_gene_expression/test_edger.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/_differential_gene_expression/test_input_checks.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/_differential_gene_expression/test_pydeseq2.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/_differential_gene_expression/test_simple_tests.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/_differential_gene_expression/test_statsmodels.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/_distances/test_distance_tests.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/_distances/test_distances.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/_perturbation_space/test_comparison.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/_perturbation_space/test_discriminator_classifiers.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/_perturbation_space/test_simple_cluster_space.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/test_augur.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/test_cinemaot.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/test_dialogue.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/test_enrichment.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/test_milo.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/test_mixscape.py +0 -0
- {pertpy-0.11.2 → pertpy-0.11.4}/tests/tools/test_scgen.py +0 -0
@@ -1,9 +1,9 @@
|
|
1
1
|
name: Bug report
|
2
|
-
description: pertpy doesn
|
2
|
+
description: pertpy doesn't do what it should? Please help us fix it!
|
3
3
|
#title: ...
|
4
4
|
labels:
|
5
|
-
-
|
6
|
-
-
|
5
|
+
- bug
|
6
|
+
- triage
|
7
7
|
#assignees: []
|
8
8
|
body:
|
9
9
|
- type: checkboxes
|
@@ -64,6 +64,6 @@ body:
|
|
64
64
|
Alternatively, run this in a console:
|
65
65
|
|
66
66
|
```python
|
67
|
-
>>> import session_info2; print(session_info2.session_info(dependencies=True)._repr_mimebundle_()["text/markdown"])
|
67
|
+
>>> import pertpy, session_info2; print(session_info2.session_info(dependencies=True)._repr_mimebundle_()["text/markdown"])
|
68
68
|
```
|
69
|
-
render:
|
69
|
+
render: markdown
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: pertpy
|
3
|
-
Version: 0.11.
|
3
|
+
Version: 0.11.4
|
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
|
@@ -49,7 +49,6 @@ Requires-Python: <3.14,>=3.11
|
|
49
49
|
Requires-Dist: adjusttext
|
50
50
|
Requires-Dist: arviz
|
51
51
|
Requires-Dist: blitzgsea
|
52
|
-
Requires-Dist: decoupler
|
53
52
|
Requires-Dist: fast-array-utils
|
54
53
|
Requires-Dist: lamin-utils
|
55
54
|
Requires-Dist: mudata
|
@@ -132,22 +131,50 @@ You can install _pertpy_ in less than a minute via [pip] from [PyPI]:
|
|
132
131
|
pip install pertpy
|
133
132
|
```
|
134
133
|
|
134
|
+
### Differential gene expression
|
135
|
+
|
136
|
+
If you want to use the differential gene expression interface, please install pertpy by running:
|
137
|
+
|
138
|
+
```console
|
139
|
+
pip install 'pertpy[de]'
|
140
|
+
```
|
141
|
+
|
142
|
+
### tascCODA
|
143
|
+
|
135
144
|
if you want to use tascCODA, please install pertpy as follows:
|
136
145
|
|
137
146
|
```console
|
138
147
|
pip install 'pertpy[tcoda]'
|
139
148
|
```
|
140
149
|
|
141
|
-
|
150
|
+
### milo
|
151
|
+
|
152
|
+
milo further requires edger, statmod, and rpy2 to be installed:
|
153
|
+
|
154
|
+
```R
|
155
|
+
BiocManager::install("edgeR")
|
156
|
+
BiocManager::install("statmod")
|
157
|
+
```
|
142
158
|
|
143
159
|
```console
|
144
|
-
pip install
|
160
|
+
pip install rpy2
|
145
161
|
```
|
146
162
|
|
147
163
|
## Citation
|
148
164
|
|
149
|
-
|
150
|
-
|
165
|
+
```bibtex
|
166
|
+
@article {Heumos2024.08.04.606516,
|
167
|
+
author = {Heumos, Lukas and Ji, Yuge and May, Lilly and Green, Tessa and Zhang, Xinyue and Wu, Xichen and Ostner, Johannes and Peidli, Stefan and Schumacher, Antonia and Hrovatin, Karin and Müller, Michaela and Chong, Faye and Sturm, Gregor and Tejada, Alejandro and Dann, Emma and Dong, Mingze and Bahrami, Mojtaba and Gold, Ilan and Rybakov, Sergei and Namsaraeva, Altana and Moinfar, Amir and Zheng, Zihe and Roellin, Eljas and Mekki, Isra and Sander, Chris and Lotfollahi, Mohammad and Schiller, Herbert B. and Theis, Fabian J.},
|
168
|
+
title = {Pertpy: an end-to-end framework for perturbation analysis},
|
169
|
+
elocation-id = {2024.08.04.606516},
|
170
|
+
year = {2024},
|
171
|
+
doi = {10.1101/2024.08.04.606516},
|
172
|
+
publisher = {Cold Spring Harbor Laboratory},
|
173
|
+
URL = {https://www.biorxiv.org/content/early/2024/08/07/2024.08.04.606516},
|
174
|
+
eprint = {https://www.biorxiv.org/content/early/2024/08/07/2024.08.04.606516.full.pdf},
|
175
|
+
journal = {bioRxiv}
|
176
|
+
}
|
177
|
+
```
|
151
178
|
|
152
179
|
[pip]: https://pip.pypa.io/
|
153
180
|
[pypi]: https://pypi.org/
|
@@ -29,22 +29,50 @@ You can install _pertpy_ in less than a minute via [pip] from [PyPI]:
|
|
29
29
|
pip install pertpy
|
30
30
|
```
|
31
31
|
|
32
|
+
### Differential gene expression
|
33
|
+
|
34
|
+
If you want to use the differential gene expression interface, please install pertpy by running:
|
35
|
+
|
36
|
+
```console
|
37
|
+
pip install 'pertpy[de]'
|
38
|
+
```
|
39
|
+
|
40
|
+
### tascCODA
|
41
|
+
|
32
42
|
if you want to use tascCODA, please install pertpy as follows:
|
33
43
|
|
34
44
|
```console
|
35
45
|
pip install 'pertpy[tcoda]'
|
36
46
|
```
|
37
47
|
|
38
|
-
|
48
|
+
### milo
|
49
|
+
|
50
|
+
milo further requires edger, statmod, and rpy2 to be installed:
|
51
|
+
|
52
|
+
```R
|
53
|
+
BiocManager::install("edgeR")
|
54
|
+
BiocManager::install("statmod")
|
55
|
+
```
|
39
56
|
|
40
57
|
```console
|
41
|
-
pip install
|
58
|
+
pip install rpy2
|
42
59
|
```
|
43
60
|
|
44
61
|
## Citation
|
45
62
|
|
46
|
-
|
47
|
-
|
63
|
+
```bibtex
|
64
|
+
@article {Heumos2024.08.04.606516,
|
65
|
+
author = {Heumos, Lukas and Ji, Yuge and May, Lilly and Green, Tessa and Zhang, Xinyue and Wu, Xichen and Ostner, Johannes and Peidli, Stefan and Schumacher, Antonia and Hrovatin, Karin and Müller, Michaela and Chong, Faye and Sturm, Gregor and Tejada, Alejandro and Dann, Emma and Dong, Mingze and Bahrami, Mojtaba and Gold, Ilan and Rybakov, Sergei and Namsaraeva, Altana and Moinfar, Amir and Zheng, Zihe and Roellin, Eljas and Mekki, Isra and Sander, Chris and Lotfollahi, Mohammad and Schiller, Herbert B. and Theis, Fabian J.},
|
66
|
+
title = {Pertpy: an end-to-end framework for perturbation analysis},
|
67
|
+
elocation-id = {2024.08.04.606516},
|
68
|
+
year = {2024},
|
69
|
+
doi = {10.1101/2024.08.04.606516},
|
70
|
+
publisher = {Cold Spring Harbor Laboratory},
|
71
|
+
URL = {https://www.biorxiv.org/content/early/2024/08/07/2024.08.04.606516},
|
72
|
+
eprint = {https://www.biorxiv.org/content/early/2024/08/07/2024.08.04.606516.full.pdf},
|
73
|
+
journal = {bioRxiv}
|
74
|
+
}
|
75
|
+
```
|
48
76
|
|
49
77
|
[pip]: https://pip.pypa.io/
|
50
78
|
[pypi]: https://pypi.org/
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# About Pertpy
|
2
|
+
|
3
|
+
Pertpy is an end-to-end framework for the analysis of large-scale single-cell perturbation experiments.
|
4
|
+
It provides access to harmonized perturbation datasets and metadata databases along with numerous fast and user-friendly implementations of both established and novel methods such as automatic metadata annotation or perturbation distances to efficiently analyze perturbation data.
|
5
|
+
As part of the scverse ecosystem, pertpy interoperates with existing single-cell analysis libraries and is designed to be easily extended.
|
6
|
+
If you find pertpy useful for your research, please check out {doc}`cite`.
|
7
|
+
|
8
|
+
## Design principles
|
9
|
+
|
10
|
+
Our framework is based on three key principles: `Modularity`, `Flexibility`, and `Scalability`.
|
11
|
+
|
12
|
+
### Modularity
|
13
|
+
|
14
|
+
Pertpy includes modules for analysis of single and combinatorial perturbations covering diverse types of perturbation data including genetic knockouts, drug screens, and disease states.
|
15
|
+
The framework is designed for flexibility, offering more than 100 composable and interoperable analysis functions organized in modules which further ease downstream interpretation and visualization.
|
16
|
+
These modules host fundamental building blocks for implementation and methods that share functionality and can be chained into custom pipelines.
|
17
|
+
|
18
|
+
A typical Pertpy workflow consists of several steps:
|
19
|
+
|
20
|
+
* Initial **data transformation** such as guide RNA assignment for CRISPR screens
|
21
|
+
* **Quality control** to address confounding factors and technical variation
|
22
|
+
* **Metadata annotation** against ontologies and enrichment from databases
|
23
|
+
* **Perturbation space analysis** to learn biologically interpretable embeddings
|
24
|
+
* **Downstream analysis** including differential expression, compositional analysis, and distance calculation
|
25
|
+
|
26
|
+
This modular approach yields a powerful and flexible framework as many analysis steps can be independently applied or chained together.
|
27
|
+
|
28
|
+
### Flexibility
|
29
|
+
|
30
|
+
Pertpy is purpose-built to organize, analyze, and visualize complex perturbation datasets.
|
31
|
+
It is flexible and can be applied to datasets of different assays, data types, sizes, and perturbations, thereby unifying previous data-type- or assay-specific single-problem approaches.
|
32
|
+
Designed to integrate external metadata with measured data, it enables unprecedented contextualization of results through swiftly built, experiment-specific pipelines, leading to more robust outcomes.
|
33
|
+
|
34
|
+
The inputs to a typical analysis with pertpy are unimodal scRNA-seq or multimodal perturbation readouts stored in AnnData or MuData objects.
|
35
|
+
While pertpy is primarily designed to explore perturbations such as genetic modifications, drug treatments, exposure to pathogens, and other environmental conditions, its utility extends to various other perturbation settings, including diverse disease states where experimental perturbations have not been applied.
|
36
|
+
|
37
|
+
### Scalability
|
38
|
+
|
39
|
+
Pertpy addresses a wide array of use-cases and different types of growing datasets through its sparse and memory-efficient implementations, which leverage the parallelization and GPU acceleration library Jax, and numba, thereby making them substantially faster than original implementations.
|
40
|
+
The framework can be applied to datasets ranging from thousands to millions of cells.
|
41
|
+
|
42
|
+
For example, when analyzing CRISPR screens, Pertpy's implementation of Mixscape is optimized using PyNNDescent for nearest neighbor search during the calculation of perturbation signatures.
|
43
|
+
Other methods such as scCODA and tascCODA are accelerated by replacing the Hamiltonian Monte Carlo algorithm in TensorFlow with the no-U-turn sampler from numpyro.
|
44
|
+
CINEMA-OT is optimized with ott-jax to make the implementation portable across hardware, enabling GPU acceleration.
|
45
|
+
|
46
|
+
## Why is it called "Pertpy"?
|
47
|
+
|
48
|
+
Pertpy is named for its core purpose: The analysis of **pert**urbations in **Py**thon.
|
49
|
+
The framework unifies perturbation analysis approaches across different data types and experimental designs, providing a comprehensive solution for understanding cellular responses to various stimuli.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Citing pertpy
|
2
|
+
|
3
|
+
If you find pertpy useful for your research, please consider citing our work as follows:
|
4
|
+
|
5
|
+
```bibtex
|
6
|
+
@article {Heumos2024.08.04.606516,
|
7
|
+
author = {Heumos, Lukas and Ji, Yuge and May, Lilly and Green, Tessa and Zhang, Xinyue and Wu, Xichen and Ostner, Johannes and Peidli, Stefan and Schumacher, Antonia and Hrovatin, Karin and Müller, Michaela and Chong, Faye and Sturm, Gregor and Tejada, Alejandro and Dann, Emma and Dong, Mingze and Bahrami, Mojtaba and Gold, Ilan and Rybakov, Sergei and Namsaraeva, Altana and Moinfar, Amir and Zheng, Zihe and Roellin, Eljas and Mekki, Isra and Sander, Chris and Lotfollahi, Mohammad and Schiller, Herbert B. and Theis, Fabian J.},
|
8
|
+
title = {Pertpy: an end-to-end framework for perturbation analysis},
|
9
|
+
elocation-id = {2024.08.04.606516},
|
10
|
+
year = {2024},
|
11
|
+
doi = {10.1101/2024.08.04.606516},
|
12
|
+
publisher = {Cold Spring Harbor Laboratory},
|
13
|
+
URL = {https://www.biorxiv.org/content/early/2024/08/07/2024.08.04.606516},
|
14
|
+
eprint = {https://www.biorxiv.org/content/early/2024/08/07/2024.08.04.606516.full.pdf},
|
15
|
+
journal = {bioRxiv}
|
16
|
+
}
|
17
|
+
```
|
18
|
+
|
19
|
+
If you are using any previously published tool, please also cite the original publication.
|
20
|
+
All tool specific references can be found here: {doc}`../references`.
|
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
+
## v0.11.3
|
9
|
+
|
10
|
+
### 🧰 Maintenance
|
11
|
+
|
12
|
+
* Remove decoupler [#783]((https://github.com/scverse/pertpy/pull/783)) @Zethson
|
13
|
+
|
14
|
+
## v0.11.3
|
15
|
+
|
16
|
+
## 🚀 Features
|
17
|
+
|
18
|
+
* add about page [#770]((https://github.com/scverse/pertpy/pull/770)) @Zethson
|
19
|
+
* Simplify Metadata errors [#765]((https://github.com/scverse/pertpy/pull/765)) @Zethson
|
20
|
+
* Standardize scCODA plot palette interface [#773]((https://github.com/scverse/pertpy/pull/773)) @mschilli87
|
21
|
+
|
8
22
|
## v0.11.2
|
9
23
|
|
10
24
|
### 🚀 Features
|
@@ -128,6 +128,7 @@ nitpick_ignore = [
|
|
128
128
|
("py:class", "pertpy.tools._distances._distances.MeanVar"),
|
129
129
|
("py:class", "The requested data as a NumPy array."),
|
130
130
|
("py:class", "The full registry saved with the model"),
|
131
|
+
("py:class", "The requested data."),
|
131
132
|
("py:class", "Model with loaded state dictionaries."),
|
132
133
|
("py:class", "pertpy.tools.lazy_import.<locals>.Placeholder"),
|
133
134
|
]
|
@@ -46,7 +46,7 @@ It provides tools for harmonizing perturbation datasets, automating metadata ann
|
|
46
46
|
```
|
47
47
|
|
48
48
|
```{toctree}
|
49
|
-
:caption: 'General
|
49
|
+
:caption: 'General'
|
50
50
|
:hidden: true
|
51
51
|
:maxdepth: 1
|
52
52
|
|
@@ -58,7 +58,7 @@ references
|
|
58
58
|
```
|
59
59
|
|
60
60
|
```{toctree}
|
61
|
-
:caption: 'Gallery
|
61
|
+
:caption: 'Gallery'
|
62
62
|
:hidden: true
|
63
63
|
:maxdepth: 1
|
64
64
|
|
@@ -66,10 +66,32 @@ tutorials
|
|
66
66
|
usecases
|
67
67
|
```
|
68
68
|
|
69
|
+
```{toctree}
|
70
|
+
:caption: 'About'
|
71
|
+
:hidden: true
|
72
|
+
:maxdepth: 1
|
73
|
+
|
74
|
+
about/background
|
75
|
+
about/cite
|
76
|
+
GitHub <https://github.com/scverse/pertpy>
|
77
|
+
Discourse <https://discourse.scverse.org/c/ecosystem/pertpy/46>
|
78
|
+
```
|
79
|
+
|
69
80
|
## Citation
|
70
81
|
|
71
|
-
|
72
|
-
|
82
|
+
```bibtex
|
83
|
+
@article {Heumos2024.08.04.606516,
|
84
|
+
author = {Heumos, Lukas and Ji, Yuge and May, Lilly and Green, Tessa and Zhang, Xinyue and Wu, Xichen and Ostner, Johannes and Peidli, Stefan and Schumacher, Antonia and Hrovatin, Karin and Müller, Michaela and Chong, Faye and Sturm, Gregor and Tejada, Alejandro and Dann, Emma and Dong, Mingze and Bahrami, Mojtaba and Gold, Ilan and Rybakov, Sergei and Namsaraeva, Altana and Moinfar, Amir and Zheng, Zihe and Roellin, Eljas and Mekki, Isra and Sander, Chris and Lotfollahi, Mohammad and Schiller, Herbert B. and Theis, Fabian J.},
|
85
|
+
title = {Pertpy: an end-to-end framework for perturbation analysis},
|
86
|
+
elocation-id = {2024.08.04.606516},
|
87
|
+
year = {2024},
|
88
|
+
doi = {10.1101/2024.08.04.606516},
|
89
|
+
publisher = {Cold Spring Harbor Laboratory},
|
90
|
+
URL = {https://www.biorxiv.org/content/early/2024/08/07/2024.08.04.606516},
|
91
|
+
eprint = {https://www.biorxiv.org/content/early/2024/08/07/2024.08.04.606516.full.pdf},
|
92
|
+
journal = {bioRxiv}
|
93
|
+
}
|
94
|
+
```
|
73
95
|
|
74
96
|
## NumFOCUS
|
75
97
|
|
@@ -16,17 +16,9 @@ This is the preferred method to install pertpy, as it will always install the mo
|
|
16
16
|
|
17
17
|
If you don't have [pip] installed, this [Python installation guide] can guide you through the process.
|
18
18
|
|
19
|
-
|
19
|
+
### Additional dependency groups
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
TascCODA requires an additional set of dependencies (ete4, pyqt6, and toytree) that can be installed by running:
|
24
|
-
|
25
|
-
```console
|
26
|
-
pip install pertpy[tcoda]
|
27
|
-
```
|
28
|
-
|
29
|
-
## Differential gene expression interface
|
21
|
+
#### Differential gene expression interface
|
30
22
|
|
31
23
|
The DGE interface of pertpy requires additional dependencies that can be installed by running:
|
32
24
|
|
@@ -44,21 +36,25 @@ BiocManager::install("edgeR")
|
|
44
36
|
pip install rpy2
|
45
37
|
```
|
46
38
|
|
47
|
-
|
39
|
+
#### milo
|
48
40
|
|
49
|
-
|
50
|
-
Please note that you require [poetry] to be installed.
|
41
|
+
milo further requires edger, statmod, and rpy2 to be installed:
|
51
42
|
|
52
|
-
|
43
|
+
```R
|
44
|
+
BiocManager::install("edgeR")
|
45
|
+
BiocManager::install("statmod")
|
46
|
+
```
|
53
47
|
|
54
48
|
```console
|
55
|
-
|
49
|
+
pip install rpy2
|
56
50
|
```
|
57
51
|
|
58
|
-
|
52
|
+
#### tascCODA
|
53
|
+
|
54
|
+
TascCODA requires an additional set of dependencies (ete4, pyqt6, and toytree) that can be installed by running:
|
59
55
|
|
60
56
|
```console
|
61
|
-
|
57
|
+
pip install pertpy[tcoda]
|
62
58
|
```
|
63
59
|
|
64
60
|
## Apple Silicon
|
@@ -100,6 +96,22 @@ Follow these steps to install pertpy on an Apple Silicon machine (tested on a Ma
|
|
100
96
|
|
101
97
|
Now you're ready to use pertpy as usual within the environment (`import pertpy`).
|
102
98
|
|
99
|
+
## From sources
|
100
|
+
|
101
|
+
The sources for pertpy can be downloaded from the [Github repo].
|
102
|
+
|
103
|
+
You can either clone the public repository:
|
104
|
+
|
105
|
+
```console
|
106
|
+
$ git clone git://github.com/scverse/pertpy
|
107
|
+
```
|
108
|
+
|
109
|
+
Or download the [tarball]:
|
110
|
+
|
111
|
+
```console
|
112
|
+
$ curl -OJL https://github.com/scverse/pertpy/tarball/master
|
113
|
+
```
|
114
|
+
|
103
115
|
[github repo]: https://github.com/scverse/pertpy
|
104
116
|
[pip]: https://pip.pypa.io
|
105
117
|
[poetry]: https://python-poetry.org/
|
@@ -16,7 +16,7 @@ from jax import config, random
|
|
16
16
|
from lamin_utils import logger
|
17
17
|
from matplotlib import cm, rcParams
|
18
18
|
from matplotlib import image as mpimg
|
19
|
-
from matplotlib.colors import
|
19
|
+
from matplotlib.colors import Colormap
|
20
20
|
from mudata import MuData
|
21
21
|
from numpyro.infer import HMC, MCMC, NUTS, initialization
|
22
22
|
from rich import box, print
|
@@ -34,7 +34,6 @@ if TYPE_CHECKING:
|
|
34
34
|
from ete4 import Tree
|
35
35
|
from jax._src.typing import Array
|
36
36
|
from matplotlib.axes import Axes
|
37
|
-
from matplotlib.colors import Colormap
|
38
37
|
from matplotlib.figure import Figure
|
39
38
|
|
40
39
|
config.update("jax_enable_x64", True)
|
@@ -1141,7 +1140,7 @@ class CompositionalModel2(ABC):
|
|
1141
1140
|
level_names: list[str],
|
1142
1141
|
figsize: tuple[float, float] | None = None,
|
1143
1142
|
dpi: int | None = 100,
|
1144
|
-
palette:
|
1143
|
+
palette: str | Colormap | None = cm.tab20,
|
1145
1144
|
show_legend: bool | None = True,
|
1146
1145
|
) -> plt.Axes:
|
1147
1146
|
"""Plots a stacked barplot for one (discrete) covariate.
|
@@ -1156,12 +1155,15 @@ class CompositionalModel2(ABC):
|
|
1156
1155
|
level_names: Names of the covariate's levels
|
1157
1156
|
figsize: Figure size (matplotlib).
|
1158
1157
|
dpi: Resolution in DPI (matplotlib).
|
1159
|
-
palette: The color map for the barplot.
|
1158
|
+
palette: The color map (name) for the barplot.
|
1160
1159
|
show_legend: If True, adds a legend.
|
1161
1160
|
|
1162
1161
|
Returns:
|
1163
1162
|
A :class:`~matplotlib.axes.Axes` object
|
1164
1163
|
"""
|
1164
|
+
if isinstance(palette, str):
|
1165
|
+
palette = getattr(cm, palette)
|
1166
|
+
|
1165
1167
|
n_bars, n_types = y.shape
|
1166
1168
|
|
1167
1169
|
figsize = rcParams["figure.figsize"] if figsize is None else figsize
|
@@ -1202,7 +1204,7 @@ class CompositionalModel2(ABC):
|
|
1202
1204
|
feature_name: str,
|
1203
1205
|
*,
|
1204
1206
|
modality_key: str = "coda",
|
1205
|
-
palette:
|
1207
|
+
palette: str | Colormap | None = cm.tab20,
|
1206
1208
|
show_legend: bool | None = True,
|
1207
1209
|
level_order: list[str] = None,
|
1208
1210
|
figsize: tuple[float, float] | None = None,
|
@@ -1217,7 +1219,7 @@ class CompositionalModel2(ABC):
|
|
1217
1219
|
modality_key: If data is a MuData object, specify which modality to use.
|
1218
1220
|
figsize: Figure size.
|
1219
1221
|
dpi: Dpi setting.
|
1220
|
-
palette: The matplotlib color map for the barplot.
|
1222
|
+
palette: The matplotlib color map (name) for the barplot.
|
1221
1223
|
show_legend: If True, adds a legend.
|
1222
1224
|
level_order: Custom ordering of bars on the x-axis.
|
1223
1225
|
{common_plot_args}
|
@@ -1299,7 +1301,7 @@ class CompositionalModel2(ABC):
|
|
1299
1301
|
plot_facets: bool = True,
|
1300
1302
|
plot_zero_covariate: bool = True,
|
1301
1303
|
plot_zero_cell_type: bool = False,
|
1302
|
-
palette: str |
|
1304
|
+
palette: str | Colormap | None = cm.tab20,
|
1303
1305
|
level_order: list[str] = None,
|
1304
1306
|
args_barplot: dict | None = None,
|
1305
1307
|
figsize: tuple[float, float] | None = None,
|
@@ -1321,7 +1323,7 @@ class CompositionalModel2(ABC):
|
|
1321
1323
|
plot_zero_cell_type: If True, plot cell type that have zero effect. If False, do not plot.
|
1322
1324
|
figsize: Figure size.
|
1323
1325
|
dpi: Figure size.
|
1324
|
-
palette: The seaborn color map for the barplot.
|
1326
|
+
palette: The seaborn color map (name) for the barplot.
|
1325
1327
|
level_order: Custom ordering of bars on the x-axis.
|
1326
1328
|
args_barplot: Arguments passed to sns.barplot.
|
1327
1329
|
{common_plot_args}
|
@@ -1397,7 +1399,7 @@ class CompositionalModel2(ABC):
|
|
1397
1399
|
|
1398
1400
|
# If plot as facets, create a FacetGrid and map barplot to it.
|
1399
1401
|
if plot_facets:
|
1400
|
-
if isinstance(palette,
|
1402
|
+
if isinstance(palette, Colormap):
|
1401
1403
|
palette = np.array([palette(i % palette.N) for i in range(len(plot_df["Cell Type"].unique()))]).tolist()
|
1402
1404
|
if figsize is not None:
|
1403
1405
|
height = figsize[0]
|
@@ -1437,7 +1439,7 @@ class CompositionalModel2(ABC):
|
|
1437
1439
|
else:
|
1438
1440
|
_, ax = plt.subplots(figsize=figsize, dpi=dpi)
|
1439
1441
|
if len(covariate_names) == 1:
|
1440
|
-
if isinstance(palette,
|
1442
|
+
if isinstance(palette, Colormap):
|
1441
1443
|
palette = np.array(
|
1442
1444
|
[palette(i % palette.N) for i in range(len(plot_df["Cell Type"].unique()))]
|
1443
1445
|
).tolist()
|
@@ -1451,7 +1453,7 @@ class CompositionalModel2(ABC):
|
|
1451
1453
|
)
|
1452
1454
|
ax.set_title(covariate_names[0])
|
1453
1455
|
else:
|
1454
|
-
if isinstance(palette,
|
1456
|
+
if isinstance(palette, Colormap):
|
1455
1457
|
palette = np.array([palette(i % palette.N) for i in range(len(covariate_names))]).tolist()
|
1456
1458
|
sns.barplot(
|
1457
1459
|
data=plot_df,
|
@@ -1485,7 +1487,7 @@ class CompositionalModel2(ABC):
|
|
1485
1487
|
cell_types: list | None = None,
|
1486
1488
|
args_boxplot: dict | None = None,
|
1487
1489
|
args_swarmplot: dict | None = None,
|
1488
|
-
palette: str | None = "Blues",
|
1490
|
+
palette: str | Colormap | None = "Blues",
|
1489
1491
|
show_legend: bool | None = True,
|
1490
1492
|
level_order: list[str] = None,
|
1491
1493
|
figsize: tuple[float, float] | None = None,
|
@@ -1510,7 +1512,7 @@ class CompositionalModel2(ABC):
|
|
1510
1512
|
args_swarmplot: Arguments passed to sns.swarmplot.
|
1511
1513
|
figsize: Figure size.
|
1512
1514
|
dpi: Dpi setting.
|
1513
|
-
palette: The seaborn color map for the barplot.
|
1515
|
+
palette: The seaborn color map (name) for the barplot.
|
1514
1516
|
show_legend: If True, adds a legend.
|
1515
1517
|
level_order: Custom ordering of bars on the x-axis.
|
1516
1518
|
{common_plot_args}
|
@@ -1535,6 +1537,8 @@ class CompositionalModel2(ABC):
|
|
1535
1537
|
args_swarmplot = {}
|
1536
1538
|
if isinstance(data, MuData):
|
1537
1539
|
data = data[modality_key]
|
1540
|
+
if isinstance(palette, Colormap):
|
1541
|
+
palette = palette(range(2))
|
1538
1542
|
|
1539
1543
|
# y scale transformations
|
1540
1544
|
if y_scale == "relative":
|
@@ -2104,7 +2108,7 @@ class CompositionalModel2(ABC):
|
|
2104
2108
|
modality_key_1: str = "rna",
|
2105
2109
|
modality_key_2: str = "coda",
|
2106
2110
|
color_map: Colormap | str | None = None,
|
2107
|
-
palette: str | Sequence[str] | None = None,
|
2111
|
+
palette: str | Sequence[str] | Colormap | None = None,
|
2108
2112
|
ax: Axes = None,
|
2109
2113
|
return_fig: bool = False,
|
2110
2114
|
**kwargs,
|
@@ -2122,7 +2126,7 @@ class CompositionalModel2(ABC):
|
|
2122
2126
|
modality_key_1: Key to the cell-level AnnData in the MuData object.
|
2123
2127
|
modality_key_2: Key to the aggregated sample-level AnnData object in the MuData object.
|
2124
2128
|
color_map: The color map to use for plotting.
|
2125
|
-
palette: The color palette to use for plotting.
|
2129
|
+
palette: The color palette (name) to use for plotting.
|
2126
2130
|
ax: A matplotlib axes object. Only works if plotting a single component.
|
2127
2131
|
{common_plot_args}
|
2128
2132
|
**kwargs: All other keyword arguments are passed to `scanpy.plot.umap()`
|
@@ -2154,9 +2158,6 @@ class CompositionalModel2(ABC):
|
|
2154
2158
|
>>> tasccoda_model.run_nuts(
|
2155
2159
|
... tasccoda_data, modality_key="coda", rng_key=1234, num_samples=10000, num_warmup=1000
|
2156
2160
|
... )
|
2157
|
-
>>> tasccoda_model.run_nuts(
|
2158
|
-
... tasccoda_data, modality_key="coda", rng_key=1234, num_samples=10000, num_warmup=1000
|
2159
|
-
... )
|
2160
2161
|
>>> sc.tl.umap(tasccoda_data["rna"])
|
2161
2162
|
>>> tasccoda_model.plot_effects_umap(tasccoda_data,
|
2162
2163
|
>>> effect_name=["effect_df_condition[T.Salmonella]",
|
@@ -2173,6 +2174,10 @@ class CompositionalModel2(ABC):
|
|
2173
2174
|
data_coda = mdata[modality_key_2]
|
2174
2175
|
if isinstance(effect_name, str):
|
2175
2176
|
effect_name = [effect_name]
|
2177
|
+
if isinstance(palette, Colormap):
|
2178
|
+
palette = {
|
2179
|
+
cluster: palette(i % palette.N) for i, cluster in enumerate(data_rna.obs[cluster_key].unique().tolist())
|
2180
|
+
}
|
2176
2181
|
for _, effect in enumerate(effect_name):
|
2177
2182
|
data_rna.obs[effect] = [data_coda.varm[effect].loc[f"{c}", "Effect"] for c in data_rna.obs[cluster_key]]
|
2178
2183
|
if kwargs.get("vmin"):
|
@@ -80,7 +80,7 @@ class Dialogue:
|
|
80
80
|
Returns:
|
81
81
|
A Pandas DataFrame of pseudobulk counts
|
82
82
|
"""
|
83
|
-
# TODO: Replace with
|
83
|
+
# TODO: Replace with scanpy get implementation
|
84
84
|
pseudobulk = {"Genes": adata.var_names.values}
|
85
85
|
|
86
86
|
for category in adata.obs.loc[:, groupby].cat.categories:
|
@@ -572,9 +572,7 @@ class MethodBase(ABC):
|
|
572
572
|
if any(adata.obs[[groupby, pairedby]].value_counts() > 1):
|
573
573
|
logger.info("Performing pseudobulk for paired samples")
|
574
574
|
ps = PseudobulkSpace()
|
575
|
-
adata = ps.compute(
|
576
|
-
adata, target_col=groupby, groups_col=pairedby, layer_key=layer, mode="sum", min_cells=1, min_counts=1
|
577
|
-
)
|
575
|
+
adata = ps.compute(adata, target_col=groupby, groups_col=pairedby, layer_key=layer, mode="sum")
|
578
576
|
|
579
577
|
X = adata.layers[layer] if layer is not None else adata.X
|
580
578
|
with contextlib.suppress(AttributeError):
|