trim_matdist: Trim extreme values in a pre-processed matrix

View source: R/utils.R

trim_matdistR Documentation

Trim extreme values in a pre-processed matrix

Description

Smooths the extreme values in a chi-square-transformed matrix to lessen the influence of "rare objects."

Usage

trim_matdist(mat, pct_trim = 0.01)

Arguments

mat

matrix; should be pre-processed/normalized to some sort of approximately normally distributed statistic (e.g., chi-squared transformation with 'corral_preproc' or Z-score normalization)

pct_trim

numeric; the percent of observations to smooth. Defaults to 'pct_trim' = .01, which corresponds to smoothing all observations to be between the .5 percentile and 99.5 percentile range of the input matrix

Details

(Usually not called directly; can be included by using the 'smooth' argument in the 'corral', 'corralm', and 'corral_preproc' functions)

Value

smoothed matrix

Examples

count_mat <- matrix(rpois(10000, 300)*rbinom(10000,1,.1), ncol = 100)
smoothed_preproc_mat <- corral_preproc(count_mat, smooth = TRUE)

laurenhsu1/corral documentation built on Feb. 19, 2023, 10:37 p.m.