This function takes an initial optimum rho/psi pair and uses an internal distance metric to calculate a score for each rho/psi pair allowed. The solution with the best score is then taken to obtain a global copy number profile. This function performs both a grid search and tries to find a reference segment, but the grid search result is always used for now.

run_clonal_ASCAT(
  lrr,
  baf,
  lrrsegmented,
  bafsegmented,
  chromosomes,
  segBAF.table,
  input_optimum_pair,
  dist_choice,
  distancepng = NA,
  copynumberprofilespng = NA,
  nonroundedprofilepng = NA,
  gamma_param,
  read_depth,
  uninformative_BAF_threshold,
  allow100percent,
  reliabilityFile = NA,
  psi_min_initial = 1,
  psi_max_initial = 5.4,
  rho_min_initial = 0.1,
  rho_max_initial = 1.05,
  chr.names
)

Arguments

lrr

(unsegmented) log R, in genomic sequence (all probes), with probe IDs

baf

(unsegmented) B Allele Frequency, in genomic sequence (all probes), with probe IDs

lrrsegmented

log R, segmented, in genomic sequence (all probes), with probe IDs

bafsegmented

B Allele Frequency, segmented, in genomic sequence (only probes heterozygous in germline), with probe IDs

chromosomes

a list containing c vectors, where c is the number of chromosomes and every vector contains all probe numbers per chromosome

segBAF.table

Segmented BAF data.frame from get_segment_info

input_optimum_pair

A list containing fields for rho, psi and ploidy, as is output from runASCAT

dist_choice

The distance metric to be used internally to penalise a copy number solution

distancepng

if NA: distance is plotted, if filename is given, the plot is written to a .png file (Default NA)

copynumberprofilespng

if NA: possible copy number profiles are plotted, if filename is given, the plot is written to a .png file (Default NA)

nonroundedprofilepng

if NA: copy number profile before rounding is plotted (total copy number as well as the copy number of the minor allele), if filename is given, the plot is written to a .png file (Default NA)

gamma_param

technology parameter, compaction of Log R profiles (expected decrease in case of deletion in diploid sample, 100 "%" aberrant cells; 1 in ideal case, 0.55 of Illumina 109K arrays) (Default 0.55)

read_depth

TODO: unused parameter that should be removed

uninformative_BAF_threshold

The threshold beyond which BAF becomes uninformative

allow100percent

A boolean whether to allow a 100"%" cellularity solution

reliabilityFile

String to where fit reliabilty information should be written. This file contains backtransformed BAF and LogR values for segments using the fitted copy number profile (Default NA)

psi_min_initial

Minimum psi value to be considered (Default: 1.0)

psi_max_initial

Maximum psi value to be considered (Default: 5.4)

rho_min_initial

Minimum rho value to be considered (Default: 0.1)

rho_max_initial

Maximum rho value to be considered (Default: 1.05)

chr.names

A vector with chromosome names used for plotting

Value

A list with fields output_optimum_pair, output_optimum_pair_without_ref, distance, distance_without_ref, minimise and is.ref.better