Skip to content

Scale HVG detection bounds with the selection and add seurat_v3, Pearson residuals, and batch-aware selection - #23

Merged
parashardhapola merged 1 commit into
masterfrom
pr/08-hvg-selection
Oct 23, 2026
Merged

parashardhapola merged 1 commit into
masterfrom
pr/08-hvg-selection

Conversation

@parashardhapola

Copy link
Copy Markdown
Member

HVG detection bounds were absolute (min_cells=20, max_cells=n-20), so subsets lost markers, for example Iapp, Pyy, Chgb, and Chga on 150 beta cells. This also adds batch-aware selection and the seurat_v3 and Pearson residual flavors.

Changes

  • Default min_cells is 1% of the selected cells (between 3 and 20), and genes detected in more than 99.5% of the cells are excluded; the resolved bounds are recorded.
  • Filters run before ranking, and the default blacklist covers current histone symbols and keeps CCN1 to CCN6.
  • flavor="seurat_v3" (local regression matching scikit-misc to 1e-12) and flavor="pearson_residuals" (Lause et al. 2021), batch= (Seurat's integration-feature ranking), and PearsonResidualNormalizer.
  • Against scanpy 1.12.4 on PBMC data: seurat_v3 shares 0.998 of its selection, Pearson residuals 1.0.
  • features.hvgs without matplotlib warns and returns the selection.
  • Revision 2 of select_hvgs for selections that record min_cells 20, a finite variance bound, or the earlier blacklist.

Behaviour changes

  • Default selections on fewer than 2,000 cells change; stored selections with the earlier defaults are recomputed.

@parashardhapola
parashardhapola force-pushed the pr/07-storage-robustness branch 2 times, most recently from e7a6013 to bc92efa Compare October 23, 2026 06:53
…son residuals, and batch-aware selection

HVG detection bounds were absolute (`min_cells=20`, `max_cells=n-20`), so subsets lost markers, for example Iapp, Pyy, Chgb, and Chga on 150 beta cells. This also adds batch-aware selection and the seurat_v3 and Pearson residual flavors.
@parashardhapola
parashardhapola changed the base branch from pr/07-storage-robustness to master October 23, 2026 07:03
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@parashardhapola
parashardhapola merged commit c4710a6 into master Oct 23, 2026
24 checks passed
@parashardhapola
parashardhapola deleted the pr/08-hvg-selection branch October 23, 2026 07:13
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.

2 participants