Skip to content

Add plot_bcv()#1007

Open
LuisHeinzlmeier wants to merge 4 commits into
mainfrom
feature/plot-bcv
Open

Add plot_bcv()#1007
LuisHeinzlmeier wants to merge 4 commits into
mainfrom
feature/plot-bcv

Conversation

@LuisHeinzlmeier
Copy link
Copy Markdown
Collaborator

  • add plot_bcv()
  • add _prepare_dge() to be able to run plot_bcv() before .fit() without calculating normalization factors and estimating dispersions twice
  • add _ensure_deps() to prevent repetitive imports and code
  • closes Add variance mean plots for DGE #968

@github-actions github-actions Bot added the enhancement New feature or request label Jun 3, 2026
Copy link
Copy Markdown
Collaborator Author

@LuisHeinzlmeier LuisHeinzlmeier left a comment

Choose a reason for hiding this comment

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

Ready for a review!

@LuisHeinzlmeier LuisHeinzlmeier requested a review from Zethson June 3, 2026 05:54
@Zethson Zethson marked this pull request as ready for review June 3, 2026 06:28
self.fit = fit

@_doc_params(common_plot_args=doc_common_plot_args)
def plot_bcv( # pragma: no cover # noqa: D417
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is only designed for edger now, right? But it should also work with statsmodels or pydeseq2. Like ideally, I'd like to completely phase out the edger support at some point in the future.

>>> adata.layers["counts"] = adata.X.copy()
>>> pdata = dc.pp.pseudobulk(adata, sample_col="Patient", groups_col="Cluster", layer="counts", mode="sum")
>>> dc.pp.filter_samples(pdata, inplace=True)
>>> edgr = pt.tl.EdgeR(pdata, design="~Efficacy+Treatment")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd love this to be pydeseq2


ro.globalenv["fit"] = fit
self.fit = fit
self.dge = dge
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why these changes here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add variance mean plots for DGE

2 participants