averageMatrixEdges: Average edges of a matrix to facilitate downsampling.

Description Usage Arguments Value Examples

View source: R/averageMatrixEdges.R

Description

Averages the columns and rows of a matrix by a certain amount.

Usage

1
2
averageMatrixEdges(unchangedmatrix, nedges = 1, dimension = c("row",
  "column"))

Arguments

unchangedmatrix

A matrix to have edges averaged with genomic coordinates in the form chr1_50_100 set as the column and row names.

nedges

The number of edges to be averaged

dimension

Selectively averages edges in one dimension. Performs symmetric edge averaging by default.

Value

averaged_matrix A matrix with edges averaged, which may be more amenable to downsampling

Examples

1
2
3
4
5
6
7
8
load(system.file("extdata","nbl_result_matrix_sign_small.rda",package = "CNVScope"))
dim(nbl_result_matrix_sign_small)
nbl_result_matrix_sign_small_avg<-averageMatrixEdges(nbl_result_matrix_sign_small,
nedges=1,dimension="row")
dim(nbl_result_matrix_sign_small_avg)
nbl_result_matrix_sign_small_avg<-averageMatrixEdges(nbl_result_matrix_sign_small,
nedges=1,dimension="column")
dim(nbl_result_matrix_sign_small_avg)

jamesdalg/CNVScope documentation built on Aug. 4, 2019, 9:24 p.m.