
Determine if a given ploidy and cellularity for fitting copy numbers is acceptable
IsAcceptablePloidyAndCellularity.Rd
Determines if the given ploidy and cellularity are compatible with the provided relative copy numbers based on the proportion of copy number values that correspond to or are below the zero copy number state and on the proportion that are sufficiently close to a whole number copy number state. Copied from rascal.
Usage
IsAcceptablePloidyAndCellularity(
ploidy,
cellularity,
relative_copy_numbers,
weights = NULL,
max_proportion_zero = 0.05,
min_proportion_close_to_whole_number = 0.5,
max_distance_from_whole_number = 0.15
)
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)
- max_proportion_zero
the maximum proportion of fitted absolute copy number values in the zero copy number state.
- min_proportion_close_to_whole_number
the minimum proportion of fitted absolute copy number values sufficiently close to a whole number.
- max_distance_from_whole_number
the maximum distance from a whole number that a fitted absolute copy number can be to be considered sufficiently close.
Examples
data(copy_number)
copy_number <- copy_number[copy_number$sample_id == "X17222", ]
IsAcceptablePloidyAndCellularity(3, 0.67, copy_number$segmented)
#> [1] TRUE