Skip to contents

A conveniece wrapper function for hmmcopy_singlecell() to test multiple candidate multiplier (aka ploidy) values and return either the best result, or a list of all results for downstream analysis.

Usage

run_sc_hmmcopy(
  chr,
  start,
  end,
  counts,
  reads,
  ideal = rep(TRUE, length(counts)),
  param = params_sc_hmm(),
  cell_id,
  multipliers = 1:6,
  verbose = FALSE,
  maxiter = 200,
  n_cutoff = NULL,
  return = c("best", "all")
)

Arguments

chr

Vector of chromosomes

start

Vector of bin start positions

end

Vector of bin end positions

counts

Vector of bin corrected counts. These should ideally be GC corrected counts from gc_cor_modal()

reads

A vector of raw read counts per bin

ideal

A logical vector indicating which bins are ideal for analysis. See is_ideal_bin()

param

A matrix of parameter values in columns for each state in rows. See HMMcopy::HMMsegment() for more information.

cell_id

Cell id

multipliers

Positive integer list of ploidy multipliers to test

verbose

Print verbose

maxiter

The maximum number of iterations allows for the Maximum-Expectation algorithm, reduce to decrease running time at the expense of robustness.

n_cutoff

Cutoff for the number of bins in a given state for calculating the true_multiplier value. Defaults to 5% of bins.

return

a character. One of best or all to either return the result for the best ploidy only, or a list of results for all ploidies

Value

A list with the following objects:

bincounts

Data frame of bin counts with copy state

modal_seg

Data frame of genome segments

mstats

A single row of cell summary statistics

df_params

Data frame of parameters used for each iteration and state