pertpy 0.9.4__tar.gz → 0.9.5__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {pertpy-0.9.4 → pertpy-0.9.5}/.github/release-drafter.yml +2 -2
- {pertpy-0.9.4 → pertpy-0.9.5}/.github/workflows/release.yml +2 -2
- {pertpy-0.9.4 → pertpy-0.9.5}/.github/workflows/test.yml +7 -7
- {pertpy-0.9.4 → pertpy-0.9.5}/.gitignore +11 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/.pre-commit-config.yaml +1 -1
- pertpy-0.9.5/.readthedocs.yml +18 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/PKG-INFO +5 -5
- pertpy-0.9.5/docs/_static/docstring_previews/de_fold_change.png +0 -0
- pertpy-0.9.5/docs/_static/docstring_previews/de_multicomparison_fc.png +0 -0
- pertpy-0.9.5/docs/_static/docstring_previews/de_paired_expression.png +0 -0
- pertpy-0.9.5/docs/_static/docstring_previews/de_volcano.png +0 -0
- pertpy-0.9.5/docs/_static/docstring_previews/pseudobulk_samples.png +0 -0
- pertpy-0.9.5/docs/_static/tutorials/mcfarland.png +0 -0
- pertpy-0.9.5/docs/_static/tutorials/norman.png +0 -0
- pertpy-0.9.5/docs/_static/tutorials/zhang.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/conf.py +3 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/tutorials/index.md +28 -5
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/__init__.py +1 -1
- pertpy-0.9.5/pertpy/_doc.py +20 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/data/_datasets.py +1 -1
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/metadata/_cell_line.py +19 -7
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/metadata/_compound.py +3 -4
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/metadata/_metadata.py +1 -1
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/preprocessing/_guide_rna.py +19 -6
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/__init__.py +1 -1
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_augur.py +36 -46
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_cinemaot.py +23 -17
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_coda/_base_coda.py +87 -106
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_dialogue.py +17 -21
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_differential_gene_expression/__init__.py +1 -2
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_differential_gene_expression/_base.py +495 -113
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_differential_gene_expression/_edger.py +30 -21
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_differential_gene_expression/_pydeseq2.py +15 -29
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_differential_gene_expression/_statsmodels.py +0 -11
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_distances/_distances.py +15 -8
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_enrichment.py +18 -8
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_milo.py +58 -46
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_mixscape.py +111 -100
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_perturbation_space/_perturbation_space.py +40 -31
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_perturbation_space/_simple.py +50 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_scgen/_scgen.py +35 -25
- {pertpy-0.9.4 → pertpy-0.9.5}/pyproject.toml +20 -7
- pertpy-0.9.5/tests/tools/_differential_gene_expression/test_edger.py +62 -0
- pertpy-0.9.5/tests/tools/_differential_gene_expression/test_pydeseq2.py +65 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/_distances/test_distances.py +3 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/_perturbation_space/test_simple_perturbation_space.py +10 -2
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/test_augur.py +1 -2
- pertpy-0.9.4/.readthedocs.yml +0 -23
- pertpy-0.9.4/pertpy/tools/_differential_gene_expression/_formulaic.py +0 -189
- pertpy-0.9.4/tests/tools/_differential_gene_expression/test_edger.py +0 -33
- pertpy-0.9.4/tests/tools/_differential_gene_expression/test_formulaic.py +0 -208
- pertpy-0.9.4/tests/tools/_differential_gene_expression/test_pydeseq2.py +0 -33
- {pertpy-0.9.4 → pertpy-0.9.5}/.editorconfig +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/.gitattributes +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/.github/labels.yml +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/.github/pull_request_template.md +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/.github/workflows/build.yml +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/.github/workflows/labeler.yml +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/.github/workflows/release_drafter.yml +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/.gitmodules +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/CODE_OF_CONDUCT.md +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/LICENSE +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/README.md +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/codecov.yml +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/Makefile +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_ext/edit_on_github.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_ext/typed_returns.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/SCVI_LICENSE +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/css/overwrite.css +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/css/sphinx_gallery.css +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/docstring_previews/augur_dp_scatter.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/docstring_previews/augur_important_features.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/docstring_previews/augur_lollipop.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/docstring_previews/augur_scatterplot.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/docstring_previews/dialogue_pairplot.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/docstring_previews/dialogue_violin.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/docstring_previews/enrichment_dotplot.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/docstring_previews/enrichment_gsea.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/docstring_previews/milo_da_beeswarm.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/docstring_previews/milo_nhood.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/docstring_previews/milo_nhood_graph.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/docstring_previews/mixscape_barplot.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/docstring_previews/mixscape_heatmap.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/docstring_previews/mixscape_lda.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/docstring_previews/mixscape_perturbscore.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/docstring_previews/mixscape_violin.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/docstring_previews/sccoda_boxplots.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/docstring_previews/sccoda_effects_barplot.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/docstring_previews/sccoda_rel_abundance_dispersion_plot.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/docstring_previews/sccoda_stacked_barplot.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/docstring_previews/scgen_reg_mean.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/docstring_previews/tasccoda_draw_effects.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/docstring_previews/tasccoda_draw_tree.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/docstring_previews/tasccoda_effects_umap.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/icons/code-24px.svg +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/icons/computer-24px.svg +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/icons/library_books-24px.svg +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/icons/play_circle_outline-24px.svg +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/placeholder.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/tutorials/augur.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/tutorials/cinemaot.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/tutorials/dge.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/tutorials/dialogue.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/tutorials/distances.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/tutorials/distances_tests.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/tutorials/enrichment.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/tutorials/guide_rna_assignment.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/tutorials/metadata.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/tutorials/milo.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/tutorials/mixscape.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/tutorials/ontology.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/tutorials/perturbation_space.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/tutorials/placeholder.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/tutorials/sccoda.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/tutorials/sccoda_extended.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/tutorials/scgen_perturbation_prediction.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_static/tutorials/tasccoda.png +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_templates/autosummary/class.rst +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/_templates/class_no_inherited.rst +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/code_of_conduct.md +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/contributing.md +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/index.md +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/installation.md +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/make.bat +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/references.bib +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/references.md +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/usage/usage.md +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/docs/utils.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/data/__init__.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/data/_dataloader.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/metadata/__init__.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/metadata/_drug.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/metadata/_look_up.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/metadata/_moa.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/plot/__init__.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/preprocessing/__init__.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/py.typed +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_coda/__init__.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_coda/_sccoda.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_coda/_tasccoda.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_differential_gene_expression/_checks.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_differential_gene_expression/_dge_comparison.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_differential_gene_expression/_simple_tests.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_distances/__init__.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_distances/_distance_tests.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_kernel_pca.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_perturbation_space/__init__.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_perturbation_space/_clustering.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_perturbation_space/_comparison.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_perturbation_space/_discriminator_classifiers.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_perturbation_space/_metrics.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_scgen/__init__.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_scgen/_base_components.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_scgen/_scgenvae.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/_scgen/_utils.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/decoupler_LICENSE +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/pertpy/tools/transferlearning_MMD_LICENSE +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/conftest.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/metadata/test_cell_line.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/metadata/test_compound.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/metadata/test_drug.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/metadata/test_moa.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/preprocessing/test_grna_assignment.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/_coda/test_sccoda.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/_coda/test_tasccoda.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/_differential_gene_expression/__init__.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/_differential_gene_expression/conftest.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/_differential_gene_expression/test_base.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/_differential_gene_expression/test_compare_groups.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/_differential_gene_expression/test_dge.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/_differential_gene_expression/test_input_checks.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/_differential_gene_expression/test_simple_tests.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/_differential_gene_expression/test_statsmodels.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/_distances/test_distance_tests.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/_perturbation_space/test_comparison.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/_perturbation_space/test_discriminator_classifiers.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/_perturbation_space/test_simple_cluster_space.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/haber_data.csv +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/r_result.csv +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/test_cinemaot.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/test_dialogue.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/test_enrichment.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/test_milo.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/test_mixscape.py +0 -0
- {pertpy-0.9.4 → pertpy-0.9.5}/tests/tools/test_scgen.py +0 -0
@@ -13,10 +13,10 @@ jobs:
|
|
13
13
|
- name: Checkout code
|
14
14
|
uses: actions/checkout@v4
|
15
15
|
|
16
|
-
- name: Set up Python 3.
|
16
|
+
- name: Set up Python 3.12
|
17
17
|
uses: actions/setup-python@v5
|
18
18
|
with:
|
19
|
-
python-version: "3.
|
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
|
-
#
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
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-
|
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.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: pertpy
|
3
|
-
Version: 0.9.
|
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,9 +44,8 @@ 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:
|
47
|
+
Requires-Python: <3.13,>=3.10
|
48
48
|
Requires-Dist: adjusttext
|
49
|
-
Requires-Dist: anndata<0.10.9
|
50
49
|
Requires-Dist: blitzgsea
|
51
50
|
Requires-Dist: decoupler
|
52
51
|
Requires-Dist: lamin-utils
|
@@ -69,7 +68,8 @@ Requires-Dist: pyqt5; extra == 'coda'
|
|
69
68
|
Requires-Dist: toytree; extra == 'coda'
|
70
69
|
Provides-Extra: de
|
71
70
|
Requires-Dist: formulaic; extra == 'de'
|
72
|
-
Requires-Dist:
|
71
|
+
Requires-Dist: formulaic-contrasts>=0.2.0; extra == 'de'
|
72
|
+
Requires-Dist: pydeseq2>=v0.5.0pre1; extra == 'de'
|
73
73
|
Provides-Extra: dev
|
74
74
|
Requires-Dist: pre-commit; extra == 'dev'
|
75
75
|
Provides-Extra: doc
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -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
|
}
|
@@ -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
|
-
|
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::
|
@@ -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
|
+
"""
|
@@ -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/
|
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,
|
@@ -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
|
342
|
-
"Ensure that you are using one of the available query IDs present in the adata.obs for the annotation
|
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
|
360
|
-
"
|
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
|
-
|
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
|
-
|
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
|
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.
|
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
|
-
) ->
|
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
|
-
|
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
|
-
|
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
|
-
|
197
|
+
if show:
|
198
|
+
plt.show()
|
199
|
+
if return_fig:
|
200
|
+
return fig
|
201
|
+
return None
|
@@ -46,7 +46,7 @@ Sccoda = lazy_import("pertpy.tools._coda._sccoda", "Sccoda", CODA_EXTRAS)
|
|
46
46
|
Tasccoda = lazy_import("pertpy.tools._coda._tasccoda", "Tasccoda", CODA_EXTRAS)
|
47
47
|
|
48
48
|
DE_EXTRAS = ["formulaic", "pydeseq2"]
|
49
|
-
EdgeR = lazy_import("pertpy.tools._differential_gene_expression", "EdgeR", DE_EXTRAS)
|
49
|
+
EdgeR = lazy_import("pertpy.tools._differential_gene_expression", "EdgeR", DE_EXTRAS) # edgeR will be imported via rpy2
|
50
50
|
PyDESeq2 = lazy_import("pertpy.tools._differential_gene_expression", "PyDESeq2", DE_EXTRAS)
|
51
51
|
Statsmodels = lazy_import("pertpy.tools._differential_gene_expression", "Statsmodels", DE_EXTRAS + ["statsmodels"])
|
52
52
|
TTest = lazy_import("pertpy.tools._differential_gene_expression", "TTest", DE_EXTRAS)
|