View source: R/accessory_functions.R
segmentstotemplate | R Documentation |
segmentstotemplate
"explodes" segment data and creates a data frame with information for all bins. This enables the use of data limited to segments in ACE-related functions.
segmentstotemplate(segmentdf, chrci = 1, startci = 2, endci = 3, binsci = 4, meanci = 5, seci, sdci, log = FALSE)
segmentdf |
Data frame or file path. Data frame or file path to tab-delimited file with segment data |
chrci |
Integer. Specifies the index of the column containing chromosome information. Default = 1 |
startci |
Integer. Specifies the index of the column containing start positions. Default = 2 |
endci |
Integer. Specifies the index of the column containing end positions. Default = 3 |
binsci |
Integer. Specifies the index of the column containing number of bins or number of probes. Default = 4 |
meanci |
Integer. Specifies the index of the column containing the segment value. Default = 5 |
seci |
Integer. Optional. Specifies the index of the column containing standard errors of the segment mean. See details below |
sdci |
Integer. Optional. Specifies the index of the column containing standard deviations of the segment mean. See details below |
log |
Logical or integer. If the data is given in log-values, the data is converted to linear scale using the given log base, or inverting the natural logarithm when set to TRUE. Default = FALSE |
Even though there is no copy number information for each bin, this needs to be provided for several ACE-related functions. By default, segmentstotemplate
will just "copy" the segment data. If the segment data comes with either standard deviations or standard errors, it is possible to "simulate" copy number data. To do so, segmentstotemplate
will use the R stats rnorm
function.
Returns a template data frame.
Keep in mind that copy number data is used in some functions, notably ACEcall
. If information on the variance of copy number values within segments is missing, calls are only based on adjusted segment values, because the p-values are all 0.
Also note that resulting templates should not be used for any of the functions that perform resegmentation (e.g. twosamplecompare
), or the results should be interpreted with due caution.
The functions singlemodel
and squaremodel
only use segment values and can be used to analyze the resulting template data frames. singleplot
can also be used without problem.
This function works fine with high resolution data, but the resulting template can be a bit much for other functions. For instance, the segmented data files provided by TCGA are the result of SNP arrays that have a resolution of roughly 1.5 kbp. The function compresstemplate
can help out to make input more manageable.
Jos B. Poell
compresstemplate
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.