Skip to content

Add text and HTML representations to DE model classes - #1070

Merged
Zethson merged 1 commit into
mainfrom
feature/de-model-repr
Aug 6, 2026
Merged

Add text and HTML representations to DE model classes#1070
Zethson merged 1 commit into
mainfrom
feature/de-model-repr

Conversation

@Zethson

@Zethson Zethson commented Aug 6, 2026

Copy link
Copy Markdown
Member

Closes #611

Inspecting a differential expression model now shows a summary of the input data, the design and the fit state, both as plain text and as an HTML table in Jupyter.

>>> edgr
EdgeR
    Data          1,525 obs × 27,085 vars
    Layer         X
    Design        1 + Efficacy + Treatment
    Variables     Efficacy, Treatment
    Coefficients  Intercept, Efficacy[T.PD], Efficacy[T.PR], Efficacy[T.SD], Treatment[T.Chemo]
    Fitted        yes

Both representations are driven by a single _summary() hook, so MethodBase covers the simple tests and LinearModelBase adds the design rows.
The HTML uses inline styles relative to the surrounding text, so it renders on light and dark themes and is not affected by the notebook's own table CSS.

LinearModelBase gains a public is_fitted property to back the Fitted row; PyDESeq2.plot_disp_ests now uses it instead of probing for self.dds.

Inspecting a differential expression model now summarizes the input data,
the layer, the design and whether the model has been fitted, rendered as an
HTML table in Jupyter.

Adds a public `is_fitted` property to `LinearModelBase` to back the summary.

Closes #611
@Zethson
Zethson merged commit 7fc5b61 into main Aug 6, 2026
19 checks passed
@Zethson
Zethson deleted the feature/de-model-repr branch August 6, 2026 14:16
@codecov-commenter

codecov-commenter commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.15385% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.46%. Comparing base (40dfeb6) to head (1ca8060).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
...rtpy/tools/_differential_gene_expression/_edger.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1070      +/-   ##
==========================================
+ Coverage   74.15%   79.46%   +5.30%     
==========================================
  Files          52       53       +1     
  Lines        7291     7545     +254     
==========================================
+ Hits         5407     5996     +589     
+ Misses       1884     1549     -335     
Files with missing lines Coverage Δ
...ertpy/tools/_differential_gene_expression/_base.py 95.93% <100.00%> (+5.23%) ⬆️
...y/tools/_differential_gene_expression/_pydeseq2.py 91.83% <100.00%> (+0.17%) ⬆️
...ools/_differential_gene_expression/_statsmodels.py 100.00% <100.00%> (ø)
...rtpy/tools/_differential_gene_expression/_edger.py 16.92% <0.00%> (-0.27%) ⬇️

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

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.

HTML widget for DE Model classes

2 participants