Skip to main content

Module refine_mixed

Module refine_mixed 

Source
Expand description

Cross-individual likelihood refinement of mixed pseudobulk groups.

RandProjOps::partition_columns_to_mixed_groups pools the cells of many individuals by the sign code of a projection. A group can still hold more than one cell state. This pass moves cells between groups under the Poisson model

  y_cg ~ Poisson(s_c mu_gp omega_gi)

for cell c of individual i in group p: s_c is the cell’s depth, mu the group’s profile and omega the individual’s gene offset. A cell keeps its omega_gi in every group, so a move gains only from a better match of mu, the cell state, and not from joining a group rich in its own individual.

Each sweep fits mu and omega for the current labels by alternating closed-form updates (concave in their logs), then moves every cell to its best candidate group with the parameters held fixed. Both steps raise the same likelihood. Candidates are the groups of the codes one bit away from the cell’s own code. A move that would leave its group with fewer than min_batches individuals is vetoed.

Unlike crate::alg::dc_poisson, the score carries the individual offset omega, and a cell’s current group is scored with the cell inside it (no leave-one-out), which only favours staying.

Structs§

MixedRefineParams

Traits§

MixedRefineOps