Skip to content

Conversation

@grst
Copy link
Collaborator

@grst grst commented Dec 1, 2024

PR Checklist

  • Referenced issue is linked
  • If you've fixed a bug or added code that should be tested, add tests!
  • Documentation in docs is updated

Description of changes

Technical details

Additional context

Close #610

@Zethson
Copy link
Member

Zethson commented Dec 2, 2024

@grst I'll fix the unrelated tests soon. Sorry about them + the currently uber slow CI.

@grst grst marked this pull request as ready for review December 26, 2024 12:23
@grst grst requested review from Zethson and emdann December 26, 2024 12:25
@grst
Copy link
Collaborator Author

grst commented Dec 26, 2024

What's left is to update the differential expression tutorial to use a numeric contrast vector instead of a tuple of strings, i.e.

-res_df = pds2.test_contrasts(["Treatment", "Chemo", "Anti-PD-L1+Chemo"])
+res_df = pds2.test_contrasts(pds2.contrast(column="Treatment", baseline="Chemo", group_to_compare="Anti-PD-L1+Chemo"))

I tried a bit, but rerunning the tutorial with edgeR and rpy2 is a huge rabbit hole.

Copy link
Member

@emdann emdann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I've pushed some edits to pass the rpy2/edgeR tests #692

The main thing to work on seems to be the documentation, e.g. is this still accurate?

def test_contrasts(self, contrasts, **kwargs):
"""
Perform a comparison as specified in a contrast vector.
Args:
contrasts: Either a numeric contrast vector, or a dictionary of numeric contrast vectors.
**kwargs: passed to the respective implementation.
Returns:
A dataframe with the results.
"""

Also typing in base functions like test_contrasts and compare_groups would be helpful.

@emdann
Copy link
Member

emdann commented Jan 3, 2025

I'm gonna have a go at editing the tutorial.

@emdann
Copy link
Member

emdann commented Jan 4, 2025

One small note: I noticed that the model doesn't complain if you try to specify a complex interaction contrast on a model that wasn't fit with the interaction in the design, but just throws nonsense results.

Following example from the tutorial:

# Exclude patient with progressive disease, or not full rank for interaction
pdata2 = pdata[pdata.obs['Efficacy'] != 'PD'].copy()

# Bad design definition without interaction
pds2 = pt.tl.PyDESeq2(adata=pdata2, design="~ Efficacy + Treatment")
pds2.fit()

interaction_contrast = (
    pds2.cond(Treatment="Chemo", Efficacy="PR") - pds2.cond(Treatment="Chemo", Efficacy="SD")
) - (
    pds2.cond(Treatment="Anti-PD-L1+Chemo", Efficacy="PR") - pds2.cond(Treatment="Anti-PD-L1+Chemo", Efficacy="SD")
)
res_df = pds2.test_contrasts(contrasts=interaction_contrast)

No complaint, but the results are broken:

Log2 fold change & Wald test p-value, contrast vector: [0. 0. 0.]
           baseMean  log2FoldChange  lfcSE  stat  pvalue  padj
A1BG      16.408605             0.0    0.0   NaN     NaN   NaN
A1BG-AS1   1.958737             0.0    0.0   NaN     NaN   NaN
A1CF       0.002053             0.0    0.0   NaN     NaN   NaN
A2M       30.296881             0.0    0.0   NaN     NaN   NaN
A2M-AS1    0.557092             0.0    0.0   NaN     NaN   NaN
...             ...             ...    ...   ...     ...   ...
ZXDC       6.114098             0.0    0.0   NaN     NaN   NaN
ZYG11A     0.093600             0.0    0.0   NaN     NaN   NaN
ZYG11B     3.404941             0.0    0.0   NaN     NaN   NaN
ZYX       77.175203             0.0    0.0   NaN     NaN   NaN
ZZEF1      9.752162             0.0    0.0   NaN     NaN   NaN

While results make sense if I specify the design properly pds2 = pt.tl.PyDESeq2(adata=pdata2, design="~ Efficacy + Treatment + Efficacy*Treatment").

Do we want this to happen? Can we add an informative error if the contrast vector is all zeros?

emdann and others added 4 commits January 4, 2025 09:54
* fix broken rpy2 edger tests

* updated edger tests
Signed-off-by: zethson <lukas.heumos@posteo.net>
Signed-off-by: zethson <lukas.heumos@posteo.net>
Signed-off-by: zethson <lukas.heumos@posteo.net>
Copy link
Member

@Zethson Zethson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<3 looks great!

Signed-off-by: zethson <lukas.heumos@posteo.net>
@github-actions github-actions bot added the chore label Jan 4, 2025
@Zethson
Copy link
Member

Zethson commented Jan 4, 2025

@emdann I added type hints as you requested above and updated the submodule to have your tutorial changes as well. With passing CI (I work on it), I am happy to merge this now.

@codecov-commenter
Copy link

codecov-commenter commented Jan 4, 2025

Codecov Report

Attention: Patch coverage is 86.84211% with 5 lines in your changes missing coverage. Please review.

Project coverage is 64.85%. Comparing base (9bba130) to head (a312bd0).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...ertpy/tools/_differential_gene_expression/_base.py 80.00% 3 Missing ⚠️
...y/tools/_differential_gene_expression/_pydeseq2.py 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #682      +/-   ##
==========================================
- Coverage   65.56%   64.85%   -0.72%     
==========================================
  Files          47       46       -1     
  Lines        6105     5992     -113     
==========================================
- Hits         4003     3886     -117     
- Misses       2102     2106       +4     
Files with missing lines Coverage Δ
...py/tools/_differential_gene_expression/__init__.py 100.00% <100.00%> (ø)
...rtpy/tools/_differential_gene_expression/_edger.py 84.84% <100.00%> (-2.25%) ⬇️
...ools/_differential_gene_expression/_statsmodels.py 100.00% <ø> (ø)
pertpy/tools/_distances/_distances.py 89.96% <100.00%> (-0.07%) ⬇️
pertpy/tools/_milo.py 61.75% <100.00%> (ø)
pertpy/tools/_mixscape.py 79.12% <100.00%> (ø)
...y/tools/_differential_gene_expression/_pydeseq2.py 92.30% <75.00%> (-1.03%) ⬇️
...ertpy/tools/_differential_gene_expression/_base.py 24.84% <80.00%> (-7.49%) ⬇️

@Zethson
Copy link
Member

Zethson commented Jan 4, 2025

Merging now. Making a release as well. @emdann I'll create an issue for your concern above.

@Zethson Zethson merged commit e43d8ff into main Jan 4, 2025
5 checks passed
stefanpeidli added a commit that referenced this pull request Feb 7, 2025
* Set legend anchor as parameter (#660)

* Fix missing space

* Remove explicit anndata in dependencies (#666)

* Incorporate use case tutorials (#665)

* Fixed DEG layer retrieval

* Use-case tutorial icons

* Restructure tutorial page

* Subgroup tutorials

* Improve KNN label_transfer in PerturbationSpace (#658)

* Add uncertainty score in KNN label_transfer in PerturbationSpace
Certainty is quantified as the fraction of nearest neighbors belonging to the classified (i.e. the most abundant) label compared to the total number of nearest neighbors.

* Update pre-commit-config.yaml
Replaces yanked dependency of mypy "types-pkg-resources" with "types-setuptools" as recommended: https://pypi.org/project/types-pkg-resources/

* Improve label imputation in PerturbationSpace class
Key changes:
- Now uses KNN graph in adata: saves cost and increases consistency
- Vectorized operations instead of expensive for loop
- Distance weighting for KNN imputation
- Quantifies uncertainty as local KNN label entropy

* Fixed plotting for mixscape.plot_barplot and sccoda.plot_effects_barplot (#667)

* Augur scsim warnings (#670)

* Augur scsim warnings

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Submodules

Signed-off-by: zethson <lukas.heumos@posteo.net>

---------

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Add PerturbationDataValidator (#672)

* Augur scsim warnings

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Submodules

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Add super draft of pertpy validator

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Polish

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Polish

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Nested try

Signed-off-by: zethson <lukas.heumos@posteo.net>

* validator in test

Signed-off-by: zethson <lukas.heumos@posteo.net>

* try uv for rtd

Signed-off-by: zethson <lukas.heumos@posteo.net>

* rtd uv

Signed-off-by: zethson <lukas.heumos@posteo.net>

* rtd uv

Signed-off-by: zethson <lukas.heumos@posteo.net>

* rtd uv fix

Signed-off-by: zethson <lukas.heumos@posteo.net>

* mb sphinx fix for validator

Signed-off-by: zethson <lukas.heumos@posteo.net>

* docs

Signed-off-by: zethson <lukas.heumos@posteo.net>

* remove PerturbationValidator from docs

Signed-off-by: zethson <lukas.heumos@posteo.net>

* remove PerturbationValidator from docs

Signed-off-by: zethson <lukas.heumos@posteo.net>

---------

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Latest OS for RTD

* Remove curator again

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Fix jax random array (#686)

* Fix jax random array

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Fix further jax warnings

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Fix edger

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Fix choice

Signed-off-by: zethson <lukas.heumos@posteo.net>

---------

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Switch to formulaic-contrasts (#682)

* Switch to formulaic-contrasts

* Cleanup

* removing design matrix workaround (#691)

Co-authored-by: Emma Dann <emmadann@comino.stanford.edu>

* Fix PyDESeq2

* Update tests

* fix typo in gitignore

* Remove contrast dataclass, which isnt used anywhere

* Fix edgeR rpy2 tests (#692)

* fix broken rpy2 edger tests

* updated edger tests

* Fix tests (scipy)

Signed-off-by: zethson <lukas.heumos@posteo.net>

* submodule

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Remove unused code

Signed-off-by: zethson <lukas.heumos@posteo.net>

* type hints

Signed-off-by: zethson <lukas.heumos@posteo.net>

---------

Signed-off-by: zethson <lukas.heumos@posteo.net>
Co-authored-by: Emma Dann <32264060+emdann@users.noreply.github.com>
Co-authored-by: Emma Dann <emmadann@comino.stanford.edu>
Co-authored-by: zethson <lukas.heumos@posteo.net>

* Release 0.9.5

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Prepare 0.10.0

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Added Mixscape seeds and test (#683)

Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net>

* Fix probability data type (#696)

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Optimize MeanVarDistributionDistance (#697)

* Fix probability data type

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Optimize mean_var distance

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

---------

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Optimize test speed (#699)

* Try buildjet

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Try buildjet large

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* speed up predict_differential_prioritization

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* speed up tests

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

---------

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Lower bound for scikit-learn (#701)

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Fix type annotation

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Fix empty figure returns when show=True in plotting functions (#703)

* Removed show parameter

* Adapt plotting API for Augur, Coda, Dialogue

* Adapted plotting API for Milo, Mixscape, scgen

* Add joblib

* Remove joblib

---------

Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net>

* Fix scikit-learn intendation

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

---------

Signed-off-by: zethson <lukas.heumos@posteo.net>
Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>
Co-authored-by: Lilly May <93096564+Lilly-May@users.noreply.github.com>
Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net>
Co-authored-by: Gregor Sturm <mail@gregor-sturm.de>
Co-authored-by: Emma Dann <32264060+emdann@users.noreply.github.com>
Co-authored-by: Emma Dann <emmadann@comino.stanford.edu>
stefanpeidli added a commit that referenced this pull request Feb 7, 2025
* Set legend anchor as parameter (#660)

* Fix missing space

* Remove explicit anndata in dependencies (#666)

* Incorporate use case tutorials (#665)

* Fixed DEG layer retrieval

* Use-case tutorial icons

* Restructure tutorial page

* Subgroup tutorials

* Improve KNN label_transfer in PerturbationSpace (#658)

* Add uncertainty score in KNN label_transfer in PerturbationSpace
Certainty is quantified as the fraction of nearest neighbors belonging to the classified (i.e. the most abundant) label compared to the total number of nearest neighbors.

* Update pre-commit-config.yaml
Replaces yanked dependency of mypy "types-pkg-resources" with "types-setuptools" as recommended: https://pypi.org/project/types-pkg-resources/

* Improve label imputation in PerturbationSpace class
Key changes:
- Now uses KNN graph in adata: saves cost and increases consistency
- Vectorized operations instead of expensive for loop
- Distance weighting for KNN imputation
- Quantifies uncertainty as local KNN label entropy

* Fixed plotting for mixscape.plot_barplot and sccoda.plot_effects_barplot (#667)

* Augur scsim warnings (#670)

* Augur scsim warnings

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Submodules

Signed-off-by: zethson <lukas.heumos@posteo.net>

---------

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Add PerturbationDataValidator (#672)

* Augur scsim warnings

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Submodules

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Add super draft of pertpy validator

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Polish

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Polish

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Nested try

Signed-off-by: zethson <lukas.heumos@posteo.net>

* validator in test

Signed-off-by: zethson <lukas.heumos@posteo.net>

* try uv for rtd

Signed-off-by: zethson <lukas.heumos@posteo.net>

* rtd uv

Signed-off-by: zethson <lukas.heumos@posteo.net>

* rtd uv

Signed-off-by: zethson <lukas.heumos@posteo.net>

* rtd uv fix

Signed-off-by: zethson <lukas.heumos@posteo.net>

* mb sphinx fix for validator

Signed-off-by: zethson <lukas.heumos@posteo.net>

* docs

Signed-off-by: zethson <lukas.heumos@posteo.net>

* remove PerturbationValidator from docs

Signed-off-by: zethson <lukas.heumos@posteo.net>

* remove PerturbationValidator from docs

Signed-off-by: zethson <lukas.heumos@posteo.net>

---------

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Latest OS for RTD

* Remove curator again

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Fix jax random array (#686)

* Fix jax random array

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Fix further jax warnings

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Fix edger

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Fix choice

Signed-off-by: zethson <lukas.heumos@posteo.net>

---------

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Switch to formulaic-contrasts (#682)

* Switch to formulaic-contrasts

* Cleanup

* removing design matrix workaround (#691)

Co-authored-by: Emma Dann <emmadann@comino.stanford.edu>

* Fix PyDESeq2

* Update tests

* fix typo in gitignore

* Remove contrast dataclass, which isnt used anywhere

* Fix edgeR rpy2 tests (#692)

* fix broken rpy2 edger tests

* updated edger tests

* Fix tests (scipy)

Signed-off-by: zethson <lukas.heumos@posteo.net>

* submodule

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Remove unused code

Signed-off-by: zethson <lukas.heumos@posteo.net>

* type hints

Signed-off-by: zethson <lukas.heumos@posteo.net>

---------

Signed-off-by: zethson <lukas.heumos@posteo.net>
Co-authored-by: Emma Dann <32264060+emdann@users.noreply.github.com>
Co-authored-by: Emma Dann <emmadann@comino.stanford.edu>
Co-authored-by: zethson <lukas.heumos@posteo.net>

* Release 0.9.5

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Prepare 0.10.0

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Added Mixscape seeds and test (#683)

Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net>

* Fix probability data type (#696)

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Optimize MeanVarDistributionDistance (#697)

* Fix probability data type

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Optimize mean_var distance

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

---------

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Optimize test speed (#699)

* Try buildjet

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Try buildjet large

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* speed up predict_differential_prioritization

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* speed up tests

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

---------

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Lower bound for scikit-learn (#701)

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Fix type annotation

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Fix empty figure returns when show=True in plotting functions (#703)

* Removed show parameter

* Adapt plotting API for Augur, Coda, Dialogue

* Adapted plotting API for Milo, Mixscape, scgen

* Add joblib

* Remove joblib

---------

Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net>

* Fix scikit-learn intendation

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

---------

Signed-off-by: zethson <lukas.heumos@posteo.net>
Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>
Co-authored-by: Lilly May <93096564+Lilly-May@users.noreply.github.com>
Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net>
Co-authored-by: Gregor Sturm <mail@gregor-sturm.de>
Co-authored-by: Emma Dann <32264060+emdann@users.noreply.github.com>
Co-authored-by: Emma Dann <emmadann@comino.stanford.edu>
Zethson added a commit that referenced this pull request Feb 20, 2025
* Implement mixture models for guide assignment

Key additions:
- Added a base abstract class "MixtureModel" with numpyro
- Added a first mixture model "Poisson_Gauss_Mixture"
- New function "assign_mixture_model" in GuideAssignment class

* Merge main into branch (#705)

* Set legend anchor as parameter (#660)

* Fix missing space

* Remove explicit anndata in dependencies (#666)

* Incorporate use case tutorials (#665)

* Fixed DEG layer retrieval

* Use-case tutorial icons

* Restructure tutorial page

* Subgroup tutorials

* Improve KNN label_transfer in PerturbationSpace (#658)

* Add uncertainty score in KNN label_transfer in PerturbationSpace
Certainty is quantified as the fraction of nearest neighbors belonging to the classified (i.e. the most abundant) label compared to the total number of nearest neighbors.

* Update pre-commit-config.yaml
Replaces yanked dependency of mypy "types-pkg-resources" with "types-setuptools" as recommended: https://pypi.org/project/types-pkg-resources/

* Improve label imputation in PerturbationSpace class
Key changes:
- Now uses KNN graph in adata: saves cost and increases consistency
- Vectorized operations instead of expensive for loop
- Distance weighting for KNN imputation
- Quantifies uncertainty as local KNN label entropy

* Fixed plotting for mixscape.plot_barplot and sccoda.plot_effects_barplot (#667)

* Augur scsim warnings (#670)

* Augur scsim warnings

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Submodules

Signed-off-by: zethson <lukas.heumos@posteo.net>

---------

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Add PerturbationDataValidator (#672)

* Augur scsim warnings

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Submodules

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Add super draft of pertpy validator

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Polish

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Polish

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Nested try

Signed-off-by: zethson <lukas.heumos@posteo.net>

* validator in test

Signed-off-by: zethson <lukas.heumos@posteo.net>

* try uv for rtd

Signed-off-by: zethson <lukas.heumos@posteo.net>

* rtd uv

Signed-off-by: zethson <lukas.heumos@posteo.net>

* rtd uv

Signed-off-by: zethson <lukas.heumos@posteo.net>

* rtd uv fix

Signed-off-by: zethson <lukas.heumos@posteo.net>

* mb sphinx fix for validator

Signed-off-by: zethson <lukas.heumos@posteo.net>

* docs

Signed-off-by: zethson <lukas.heumos@posteo.net>

* remove PerturbationValidator from docs

Signed-off-by: zethson <lukas.heumos@posteo.net>

* remove PerturbationValidator from docs

Signed-off-by: zethson <lukas.heumos@posteo.net>

---------

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Latest OS for RTD

* Remove curator again

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Fix jax random array (#686)

* Fix jax random array

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Fix further jax warnings

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Fix edger

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Fix choice

Signed-off-by: zethson <lukas.heumos@posteo.net>

---------

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Switch to formulaic-contrasts (#682)

* Switch to formulaic-contrasts

* Cleanup

* removing design matrix workaround (#691)

Co-authored-by: Emma Dann <emmadann@comino.stanford.edu>

* Fix PyDESeq2

* Update tests

* fix typo in gitignore

* Remove contrast dataclass, which isnt used anywhere

* Fix edgeR rpy2 tests (#692)

* fix broken rpy2 edger tests

* updated edger tests

* Fix tests (scipy)

Signed-off-by: zethson <lukas.heumos@posteo.net>

* submodule

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Remove unused code

Signed-off-by: zethson <lukas.heumos@posteo.net>

* type hints

Signed-off-by: zethson <lukas.heumos@posteo.net>

---------

Signed-off-by: zethson <lukas.heumos@posteo.net>
Co-authored-by: Emma Dann <32264060+emdann@users.noreply.github.com>
Co-authored-by: Emma Dann <emmadann@comino.stanford.edu>
Co-authored-by: zethson <lukas.heumos@posteo.net>

* Release 0.9.5

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Prepare 0.10.0

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Added Mixscape seeds and test (#683)

Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net>

* Fix probability data type (#696)

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Optimize MeanVarDistributionDistance (#697)

* Fix probability data type

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Optimize mean_var distance

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

---------

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Optimize test speed (#699)

* Try buildjet

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Try buildjet large

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* speed up predict_differential_prioritization

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* speed up tests

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

---------

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Lower bound for scikit-learn (#701)

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Fix type annotation

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Fix empty figure returns when show=True in plotting functions (#703)

* Removed show parameter

* Adapt plotting API for Augur, Coda, Dialogue

* Adapted plotting API for Milo, Mixscape, scgen

* Add joblib

* Remove joblib

---------

Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net>

* Fix scikit-learn intendation

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

---------

Signed-off-by: zethson <lukas.heumos@posteo.net>
Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>
Co-authored-by: Lilly May <93096564+Lilly-May@users.noreply.github.com>
Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net>
Co-authored-by: Gregor Sturm <mail@gregor-sturm.de>
Co-authored-by: Emma Dann <32264060+emdann@users.noreply.github.com>
Co-authored-by: Emma Dann <emmadann@comino.stanford.edu>

* Merge main into branch (#706)

* Set legend anchor as parameter (#660)

* Fix missing space

* Remove explicit anndata in dependencies (#666)

* Incorporate use case tutorials (#665)

* Fixed DEG layer retrieval

* Use-case tutorial icons

* Restructure tutorial page

* Subgroup tutorials

* Improve KNN label_transfer in PerturbationSpace (#658)

* Add uncertainty score in KNN label_transfer in PerturbationSpace
Certainty is quantified as the fraction of nearest neighbors belonging to the classified (i.e. the most abundant) label compared to the total number of nearest neighbors.

* Update pre-commit-config.yaml
Replaces yanked dependency of mypy "types-pkg-resources" with "types-setuptools" as recommended: https://pypi.org/project/types-pkg-resources/

* Improve label imputation in PerturbationSpace class
Key changes:
- Now uses KNN graph in adata: saves cost and increases consistency
- Vectorized operations instead of expensive for loop
- Distance weighting for KNN imputation
- Quantifies uncertainty as local KNN label entropy

* Fixed plotting for mixscape.plot_barplot and sccoda.plot_effects_barplot (#667)

* Augur scsim warnings (#670)

* Augur scsim warnings

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Submodules

Signed-off-by: zethson <lukas.heumos@posteo.net>

---------

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Add PerturbationDataValidator (#672)

* Augur scsim warnings

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Submodules

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Add super draft of pertpy validator

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Polish

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Polish

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Nested try

Signed-off-by: zethson <lukas.heumos@posteo.net>

* validator in test

Signed-off-by: zethson <lukas.heumos@posteo.net>

* try uv for rtd

Signed-off-by: zethson <lukas.heumos@posteo.net>

* rtd uv

Signed-off-by: zethson <lukas.heumos@posteo.net>

* rtd uv

Signed-off-by: zethson <lukas.heumos@posteo.net>

* rtd uv fix

Signed-off-by: zethson <lukas.heumos@posteo.net>

* mb sphinx fix for validator

Signed-off-by: zethson <lukas.heumos@posteo.net>

* docs

Signed-off-by: zethson <lukas.heumos@posteo.net>

* remove PerturbationValidator from docs

Signed-off-by: zethson <lukas.heumos@posteo.net>

* remove PerturbationValidator from docs

Signed-off-by: zethson <lukas.heumos@posteo.net>

---------

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Latest OS for RTD

* Remove curator again

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Fix jax random array (#686)

* Fix jax random array

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Fix further jax warnings

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Fix edger

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Fix choice

Signed-off-by: zethson <lukas.heumos@posteo.net>

---------

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Switch to formulaic-contrasts (#682)

* Switch to formulaic-contrasts

* Cleanup

* removing design matrix workaround (#691)

Co-authored-by: Emma Dann <emmadann@comino.stanford.edu>

* Fix PyDESeq2

* Update tests

* fix typo in gitignore

* Remove contrast dataclass, which isnt used anywhere

* Fix edgeR rpy2 tests (#692)

* fix broken rpy2 edger tests

* updated edger tests

* Fix tests (scipy)

Signed-off-by: zethson <lukas.heumos@posteo.net>

* submodule

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Remove unused code

Signed-off-by: zethson <lukas.heumos@posteo.net>

* type hints

Signed-off-by: zethson <lukas.heumos@posteo.net>

---------

Signed-off-by: zethson <lukas.heumos@posteo.net>
Co-authored-by: Emma Dann <32264060+emdann@users.noreply.github.com>
Co-authored-by: Emma Dann <emmadann@comino.stanford.edu>
Co-authored-by: zethson <lukas.heumos@posteo.net>

* Release 0.9.5

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Prepare 0.10.0

Signed-off-by: zethson <lukas.heumos@posteo.net>

* Added Mixscape seeds and test (#683)

Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net>

* Fix probability data type (#696)

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Optimize MeanVarDistributionDistance (#697)

* Fix probability data type

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Optimize mean_var distance

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

---------

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Optimize test speed (#699)

* Try buildjet

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Try buildjet large

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* speed up predict_differential_prioritization

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* speed up tests

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

---------

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Lower bound for scikit-learn (#701)

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Fix type annotation

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Fix empty figure returns when show=True in plotting functions (#703)

* Removed show parameter

* Adapt plotting API for Augur, Coda, Dialogue

* Adapted plotting API for Milo, Mixscape, scgen

* Add joblib

* Remove joblib

---------

Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net>

* Fix scikit-learn intendation

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

---------

Signed-off-by: zethson <lukas.heumos@posteo.net>
Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>
Co-authored-by: Lilly May <93096564+Lilly-May@users.noreply.github.com>
Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net>
Co-authored-by: Gregor Sturm <mail@gregor-sturm.de>
Co-authored-by: Emma Dann <32264060+emdann@users.noreply.github.com>
Co-authored-by: Emma Dann <emmadann@comino.stanford.edu>

* Refactor guide assignment logic and enhance mixture model parameters

* Cleanup MixtureModel class

* Enhance guide assignment validation and error handling in GuideAssignment class

* Update dev nb

* Add test for grna_mixture_model

* Remove dev nb

* Update notebook for guide assignment

* Update guide assignment notebooks

* Apply suggestions from code review

Review comments by @Zethson

Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net>

* Improve code to fit review suggestions
- Added lots of type hints and return types
- Improved naming of variables
- Added and removed a few comments
- Added user warnings if a guide is not expressed at all

* Fix sloppy data dimensions for numpyro
Previously data was (N,1) dim. Now applying ravel, and changed numpyro plates accordingly for correct batching.

* Update test_grna_assignment.py
We changed "Negative" to "negative" :)

* Polish

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

* Polish

Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>

---------

Signed-off-by: zethson <lukas.heumos@posteo.net>
Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>
Co-authored-by: Lilly May <93096564+Lilly-May@users.noreply.github.com>
Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net>
Co-authored-by: Gregor Sturm <mail@gregor-sturm.de>
Co-authored-by: Emma Dann <32264060+emdann@users.noreply.github.com>
Co-authored-by: Emma Dann <emmadann@comino.stanford.edu>
@Zethson Zethson deleted the formulaic-contrasts branch October 12, 2025 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend PyDESeq2 class to support arbitrary contrasts and designs

5 participants