Skip to main content

Module collapse_data

Module collapse_data 

Source

Structs§

CollapsedOut
output struct to make the model parameters more accessible
CollapsedStat
a struct to hold the sufficient statistics for the model
ContrastGene
One gene’s role in a split contrast. lfc is right over left.
EmptyArg
MultilevelCollapseOut
MultilevelParams
Configuration for multi-level collapsing.
PbSampleCollection
Pre-aggregated pb-sample data for fast cross-batch matching. Each pb-sample is the intersection of a (batch, sample) pair.
PbSampleLayout
PbTree
PbTreeParams
ReassignCellsParams
RootRecord
SplitRecord
StackCollapseOut
What the stack collapse returns: per level (finest first), one CollapsedOut per layer, and the per-level cell → pb membership the layers share.

Enums§

BelowEdge
What to do with a split whose leading residual component sits at the noise edge.

Constants§

DEFAULT_KNN
DEFAULT_OPT_ITER

Traits§

CollapsingOps
Given a feature/projection matrix (factor x cells), we assign each cell to a sample and return pseudobulk (collapsed) matrices
MultilevelCollapsingOps

Functions§

collapse_columns_multilevel_with_hierarchy
Same as SparseIoVec::collapse_columns_multilevel_vec, but also returns the per-level cell → pb mapping needed for hierarchical / nested chain sampling in downstream consumers (currently graph-embedding-util).
collapse_columns_multilevel_with_partition
Variant of collapse_columns_multilevel_with_hierarchy that skips the BBKNN + Poisson DC-SBM refinement, instead synthesising the per-pb-sample group assignment from a caller-supplied cell_to_pb_per_level (finest-first; the same shape returned in [MultilevelCollapseOut.cell_to_pb_per_level] by the refining entry point). Typical use: senna {topic, itopic, ce-topic} --from inheriting a prior run’s partition.
collapse_columns_multilevel_with_strata
Collapse with a hard CNV stratum partition on cells.
collapse_stack_multilevel_with_hierarchy
The SparseIoStack collapse, also returning the per-level cell → pb membership (finest first) the layers share — the stack counterpart of collapse_columns_multilevel_with_hierarchy. With params.keep_finest_stats the finest level keeps its sufficient statistics, which CollapsedOut::observed_counts reads.
resample_and_optimize
Resample from over-resolved sufficient statistics: randomly select ~half the groups, then optimise to produce a fresh CollapsedOut.

Type Aliases§

GeneSums
Sparse pb-sample gene profile: rows[pbsamp] = Vec<(gene_idx, sum)> sorted by gene_idx, as produced by collect_pb_sample_gene_sums and consumed by collect_matched_stat_coarse and the refinement pass.