Skip to content

Add and rename significance thresholds#974

Draft
LuisHeinzlmeier wants to merge 13 commits into
scverse:mainfrom
LuisHeinzlmeier:feature/967-sig-threshold
Draft

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

Conversation

@LuisHeinzlmeier
Copy link
Copy Markdown

@LuisHeinzlmeier LuisHeinzlmeier commented May 18, 2026

  • 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)

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 18, 2026

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
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
Copy link
Copy Markdown
Member

Zethson commented May 18, 2026

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

@LuisHeinzlmeier
Copy link
Copy Markdown
Author

LuisHeinzlmeier commented May 28, 2026

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
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