Fits RUV-4 to jointly estimate outcome-associated signal and unwanted variation per feature, then ranks features by the ratio (or composite z-score) of discrimination strength to unwanted-variation sensitivity. Unlike cohort-label-based methods, RUV-4 estimates latent batch factors from negative control genes, making it suitable when cohort structure is ambiguous or confounders are continuous.
select_ruv_features(
x_list,
y_list,
n_features = 50L,
k = NULL,
neg_control_method = c("empirical", "list"),
neg_control_genes = NULL,
neg_control_quantile = 0.75,
iterate_controls = FALSE,
max_iterations = 3L,
scoring = c("ratio", "composite_z"),
epsilon = 0.01,
ebayes = TRUE,
return_corrected = FALSE,
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. Must be a factor with
levels c("No", "Yes"). Provide a list when x_list is a list.
Maximum number of features to return (default 50).
Number of unwanted variation factors to estimate. When NULL
(default), auto-selected via PCA on the negative control submatrix.
Method for identifying negative control genes.
"empirical" (default) selects non-significant genes from a pooled limma
fit; "list" uses genes supplied via neg_control_genes.
Character vector of negative control gene names.
Required when neg_control_method = "list".
Quantile threshold for empirical control
selection (default 0.75). Features with p-value above this quantile are
selected as controls.
If TRUE, iteratively refine the negative control
set by re-running limma on RUV-corrected expression. Default FALSE.
Maximum number of control refinement iterations
(default 3).
Scoring method. "ratio" (default) uses
discrimination / (alpha_norm + epsilon); "composite_z" uses
z(discrimination) + z(-alpha_norm).
Small constant added to alpha_norm denominator in ratio
scoring (default 0.01).
If TRUE (default), apply empirical Bayes variance shrinkage
via ruv::variance_adjust() for better-calibrated t-statistics.
If TRUE, include the RUV-4-corrected expression
matrix in the output. Default FALSE.
For SummarizedExperiment inputs, the assay name or index to
extract prior to analysis.
A list with components:
Character vector of selected feature names.
Data frame with per-feature scoring metadata: feature,
discrimination, alpha_norm, score, rank.
List of RUV-4 diagnostics: k, n_controls,
control_genes, W_outcome_cor, W_cohort_cor.
RUV-4-corrected expression matrix (only when
return_corrected = TRUE).
List of parameter values used.
This method complements the existing cohort-label-based selectors
(select_transferable_features(), select_discriminative_features()) by
estimating latent unwanted factors from negative control genes rather than
requiring explicit cohort labels. It is particularly useful when batch
structure is ambiguous, confounders are continuous, or multiple sources of
unwanted variation overlap.
The discrimination axis measures how strongly each feature associates with the outcome after accounting for unwanted variation (via the RUV-4 t-statistic). The alpha_norm axis measures each feature's total loading on the estimated unwanted factors (L2 norm across k factors). Features with high discrimination and low alpha_norm are prioritised.
select_transferable_features(), select_discriminative_features(),
select_de_features(), select_batch_associated_features() for the
label-based counterpart that targets batch-associated genes directly.