Determines the phase for each haplotype block using the top N cells with the highest allelic imbalance. This method is more robust when there are many balanced cells that could add noise to phasing.

computehaplotypecounts(haplotypes, ncells = 10, arm = FALSE)

Arguments

haplotypes

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

ncells

Number of top imbalanced cells to use for phasing. Default 10.

arm

If TRUE, perform phasing per chromosome arm rather than whole chromosome. Default FALSE.

Value

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

See also

[phase_haplotypes()] for phasing using all cells