MLE assignment of (low-depth) samples to a tree

add_lowpass_sampled(
  tree,
  phydata,
  sample_data,
  min_confidence = 0,
  vaf_bkgr = 0.01,
  purity_estimates = rep(0.75, length(sample_data)),
  min_edge_length = 0,
  return_details = TRUE,
  optimize_values = TRUE,
  max_vaf_bkgr = 0.1,
  max_loss_frac = 0,
  loss_frac_init = 0,
  rescale_tree = TRUE,
  control = NULL,
  n_bootstraps = 0,
  n_cores = 1,
  ...
)

Arguments

tree

A tree object (of class phylo).

phydata

Phylogenetic data used for the tree construction (of class phyDat).

Note: The attribute attr(*, "id") containng mutation ids has to be added (e.g., c("chr1:5_A/T", ...)

sample_data

A list of mutation data of samples to add the the tree.

Each element must contain a data frame with the following columns:

  • 'id': The mutation id as set in the 'phydata' argument.

  • 'alt' (or 'alt_count'): The number of mutated reads.

  • 'depth' (or 'dp'): The coverage of the site.

  • 'cn_total' (or 'cn'): The copy-number of the site.

  • 'cn_mutated' (or 'mm'): The number of mutated alleles (this is assumed to be 1 if missing).

min_confidence

(optional) minimum confidence in the the edge a sample is assigned to (default: 0).

vaf_bkgr

(optional) expected background mutation rate of unmutated sites (default 0.01).

purity_estimates

(optional) purity of the samples. Must be the same length as the sample_data list (default 1.0, pure samples).

min_edge_length

(optional) numeric value indicating the length of the edges to the added tips relative to the tree height (default: 0.01).

return_details

(optional) logical flag indicating if detailed information should be returned (default: false).

optimize_values

(optional) logical flag indicating if purity, background mutation rate, (and loss fraction) should be optimized (default: true).

max_vaf_bkgr

(optional) maximum background mutation rate (default: 0.1).

max_loss_frac

(optional) maximum loss fraction (default: 0).

loss_frac_init

(optional) initial value of loss fraction (default: 0).

rescale_tree

(optional) flag indicating if the tree should be rescaled (default: true).

control

(optional) control passed to optimizer (default: NULL).

n_bootstraps

(optional) Number of bootstraps to perform (default: 0).

n_cores

(optional) Number of cores to use for bootstrapping (default: 0).

...

unused arguments.

Value

A tree object with the samples in 'sample_data' added to it.