Add a PC heatmap (equivalent of Seurat's `DimHeatmap`) to help choose the number of PCs
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- matplotlib, python
調査の方向性
Start by reading the existing sc.pl.pca_loadings implementation under scanpy/plotting/_tools/ as the API model, and the plotting tests for it; then look at how varm["PCs"] loadings and obsm["X_pca"] scores are read elsewhere in the same package. The blocking question is the maintainer answer on legacy matplotlib versus the ScanpyV2Preview HoloViews backend, so the first step is getting that decision, not coding. Done means a working sc.pl.pca_heatmap with a test covering the gene/cell selection and the scale=None z-scoring path.
索引モデルが issue の本文から書いたものです。
説明
Add a PC heatmap (equivalent of Seurat's DimHeatmap) to help choose the number of PCs
Seurat's DimHeatmap is a common way to decide how many PCs carry biological signal: for each PC it plots the genes with the most extreme loadings against the cells with the most extreme scores, both ordered by PCA. PCs with clear block structure are kept; the cutoff is where the heatmap starts to look "fuzzy". The HBC single-cell training materials, among others, teach this step.
This has been asked before (#505, #904). #505 has a workaround function in the comments, but nothing landed in sc.pl, so users keep re-implementing it.
Proposed API (mirrors pca_loadings):
sc.pl.pca_heatmap(
adata, components="1,2,3", *,
n_genes=30, n_cells=500, balanced=True,
layer=None, use_raw=False, key_added=None,
scale=None, # z-score plotted genes on the fly if data look unscaled
vmin=-2.5, vmax=2.5, # Seurat's disp.min / disp.max
show=None, save=None,
)
- Genes: top
n_genes/2positive and negative loadings fromvarm["PCs"](HVG-masked PCA handled, since non-HVG loadings are 0) - Cells:
n_cells/2from each end ofobsm["X_pca"] scale=Nonez-scores only the plotted genes (same result assc.pp.scale) when the matrix has no negative values. This covers the common case where PCA was run on log-normalized data withoutpp.scale, without densifying the full matrix.
I have a working, tested prototype for the legacy matplotlib backend.
Question for maintainers: given the ongoing move to the HoloViews (ScanpyV2Preview) backend, would you accept this?
- legacy only,
- v2 only (e.g. returning an
hv.HeatMap/hv.Layout, in the style of the newranking), or - both?
Happy to open a PR in whichever form you prefer.
- 主要言語
- Python
- スター
- 2.6k
- フォーク
- 809
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 79
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
scverse/scanpy のほかの issue
-
Area - Plotting 🌺
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
scverse/scanpy#3576 · コメント 1 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
Triage 🩺
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
scverse/scanpy#4564 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 18/100
scverse/scanpy#4563 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
fossasia/eventyay-exhibition#465 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
area/webapp comp/desktop P2 type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NousResearch/hermes-agent#163341 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
cpp-best-practices/project_validator#609 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
smart-village-solutions/smart-speech-flow#765 ·
メンテナーはふだん 1 日以内に返信