Builds a ranked list one feature at a time. Each feature's relevance is its moderated limma |t| for the case/control contrast on the pooled cohorts (cohort as a covariate), scaled so the most relevant feature scores 1. At each step the candidate with the highest relevance minus its redundancy with the features already selected is added. Redundancy is the absolute correlation between two features measured within each cohort and averaged over cohorts, so shared batch structure is not mistaken for biological co-regulation.

select_nonredundant_features(
  x_list,
  y_list,
  n_features = 50L,
  penalty = c("max", "mean"),
  cor_method = c("spearman", "pearson"),
  assay = NULL
)

Arguments

x_list

A matrix-like object, SummarizedExperiment, or list of such objects. Rows represent samples and columns represent features.

y_list

A binary response aligned with x_list. Provide a list when x_list is a list.

n_features

Number of features to return (default 50).

penalty

How a candidate's redundancy with the already-selected features is summarised: "max" (default) uses its largest |correlation| with any selected feature, so a near-duplicate of any member is always penalised in full; "mean" uses the average, which lets a near-duplicate of one member through once enough unrelated features have been selected.

cor_method

Correlation used for redundancy: "spearman" (default) or "pearson".

assay

For SummarizedExperiment inputs, the assay name or index to extract prior to analysis.

Value

Character vector of feature identifiers in selection order. Features whose relevance is undefined are dropped.

Details

The first feature is always the most relevant one, so the ranking diverges from select_de_features() only from the second feature onwards.

Only features shared by every cohort are considered. Each cohort needs at least three samples to estimate correlations. With missing values, Spearman ranks are taken per feature over its observed samples and correlations use pairwise-complete observations; an undefined correlation (e.g. a feature constant within a cohort) counts as zero redundancy.

Each step correlates every candidate with the newly added feature only, so no features x features matrix is formed and the cost grows linearly in n_features.