Transform Copy Number Table

transform_seg_table(
data,
genome_build = c("hg19", "hg38", "mm10"),
ref_type = c("cytoband", "gene"),
values_fill = NA,
values_fn = function(x, ...) {     round(mean(x, ...)) },
resolution_factor = 1L
)

## Arguments

data a CopyNumber object or a data.frame containing at least 'chromosome', 'start', 'end', 'segVal', 'sample' these columns. genome build version, used when data is a data.frame, should be 'hg19' or 'hg38'. annotation data type used for constructing matrix. Optionally, a (scalar) value that specifies what each value should be filled in with when missing. This can be a named list if you want to apply different aggregations to different value columns. Optionally, a function applied to the value in each cell in the output. You will typically use this when the combination of id_cols and value column does not uniquely identify an observation. This can be a named list if you want to apply different aggregations to different value columns. an integer to control the resolution. When it is 1 (default), compute frequency in each cytoband. When it is 2, use compute frequency in each half cytoband.

## Value

a data.table.

## Examples

load(system.file("extdata", "toy_copynumber.RData",
package = "sigminer", mustWork = TRUE
))
# Compute the mean segVal in each cytoband
x <- transform_seg_table(cn, resolution_factor = 1)
x
# Compute the mean segVal in each half-cytoband
x2 <- transform_seg_table(cn, resolution_factor = 2)
x2