Description Usage Arguments Details Value Examples
View source: R/computeMatrix.R
Averages Matrix Columns into Windows using an Averaging Function amd a defined number of windows
1 | collapse_to_n_windows(anno, mat, collapse_fun = mean, n_windows = 10)
|
mat |
matrix |
collapse_fun |
function for averaging values inside windows (Default = rowMeans, see Details). |
n_windows |
number of windows (default=10, ie collapse to 10 values eah) |
for a matrix with ncol=100 or 50 and n_windows=10, will return a matrix with ncol=10 in both cases. collapse_fun is a function that functions as ie rowMeans (the default) or rowSums.
matrix with n_windows columns
1 2 3 4 5 6 | bedfile <- system.file("extdata", "snRNA_MS31_hg38.bed", package = "RMetaTools")
regions <- rtracklayer::import(bedfile)
mat <- get_single_strand_matrix(bw=bw, anno=regions, upstream=NULL, downstream=NULL)
dim(mat)
matc <- collapse_to_n_windows(anno, mat, mean, 10)
dim(matc)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.