Skip to content

Add and rename significance thresholds - #974

Merged
Zethson merged 13 commits into
scverse:mainfrom
LuisHeinzlmeier:feature/967-sig-threshold
Jun 1, 2026
Merged

Add and rename significance thresholds#974
Zethson merged 13 commits into
scverse:mainfrom
LuisHeinzlmeier:feature/967-sig-threshold

Conversation

@LuisHeinzlmeier

@LuisHeinzlmeier LuisHeinzlmeier commented May 18, 2026

Copy link
Copy Markdown
Collaborator
  • closes Add a signifiance threshold for plot_fold_change() #967
  • replaces common significance threshold terms like alpha, thres, etc. with consistent parameter names, where appropriate
  • adds a warning filter to _pydeseq2.py and _milo.py because lazy loading of packages (probably PyDESeq2) pre-appends ignoring all future warnings (also the scverse_misc warnings from pertpy)
  • remove warning of plot_fold_change() by adding .copy()

@codecov-commenter

codecov-commenter commented May 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 77.76%. Comparing base (12897e1) to head (c934878).
⚠️ Report is 81 commits behind head on main.

Files with missing lines Patch % Lines
pertpy/tools/_enrichment.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #974      +/-   ##
==========================================
+ Coverage   73.54%   77.76%   +4.21%     
==========================================
  Files          48       48              
  Lines        5613     6372     +759     
==========================================
+ Hits         4128     4955     +827     
+ Misses       1485     1417      -68     
Files with missing lines Coverage Δ
...ertpy/tools/_differential_gene_expression/_base.py 90.58% <100.00%> (+1.56%) ⬆️
...y/tools/_differential_gene_expression/_pydeseq2.py 90.90% <100.00%> (-0.99%) ⬇️
pertpy/tools/_milo.py 71.91% <100.00%> (-8.75%) ⬇️
pertpy/tools/_enrichment.py 66.38% <80.00%> (+0.29%) ⬆️

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@LuisHeinzlmeier

Copy link
Copy Markdown
Collaborator Author

@Zethson, this is still work in progress for #967, but before I try to harmonize all threshold naming:

  • Are you happy with the names?
  • Are you happy with how I handle backward compatibility?

@Zethson

Zethson commented May 18, 2026

Copy link
Copy Markdown
Member

2x yes. But you may also introduce scverse-misc and use https://scverse-misc.readthedocs.io/stable/generated/scverse_misc.deprecated_arg.html

@LuisHeinzlmeier

LuisHeinzlmeier commented May 28, 2026

Copy link
Copy Markdown
Collaborator Author

Manual testing

enrichment
hypergeometric():
Bildschirmfoto 2026-05-28 um 08 11 07

dge
plot_fold_change():
Only top log-fold changes that pass the padj_threshold are plotted. For example, PDGFRL is not plotted because 0.0135 > 0.01.
Bildschirmfoto 2026-05-28 um 09 26 43
Figure_1

plot_volcano():
Bildschirmfoto 2026-05-29 um 06 25 33
Bildschirmfoto 2026-05-29 um 06 25 51
Bildschirmfoto 2026-05-29 um 06 26 04

milo
milo_de.plot_de_nhood_graph():
Now, padj_threshold is used for the significance of SpatialFDR and alpha is passed to matplotlib.pyplot.scatter() of scanpy.pl.embedding() and changes the transparency of the dots.
Bildschirmfoto 2026-05-29 um 16 21 23

Bildschirmfoto 2026-05-29 um 16 21 43

plot_da_beeswarm():
Bildschirmfoto 2026-05-29 um 16 59 59

milo.plot_nhood_graph()
Bildschirmfoto 2026-05-29 um 17 01 29

@LuisHeinzlmeier LuisHeinzlmeier changed the title Work in progress: Significance threshold. Add and rename significance thresholds May 29, 2026

@LuisHeinzlmeier LuisHeinzlmeier left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ready for a review! I also updated the notebooks, but couldn't push them into this PR because I am working on a forked repo. This time, I will create a separate PR in pertpy-tutorials (see here).

@LuisHeinzlmeier
LuisHeinzlmeier marked this pull request as ready for review May 31, 2026 06:55
@Zethson
Zethson merged commit 1992a2b into scverse:main Jun 1, 2026
18 of 20 checks passed
Zethson added a commit that referenced this pull request Aug 4, 2026
* Rename DistanceTest alpha to padj_threshold

Closes #1002

Aligns DistanceTest with the significance threshold naming introduced in
 #974, where alpha became padj_threshold in Milo, the DGE base and
enrichment. alpha stays accepted and now emits a FutureWarning.

DIALOGUE is left alone as requested in the issue.

* Bump tutorials submodule for the padj_threshold rename
@Zethson Zethson mentioned this pull request Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a signifiance threshold for plot_fold_change()

3 participants