format_haplotypes.RdAdds phasing information to formatted haplotypes, determining which allele is the "A" (dominant) allele and which is the "B" (minor) allele for each haplotype block.
format_haplotypes(
haplotypes,
filtern = 0,
hmmcopybinsize = 5e+05,
phased_haplotypes = NULL,
phasing_method = "distribution",
...
)A data.frame with haplotype allele counts. Required columns: `cell_id`, `chr`, `start`, `end`, `hap_label`, `allele1`, `allele0`, `totalcounts`.
Minimum total read count per haplotype to include. Default 0.
Bin size used by HMMcopy. Default 0.5e6 (500kb).
Optional pre-computed phasing from `computehaplotypecounts()`. If NULL, phasing is computed automatically using `phasing_method`.
Method for phasing. "distribution" (default) uses the distribution across all cells. Alternative is to use top N imbalanced cells via `computehaplotypecounts()`.
Additional arguments passed to `computehaplotypecounts()` if `phasing_method` is not "distribution".
A data.frame with phased haplotypes containing: * `alleleA`: Read counts for the dominant allele * `alleleB`: Read counts for the minor allele * `BAF`: B-allele frequency (alleleB / totalcounts)
[format_haplotypes_dlp()] for initial formatting, [phase_haplotypes()] and [computehaplotypecounts()] for phasing methods