Learn R Programming

sigminer (version 1.0.5)

read_copynumber: Read Absolute Copy Number Profile

Description

Read absolute copy number profile for preparing CNV signature analysis.

Usage

read_copynumber(
  input,
  pattern = NULL,
  ignore_case = FALSE,
  seg_cols = c("Chromosome", "Start.bp", "End.bp", "modal_cn"),
  samp_col = "sample",
  join_adj_seg = TRUE,
  use_all = FALSE,
  min_segnum = 0L,
  max_copynumber = 20L,
  genome_build = c("hg19", "hg38"),
  genome_measure = c("called", "wg"),
  complement = TRUE,
  ...
)

Arguments

input

a data.frame or a file or a directory contains copy number profile.

pattern

an optional regular expression used to select part of files if input is a directory, more detail please see list.files function.

ignore_case

logical. Should pattern-matching be case-insensitive?

seg_cols

four characters used to specify chromosome, start position, end position and copy number value in input, respectively. Default use names from ABSOLUTE calling result.

samp_col

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).

join_adj_seg

if TRUE (default), join adjacent segments with same copy number value. This is helpful for precisely count the number of breakpoint.

use_all

default is FALSE. If True, use all columns from raw input.

min_segnum

minimal number of copy number segments within a sample.

max_copynumber

bigger copy number within a sample will be reset to this value.

genome_build

genome build version, should be 'hg19' or 'hg38'.

genome_measure

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..

complement

if TRUE, complement chromosome (except 'Y') does not show in input data with normal copy 2 and force use_all to FALSE (no matter what user input).

...

other parameters pass to data.table::fread()

Value

a CopyNumber object.

See Also

read_maf for reading mutation data to MAF object.

Examples

Run this code
# NOT RUN {
# Load toy dataset of absolute copynumber profile
load(system.file("extdata", "toy_segTab.RData",
  package = "sigminer", mustWork = TRUE
))
cn <- read_copynumber(segTabs,
  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")

tab_file <- system.file("extdata", "metastatic_tumor.segtab.txt",
  package = "sigminer", mustWork = TRUE
)
cn2 <- read_copynumber(tab_file)
cn2
# }

Run the code above in your browser using DataLab