Determines the phase (which allele is A vs B) for each haplotype block based on the distribution of allele counts across all cells. The allele with fewer total counts is assigned as the "A" allele.

phase_haplotypes(haplotypes)

Arguments

haplotypes

A data.frame with formatted haplotype data. Required columns: `chr`, `start`, `end`, `hap_label`, `allele1`, `allele0`.

Value

A data.frame with phasing information containing: * `chr`, `start`, `end`, `hap_label`: Haplotype block identifiers * `phase`: Which allele ("allele0" or "allele1") should be treated as alleleA

See also

[computehaplotypecounts()] for alternative phasing using top imbalanced cells