R/ruleout_features.R
select_ruleout_features.RdRanks each feature by the specificity it achieves as a single-marker
classifier when its threshold is set to capture at least
target_sensitivity of cases. Both directions are tried (high values call
positive, or low values call positive) and the better one is kept, so the
score is direction-agnostic. With multiple cohorts the per-cohort
specificities are combined by cohort_aggregation (the default "min"
rewards features that hold up in every cohort) within each direction, and
only then is the better direction kept. The direction is therefore shared
by every cohort: a feature that is high in cases in one cohort and low in
another cannot score well in both, which matters for ratio transforms, where
a direction flip cancels rather than adds signal.
select_ruleout_features(
x_list,
y_list,
n_features = 50L,
target_sensitivity = 0.9,
cohort_aggregation = c("min", "mean"),
assay = NULL
)A matrix-like object, SummarizedExperiment, or list of such
objects. Rows represent samples and columns represent features.
A binary response aligned with x_list. Provide a list when
x_list is a list.
Maximum number of features to return (default 50).
Minimum fraction of cases a feature's threshold
must capture (default 0.90). Must lie in (0, 1].
How per-cohort specificities are combined into a
single ranking score: "min" (default, worst cohort) or "mean".
For SummarizedExperiment inputs, the assay name or index to
extract prior to analysis.
Character vector of feature identifiers ordered by decreasing specificity at the sensitivity target. A feature whose score is undefined in any cohort (no non-missing case values there) is dropped.
This differs from AUC-based ranking (e.g. select_discriminative_features())
in that only the high-sensitivity tail of the ROC curve counts: a feature
whose cases are mostly well separated but with a minority buried inside the
control distribution has a good AUC yet a poor rule-out specificity. It is
the univariate, per-feature analogue of the
"specificity_at_sensitivity" objective used to score fitted panels during
optimisation.
Thresholds are observed case values (order statistics): with n
non-missing cases the smallest k = ceiling(n * target_sensitivity) cases
that still meet the target are called positive, so the positive side
always contains at least target_sensitivity of the cases and never more
than needed. Missing values are ignored when locating thresholds and
computing specificities. Every cohort must contain at least one case and
one control.