Applies a log-x transformation (by default log2) through the log()
function.
Usage
transform_logx(
mat,
return_matrix_only = FALSE,
log_base = 2,
pre_log_function = zero_to_half_min
)
Arguments
- mat
Numeric matrix.
- return_matrix_only
Logical, should only the transformed matrix be returned? If
TRUE
, the function will return a matrix. IfFALSE
, the function instead returns a list with the transformed data and potentially other information relevant to the transformation. Default value isFALSE
.- log_base
Numeric, the base with respect to which logarithms are computed.
- pre_log_function
Function that will be applied to the matrix before the log transformation (e.g. to apply an offset to the values to avoid issues with zeros). Default value is the
zero_to_half_min()
function.