Repository navigation
Conversation
Speed up the existing H5/H5AD/CSV cell-matrix path without changing QC thresholds, HVG flavors, or packet artifacts. Two CSR nnz passes replace separate QC, normalize, and HVG scans. PCA applies scale+clip during sparse matmuls and clamps n_pcs so tiny post-QC matrices do not panic. Wilcoxon markers run per-cluster on rayon. Co-authored-by: Josh Garton <jwg054000@users.noreply.github.com>
jwg054000
marked this pull request as ready for review
September 3, 2026 18:39
Owner
Author
|
Shared desk — RustPipe-SC #11 Speed lane only: fused sparse QC+HVG nnz passes, implicit-centered PCA, rayon-per-cluster Wilcoxon. H5/H5AD/CSV cell matrix unchanged. Off FASTQ / piscem / prairie-stream-agent. PRs only, never Comment / review / CI here and the SC bot will pick it up. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Speed up the existing H5 / H5AD / CSV cell-matrix pipeline without changing biology. No new default CLI flags. Does not depend on open PR #10 (H5 CI fixture).
What changed
Fused QC + normalize + HVG stats (two CSR nnz passes)
Pass 1: QC metrics, cell keep, gene detection counts among kept cells.
Pass 2: gene filter +
normalize_total/log1p(or skip) + per-gene mean/variance.Seurat / seurat_v3 ranking uses those stats (no third scan).
Same thresholds (
min_genes,max_pct_mt,min_cells=3) and the sameqc_metrics.csv/ filtered cells /hvg_genes.csv.Implicit scale+clip+center PCA
The HVG matrix is no longer densified by
scale_sparsebefore RSVD. Power-iteration randomized SVD is unchanged.n_pcsis clamped tomin(requested, n_cells-1, n_hvg)so a tiny post-QC matrix (e.g. 21 cells) cannot index-OOB.Wilcoxon markers parallelized per-cluster with rayon
Same top-N, same ranking. Deterministic (no RNG in the test). Parallel matches serial on a small matrix.
Timings
pipeline_timings.jsonkeeps the same step names:load,qc_filter,normalize,hvg,scale,pca,knn,leiden,markers.scaleis now mean/std only; z-score + clip happen inside the PCA matmuls. Documented inPACKET.md.Tests
cargo test(no HDF5 in this environment): 127 passed (was 115). New coverage:n_pcsclamp on a 21×15 post-QC matrix; implicit sparse PCA matches dense scaled PCAcargo test --features hdf5was not run here (no system HDF5). CI without hdf5 is the default.Out of scope
No Cell Ranger / possorted BAM ingest, HNSW, UMAP, GPU, rustqc vendoring, or FASTQ/piscem work.