summarizeMatrix: Summarize matrix

View source: R/mfishMapping.r

summarizeMatrixR Documentation

Summarize matrix

Description

Groups columns in a matrix by a specified group vector and summarizes using a specificed function. Optionally binarizes the matrix using a specified cutoff parameter. This is a wrapper for tapply.

Usage

summarizeMatrix(
  mat,
  group,
  scale = "none",
  scaleQuantile = 1,
  binarize = FALSE,
  binMin = 0.5,
  summaryFunction = median,
  ...
)

Arguments

mat

matrix where the columns (e.g., samples) are going to be grouped

group

vector of length dim(mat)[2] corresponding to the groups

scale

either 'none' (default),'row', or 'column'

scaleQuantile

what quantile of value should be set as 1 (default=1)

binarize

should the data be binarized? (default=FALSE)

binMin

minimum ON value for the binarized matrix (ignored if binarize=FALSE)

summaryFunction

function (or function name) to be used for summarization

...

additional parameters for summaryFunction

Value

matrix of summarized values


AllenInstitute/mfishtools documentation built on July 5, 2023, 4:20 p.m.