quantileTrim: Advanced usage: Quantile trim a matrix or matrix pair

Description Usage Arguments Value Examples

Description

Internal function for performing the quantile trimming. Removes outlier rows with the highest or lowest sums. If two matrices are supplied, trims both matrices simultaniously.

Usage

1
2
3
4
5
6
7
8
9
quantileTrim(mat1, mat2 = NULL, lower = 0, upper = 1)

## S4 method for signature 'matrix,NULL_OR_missing'
quantileTrim(mat1, mat2 = NULL,
  lower = 0, upper = 1)

## S4 method for signature 'matrix,matrix'
quantileTrim(mat1, mat2 = NULL, lower = 0,
  upper = 1)

Arguments

mat1

matrix: Sites in rows, positions in columns.

mat2

matrix or NULL: Optional second matrix with the same shape.

lower

numeric: Lower cutoff for trimming (between 0-1).

upper

numeric: Upper cutoff for trimming (between 0-1).

Value

trimmed matrix or list of trimmed matrices

Examples

1
2
3
4
5
6
7
8
9
# Make some random matrices
m1 <- replicate(5, rnorm(10))
m2 <- replicate(5, rnorm(10))

# Trim a single matrix
quantileTrim(mat1=m1, upper=0.75)

# Trim a pair of matrices (e.g. forward/reverse strand)
quantileTrim(mat1=m1, mat2=m2, upper=0.75)

MalteThodberg/TeMPO documentation built on May 15, 2019, 11:48 a.m.