Score REO-UCell within-sample rank signature
Source:R/singlesample-reo-scorers.R
score_reo_ucell.RdScores each row of X independently with the frozen signature learned
by fit_reo_ucell. For one sample, features in the frozen
training universe that are present in X are ranked in decreasing
abundance using rank(-x, ties.method = "average"). For a signature
\(S\) of size \(n\), ranks are capped at maxRank_eff + 1, where
maxRank_eff = min(model$maxRank, number of present universe features).
The UCell-style score is
$$1 - \{ \sum_{f \in S} \min(r_f, maxRank_eff + 1) - n(n+1)/2 \} /
(n \times maxRank_eff).$$
If no up or down signature features are present, that direction contributes
0. With use_down = TRUE, the returned score is
UCell(up) - UCell(down); otherwise it is UCell(up).
Because both the ranking universe and maxRank_eff depend on which
model-universe features are present in X, scores are only comparable
across specimens evaluated on the same feature panel; score each cohort in a
single comparison with one consistent set of features.
Arguments
- model
A
reo_ucell_modelobject returned byfit_reo_ucell.- X
Numeric matrix (samples \(\times\) features) of non-negative abundance values. Columns must be named feature ids.
- meta
Optional per-sample metadata. Accepted for interface uniformity and ignored by this method.
Value
Numeric vector of one finite score per row of X. Scores use
only each row's own values plus the frozen model, with no scored-batch
centering, quantiles, or renormalization.
References
Andreatta M, Carmona SJ. (2021) UCell: Robust and scalable single-cell gene signature scoring. Computational and Structural Biotechnology Journal 19: 3796-3798.