Expand description
Cell-axis quality control (library-only): robust (MAD) outlier detection
plus the near-empty floor. Built on the streaming stat collectors in the
sibling qc module and consumed by senna / pinto — NOT by the data-beans
CLI — so it lives in its own module that the binary never compiles (keeps
qc fully bin-used and avoids dead-code in the bin target).
Structs§
- QcArgs
- Clap surface for cell QC, shared by senna and pinto subcommands.
- QcConfig
- Configuration for cell QC. Plain struct (no clap) so non-clap crates
can construct it directly; the clap surface is
QcArgs. - QcReport
- Per-cell / per-feature QC outcome.
Enums§
- Tail
- Which side(s) of the robust band count as outliers.
Functions§
- compute_
qc - Compute the two-tier cell-QC report.
block_sizecontrols the streaming stat passes (None= default chunking). - compute_
qc_ exempting compute_qcwith columns that are not cells exempted — a prior run’s carried pseudobulks.exempt[c] = truekeeps columncout of all band statistics and out of every verdict. Seeqc_from_metrics.- compute_
qc_ stack - Modality-agnostic cell QC for a
SparseIoStack: per-celln_genes/total_countsare summed across all member modalities (mirrorssenna gem’s “a cell rich in any one modality is kept”). Mito/ribo and feature-axis QC are skipped on stacks (row names are per-modality). - filter_
by_ keep - Filter a per-cell
Vec<T>in lockstep with a cell keep-mask. Used to keep batch labels / coordinates aligned aftermask_columns. - resolve_
rows_ by_ regex - Resolve a regex over row (feature) names into matching row indices, in
the same compact-row order as
SparseIoVec::row_names(). Feedscollect_column_stat_across_vec(.., Some(&rows), ..)for subset sums. - robust_
outlier_ keep - Robust outlier keep-mask:
keep[i] = falsewhenvalues[i]falls outsidemedian ± n_mads · MAD · 1.4826on the requestedtail. Count-like metrics should passlog1p = trueso the band is symmetric on the multiplicative scale. Consolidates the median+MAD idiom used incnv::hmm.consider(whenSome) restricts the median/MAD band to the cells it markstrue— so e.g. near-empty cells don’t contaminate the robust center — while the keep decision is still returned for every cell. - write_
qc_ report - Write a per-cell QC table (TSV): name, n_genes, total_counts, [mito_frac], [ribo_frac], near_empty (0/1), train_keep (0/1).