Allelic distance between clones under the all-cell orientation
Source:R/clones_assign.R
clone_allelic_distance.RdClone pseudobulk haplotype fractions per arm with every phase block oriented by the all-cell pseudobulk (oc: per
cell x arm counts from orient_blocks without groups, computed once): D[k, l] = sum over arms of len x max(|f_k - f_l| - floor, 0) (bp x fraction). Events carried by a large share of the cells (trunk events, e.g. an arm loss in
one tumour region, a chromosome lost on opposite haplotypes in two lineages, a gain in all tumour cells) are oriented correctly in nearly every block
and give large differences; a subclone's private event is outweighed in the all-cell pseudobulk and contributes
little. This is what makes the distance a trunk distance, unlike the clone state distance, where sibling clones
with one misfitted segment are as far apart as different lineages.