compresstemplate {ACE} | R Documentation

## Reduce the size of a template data frame

### Description

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

### Usage

    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

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

[Package ACE version 1.12.0 Index]