inverse average expression using standard deviation (SD)

iae_sd(expr, features = NULL, log = FALSE, thres = 0)

Arguments

expr

a matrix, features in row and cells in column

features

vector, feature names or indexes to compute

log

logical, if to do log-transformation

thres

numeric, cell only counts when expr > threshold, default 0

Value

a vector of inverse average expression score for each feature

Details

$$\mathbf{IAE} = log(1+sd(tf_{i})*\frac{n}{\sum_{j=1}^{n}max(0,N_{i,j})+1})$$ where \(tf_i\) is the term frequency of feature \(i\), see details in tf(), \(n\) is the total number of cells and \(N_{i,j}\) is the counts of feature \(i\) in cell \(j\).

Examples

data <- matrix(rpois(100, 2), 10, dimnames = list(1:10))
smartid:::iae_sd(data)
#>          1          2          3          4          5          6          7 
#> 0.02626549 0.03606052 0.02841552 0.03780853 0.03492224 0.02283198 0.02837679 
#>          8          9         10 
#> 0.02239204 0.02142708 0.04101447