Skip to contents

Checks and sets required parameters for "model" or "region" mode in CNV calling, ensuring user input is sufficient and filling in missing values when possible.

Usage

Checkmode(mode, purity, dicovsf, chromosome, start, end, call)

Arguments

mode

Character. Mode of operation; either "model" or "region".

purity

Numeric or NULL. Tumor purity value or range (required for "model" mode if dicovsf is not provided).

dicovsf

Numeric or NULL. Size factor (diploid coverage scale factor) or range (required for "model" mode if purity is not provided).

chromosome

Character or NULL. Chromosome number for diploid region (required for "region" mode).

start

Numeric or NULL. Start coordinate of the diploid region. If not set in "region" mode, the program will use the first nucleotide of the detectable region of the chromosome.

end

Numeric or NULL. End coordinate of the diploid region. If not set in "region" mode, the program will use the last nucleotide of the detectable region of the chromosome.

call

Data frame or tibble. Segment call data, required if estimating dicovsf in "region" mode.

Value

A named list with updated parameters: mode, dicovsf, and purity.

Details

  • In "model" mode, at least one of purity or dicovsf must be provided.

  • In "region" mode, chromosome must be provided; if dicovsf is missing, it is estimated using EstimateCovSF() with the specified region.

Examples

Checkmode("model", purity = 0.7, dicovsf = NULL, chromosome = NULL, start = NULL, end = NULL, call = call_df)
#> $mode
#> [1] "model"
#> 
#> $dicovsf
#> NULL
#> 
#> $purity
#> [1] 0.7
#> 
Checkmode("region", purity = NULL, dicovsf = NULL, chromosome = "1", start = 100000, end = 200000, call = call_df)
#> Error: object 'call_df' not found