Helper function to calculate signal ceiling of numeric matrix

get_nmat_ceiling(imat, iceiling = NULL, verbose = TRUE, ...)

Details

This function is called by nmatlist2heatmaps() and is not intended to be called directly.

It takes a normalizedMatrix or numeric matrix object, and a ceiling value iceiling and determines an appropriate numeric ceiling with the following rules:

  • if iceiling is NULL, it returns the highest absolute value in imat

  • if iceiling > 0 and iceiling <= 1, it calculates quantile(abs(imat), probs=iceiline) using only non-zero values

  • otherwise iceiling is used as a numerical ceiling

In all cases, iceiling is rounded to 3 digits with round(iceiling, digits=3)

Also in all cases, na.rm=TRUE is used, to prevent returning NA.

See also