compresstemplate: Reduce the size of a template data frame

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/accessory_functions.R

Description

compresstemplate combines bins to reduce the size of a template data frame.

Usage

1
compresstemplate(template, factor = 20, funtype = "median")

Arguments

template

Data frame as created by objectsampletotemplate

factor

Integer. Number of bins to combine into a single bin. Default = 20

funtype

Character string. Specifies the function used to combine bins. Either "mean" or "median". Default = "median"

Details

compresstemplate can be used when the number of features in a template is too large for downstream analyses. Bins are combined, resulting in larger bin sizes and a reduced number of features.

Value

Returns a template data frame with increased bin size and reduced number of features compared to the input data frame.

Note

Segmentation is slightly affected by this function due to the fact that the breakpoints will usually fall somewhere within a newly created bin. In case of funtype "mean" the segment value of this bin will be different from both adjacent bins and therefore create a 1-bin-segment. This "oversegmentation" is greatly reduced when using funtype "median" (especially when argument factor is and odd number).

Author(s)

Jos B. Poell

See Also

objectsampletotemplate, segmentstotemplate

Examples

1
2
3
4
5
6
## segmented data from a QDNAseq-object
data("copyNumbersSegmented")
template <- objectsampletotemplate(copyNumbersSegmented, index = 1)
ct <- compresstemplate(template, factor = 10)
length(template$bin)
length(ct$bin)

ACE documentation built on Nov. 8, 2020, 5:30 p.m.