Call allele specific copy number in single cell datasets

callAlleleSpecificCN(
  CNbins,
  haplotypes,
  eps = 0.000000000001,
  loherror = 0.02,
  maxCN = NULL,
  selftransitionprob = 0.95,
  progressbar = TRUE,
  ncores = 1,
  likelihood = "binomial",
  minbins = 100,
  minbinschr = 10,
  maxloherror = 0.03,
  filterhaplotypes = 0.1,
  fillmissing = TRUE
)

Arguments

CNbins

single cell copy number dataframe with the following columns: `cell_id`, `chr`, `start`, `end`, `state`, `copy`

haplotypes

single cell haplotypes dataframe with the following columns: `cell_id`, `chr`, `start`, `end`, `hap_label`, `allele1`, `allele0`, `totalcounts`

eps

default 1e-12

loherror

LOH error rate for initial assignment, this is inferred directly from the data in the second pass, default = 0.02

maxCN

maximum copy number to infer allele specific states, default=NULL which will use the maximum state from CNbins

selftransitionprob

probability to stay in the same state in the HMM, default = 0.999, set to 0.0 for an IID model

progressbar

Boolean to display progressbar or not, default = TRUE, will only show if ncores == 1

ncores

Number of cores to use, default = 1

likelihood

Likelihood model for HMM, default is `binomial`, other option is `betabinomial` or use `auto` and the algorithm will choose the likelihood that best fits the data.

minbins

Minimum number of bins containing both haplotype counts and copy number data for a cell to be included

minbinschr

Minimum number of bins containing both haplotype counts and copy number data per chromosome for a cell to be included

maxloherror

Maximum value for LOH error rate

filterhaplotypes

filter out haplotypes present in less than X fraction, default is 0.1

fillmissing

For bins with missing counts fill in values based on neighbouring bins

Value

allele specific copy number object which includes dataframe similar to input with additional columns which include

* `A` A allele copy number * `B` B allele copy number * `state_AS_phased` A|B * `state_min` Minor allele copy number * `LOH` =LOH if bin is LOH, NO otherwise * `state_phase` Discretized haplotype specific states * `phase` Whether the A allele or B allele is dominant * `alleleA` Counts for the A allele * `alleleB` Counts for the B allele * `totalcounts` Total number of counts * `BAF` B-allele frequency (alleleB / totalcounts)

Details

In the allele specific copy number inference A is always > B and state_AS_phased == state_AS