labeled inverse average expression: IGM
iae_igm(expr, features = NULL, label, lambda = 7, thres = 0)
Arguments
- expr
a matrix, features in row and cells in column
- features
vector, feature names or indexes to compute
- label
vector, group label of each cell
- lambda
numeric, hyperparameter for IGM
- thres
numeric, cell only counts when expr > threshold, default 0
Value
a vector of inverse gravity moment score for each feature
Details
$$\mathbf{IGM_i} = log(1+\lambda\frac{max(mean(N_{i,j\in D})_{k})}{\sum_{k}^{K}(mean(N_{i,j\in D})_{k}*r_{k})+e^{-8}})$$
where \(\lambda\) is the hyper parameter, \(N_{i,j\in D}\) is the counts
of feature \(i\) in cell \(j\) within class \(D\), and \(r_k\) is the
rank of \(mean(N_{i,j\in D})\).
Examples
data <- matrix(rpois(100, 2), 10, dimnames = list(1:10))
smartid:::iae_igm(data, label = sample(c("A", "B"), 10, replace = TRUE))
#> 1 2 3 4 5 6 7 8
#> 1.258461 1.504077 1.413693 1.360092 1.203973 1.283110 1.203973 1.397105
#> 9 10
#> 1.572397 1.203973