find_minimum: Find local minimum in distance function on fitting relative...

Description Usage Arguments Value Examples

View source: R/fitting.R

Description

Finds the local minimum in the distance function from scaling relative copy numbers to absolute copy number starting from the given ploidy and cellularity.

Usage

1
2
3
4
5
6
7
find_minimum(
  ploidy,
  cellularity,
  relative_copy_numbers,
  weights = NULL,
  distance_function = c("MAD", "RMSD")
)

Arguments

ploidy

the tumour ploidy.

cellularity

the cellularity, i.e. the fraction of cells that are from the tumour.

relative_copy_numbers

a numeric vector containing relative copy numbers, i.e. ratios of copy numbers to the average copy number.

weights

a numeric vector of weights to apply to each copy number value (should be same length as relative_copy_numbers)

distance_function

the distance function to use, either "MAD" for the mean absolute difference or "RMSD" for the root mean square difference, where differences are between the fitted absolute copy number values and the nearest whole number.

Value

the distance in the fitted absolute copy numbers to whole numbers.

Examples

1
2
3
data(copy_number)
copy_number <- copy_number[copy_number$sample == "X17222", ]
find_minimum(3, 0.67, copy_number$segmented)

crukci-bioinformatics/rascal documentation built on Dec. 19, 2021, 6:21 p.m.