View source: R/accessory_functions.R
compresstemplate | R Documentation |
compresstemplate
combines bins to reduce the size of a template data frame.
compresstemplate(template, factor = 20, funtype = "median")
template |
Data frame as created by |
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" |
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.
Returns a template data frame with increased bin size and reduced number of features compared to the input data frame.
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).
Jos B. Poell
objectsampletotemplate
, segmentstotemplate
## segmented data from a QDNAseq-object data("copyNumbersSegmented") template <- objectsampletotemplate(copyNumbersSegmented, index = 1) ct <- compresstemplate(template, factor = 10) length(template$bin) length(ct$bin)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.