Add a PC heatmap (equivalent of Seurat's `DimHeatmap`) to help choose the number of PCs
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- matplotlib, python
- Lĩnh vực
- data-visualization
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 2.6k
- Fork
- 809
- Merge trung bình
- 1 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 79
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của scverse/scanpy
-
Area - Plotting 🌺
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
scverse/scanpy#3576 · 1 bình luận · 2 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Triage 🩺
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
scverse/scanpy#4564 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 18/100
scverse/scanpy#4563 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của scverse/scanpy
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
fossasia/eventyay-exhibition#465 · 3 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area/webapp comp/desktop P2 type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NousResearch/hermes-agent#163341 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
cpp-best-practices/project_validator#609 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
smart-village-solutions/smart-speech-flow#765 ·
Maintainer thường phản hồi trong vòng 1 ngày