inverse average expression: max

iae_m(expr, features = NULL, thres = 0)

Arguments

expr

a matrix, features in row and cells in column

features

vector, feature names or indexes to compute

thres

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

Value

a matrix of inverse average expression score for each feature

Details

$$\mathbf{IAE_{i,j}} = log(1+\frac{max_{\{i^{'}\in j\}}(n_{i^{'}})}{\sum_{j = 1}^{n} max(0, N_{i,j} - threshold)+1})$$ where \(i\) is the feature \(i\) and \(i^{'}\) is the feature except \(i\), \(N_{i,j}\) is the counts of feature \(i\) in cell \(j\), and \(n_{i^{'}}\) is \(\sum_{j = 1}^{n} sign(N_{i,j} > threshold)\).

Examples

data <- matrix(rpois(100, 2), 10, dimnames = list(1:10))
smartid:::iae_m(data)
#>         [,1]      [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
#> 1  0.7922381 0.7922381 0.7922381 0.7922381 0.7922381 0.7922381 0.7922381
#> 2  0.9954281 0.9954281 0.9954281 0.9954281 0.9954281 0.9954281 0.9954281
#> 3  1.0340738 1.0340738 1.0340738 1.0340738 1.0340738 1.0340738 1.0340738
#> 4  0.8157495 0.8157495 0.8157495 0.8157495 0.8157495 0.8157495 0.8157495
#> 5  1.0761394 1.0761394 1.0761394 1.0761394 1.0761394 1.0761394 1.0761394
#> 6  0.8157495 0.8157495 0.8157495 0.8157495 0.8157495 0.8157495 0.8157495
#> 7  0.9267620 0.9267620 0.9267620 0.9267620 0.9267620 0.9267620 0.9267620
#> 8  0.9597758 0.9597758 0.9597758 0.9597758 0.9597758 0.9597758 0.9597758
#> 9  0.9954281 0.9954281 0.9954281 0.9954281 0.9954281 0.9954281 0.9954281
#> 10 0.6763401 0.6763401 0.6763401 0.6763401 0.6763401 0.6763401 0.6763401
#>         [,8]      [,9]     [,10]
#> 1  0.7922381 0.7922381 0.7922381
#> 2  0.9954281 0.9954281 0.9954281
#> 3  1.0340738 1.0340738 1.0340738
#> 4  0.8157495 0.8157495 0.8157495
#> 5  1.0761394 1.0761394 1.0761394
#> 6  0.8157495 0.8157495 0.8157495
#> 7  0.9267620 0.9267620 0.9267620
#> 8  0.9597758 0.9597758 0.9597758
#> 9  0.9954281 0.9954281 0.9954281
#> 10 0.6763401 0.6763401 0.6763401