Read absolute copy number profile for preparing CNV signature analysis. See detail part of sig_tally() to see how to handle sex to get correct summary.

read_copynumber(
input,
pattern = NULL,
ignore_case = FALSE,
seg_cols = c("Chromosome", "Start.bp", "End.bp", "modal_cn"),
samp_col = "sample",
loh_min_len = 10000,
loh_min_frac = 0.05,
skip_annotation = FALSE,
min_segnum = 0L,
max_copynumber = 20L,
genome_build = c("hg19", "hg38", "mm10"),
genome_measure = c("called", "wg"),
complement = FALSE,
...
)

## Arguments

input a data.frame or a file or a directory contains copy number profile. an optional regular expression used to select part of files if input is a directory, more detail please see list.files() function. logical. Should pattern-matching be case-insensitive? four strings used to specify chromosome, start position, end position and copy number value in input, respectively. Default use names from ABSOLUTE calling result. a character used to specify the sample column name. If input is a directory and cannot find samp_col, sample names will use file names (set this parameter to NULL is recommended in this case). if TRUE, add LOH labels to segments. NOTE a column 'minor_cn' must exist to indicate minor allele copy number value. Sex chromosome will not be labeled. The length cut-off for labeling a segment as 'LOH'. Default is 10Kb. When join_adj_seg set to TRUE, only the length fraction of LOH region is larger than this value will be labeled as 'LOH'. Default is 30%. if TRUE (default), join adjacent segments with same copy number value. This is helpful for precisely count the number of breakpoint. When set use_all=TRUE, the mean function will be applied to extra numeric columns and unique string columns will be pasted by comma for joined records. if TRUE, skip annotation step, it may affect some analysis and visualization functionality, but speed up reading data. default is FALSE. If True, use all columns from raw input. minimal number of copy number segments within a sample. bigger copy number within a sample will be reset to this value. genome build version, should be 'hg19', 'hg38' or 'mm10'. default is 'called', can be 'wg' or 'called'. Set 'called' will use called segments size to compute total size for CNA burden calculation, this option is useful for WES and target sequencing. Set 'wg' will use autosome size from genome build, this option is useful for WGS, SNP etc.. if TRUE, complement chromosome (except 'Y') does not show in input data with normal copy 2. other parameters pass to data.table::fread()

## Value

a CopyNumber object.

## Author

Shixiang Wang w_shixiang@163.com

## Examples

# Load toy dataset of absolute copynumber profile
package = "sigminer", mustWork = TRUE
))
seg_cols = c("chromosome", "start", "end", "segVal"),
genome_build = "hg19", complement = FALSE
)
cn
cn_subset <- subset(cn, sample == "TCGA-DF-A2KN-01A-11D-A17U-01")

set.seed(1234)
segTabs\$minor_cn <- sample(c(0, 1), size = nrow(segTabs), replace = TRUE)