Skip to content

Add plot_ma for DGE results - #1066

Merged
Zethson merged 1 commit into
mainfrom
feat/dge-ma-plot
Aug 4, 2026
Merged

Add plot_ma for DGE results#1066
Zethson merged 1 commit into
mainfrom
feat/dge-ma-plot

Conversation

@Zethson

@Zethson Zethson commented Aug 4, 2026

Copy link
Copy Markdown
Member

Closes #969
Closes #803

Adds plot_ma to MethodBase, the pertpy equivalent of edgeR's plotSmear and DESeq2's plotMA: mean expression against the log2 fold change, highlighting the variables the test called significant.
As #803 puts it, the volcano plot carries no information about expression range, so lowly expressed hits are indistinguishable from well expressed ones.

The mean column differs per method, so it is detected from the results — baseMean for PyDESeq2, logCPM for edgeR — and mean_col covers anything else.
The x-axis is log-scaled for linear mean columns and left alone for those already on a log scale.

Verified end-to-end against both backends, not just the unit tests: PyDESeq2 picks up baseMean with a log x-axis, edgeR picks up logCPM with a linear one.
The docstring preview is EdgeR on zhang_2021, the same example the other DGE plots use.

Closes #969
Closes #803

Adds the pertpy equivalent of edgeR's plotSmear and DESeq2's plotMA:
mean expression against the log2 fold change, highlighting the variables
the test called significant. Unlike the volcano plot it shows the
expression range, so lowly expressed hits are no longer indistinguishable
from well expressed ones.

The mean column differs per method, so it is detected from the results:
baseMean for PyDESeq2 and logCPM for edgeR. The x axis is log scaled for
linear mean columns and left alone for those already on a log scale.
@Zethson
Zethson merged commit f9bb56f into main Aug 4, 2026
17 of 18 checks passed
@Zethson
Zethson deleted the feat/dge-ma-plot branch August 4, 2026 15:39
@codecov-commenter

codecov-commenter commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.72%. Comparing base (40dfeb6) to head (d87ca16).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1066      +/-   ##
==========================================
+ Coverage   74.15%   78.72%   +4.56%     
==========================================
  Files          52       52              
  Lines        7291     7290       -1     
==========================================
+ Hits         5407     5739     +332     
+ Misses       1884     1551     -333     
Files with missing lines Coverage Δ
...ertpy/tools/_differential_gene_expression/_base.py 90.69% <ø> (ø)

... and 6 files with indirect coverage changes

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

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 mean logFC plots for DGE MA plots for DE results

2 participants