Skip to content

dialogue: update tutorial for the new pertpy DIALOGUE API#58

Open
Zethson wants to merge 1 commit into
mainfrom
dialogue-rewrite-api
Open

dialogue: update tutorial for the new pertpy DIALOGUE API#58
Zethson wants to merge 1 commit into
mainfrom
dialogue-rewrite-api

Conversation

@Zethson
Copy link
Copy Markdown
Member

@Zethson Zethson commented May 23, 2026

The pertpy DIALOGUE implementation has been rewritten as a faithful port of the R reference (scverse/pertpy#TBD). This notebook is updated for the new API:

  • Dialogue(...) constructor: celltype_key, sample_key, cell_quality_key, n_programs.
  • dl.run(adata) runs the full three-phase pipeline; results live on adata.obs[mcp_*], adata.obsm["X_dialogue"], and adata.uns["dialogue"].
  • test_association -> test_phenotype_association(adata, condition_key=...).
  • get_extrema_MCP_genes -> find_extreme_score_genes(adata, program="MCP1").
  • get_mlm_mcp_genes -> get_program_genes(adata, program=..., celltype=...).

plot_split_violins / plot_pairplot are not yet ported; the tutorial inlines seaborn equivalents.

@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

The pertpy DIALOGUE implementation has been rewritten as a faithful port of the R reference (scverse/pertpy#TBD). Key API changes:

- `Dialogue(...)` constructor keys: `celltype_key`, `sample_key`, `cell_quality_key`, `n_programs` (was `sample_id`, `celltype_key`, `n_counts_key`, `n_mpcs`).
- `dl.run(adata)` runs the full three-phase pipeline (fit_programs / test_celltype_pairs / refine_scores) in place; results live on `adata.obs[mcp_*]`, `adata.obsm["X_dialogue"]`, and `adata.uns["dialogue"]`.
- `test_association` -> `test_phenotype_association(adata, condition_key=...)`.
- `get_extrema_MCP_genes` -> `find_extreme_score_genes(adata, program="MCP1")` (per-program rather than per all-MCPs).
- `get_mlm_mcp_genes` -> `get_program_genes(adata, program=..., celltype=...)`.
- `multilevel_modeling` is now part of `dl.run(adata)`; per-gene tables are on `adata.uns["dialogue"]["gene_pvalues"]`.
- `plot_split_violins` / `plot_pairplot` are not yet ported; the tutorial inlines seaborn equivalents.

Clears all cached cell outputs so the next CI run executes the notebook from scratch.
@Zethson Zethson force-pushed the dialogue-rewrite-api branch from 4108097 to 2de98dc Compare May 23, 2026 13:51
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.

1 participant