This function implements 2 rephasing algorithms. The first mindist, implementthe dynamic programming algorithm to rephase haplotype copy number first described in CHISEL. The objective is to find the phase that minimizes the number of copy number events. The second LOH finds cells with whole chromosome losses and assumes this was a single event and rephases all the bins relative to this.

rephasebins(
  cn,
  chromosomes = NULL,
  method = "mindist",
  whole_chr_cutoff = 0.9,
  ncells = 1,
  clusterfirst = FALSE,
  cl = NULL
)

Arguments

cn

either a hscn object from callHaplotypeSpecificCN or a dataframe with haplotype specific copy number ie the data slot in an hscn object

chromosomes

vector specifying which chromosomes to phase, default is NULL whereby all chromosomes are phased

method

either mindist or LOH

ncells

default 1

clusterfirst

Whether to cluster cells and perform rephasing on clusters rather than cells

cl

Precomputed clustering object from umap_clustering

Value

Either a new hscn object or a dataframe with rephased bins depdending on the input