stratify_sig: Stratify samples into classes

View source: R/stratify_sig.R

stratify_sigR Documentation

Stratify samples into classes

Description

stratify_sig() is supposed to be used in combination after hack_sig() in order to classify your samples in one of two or more signature classes.

Usage

stratify_sig(sig_data, cutoff = "original", probs = seq(0, 1, 0.25))

Arguments

sig_data

A tibble result of a call to hack_sig().

cutoff

A character specifying which function to use to categorize samples by signature scores. Can be one of:

  • "original" (default), apply the original publication method; if categorization is not expected, the median score is used as a threshold;

  • "mean"/"median", samples will be classified as "low" or "high" with respect to the mean/median signature score, respectively;

  • "quantile", samples will be classified into signature score quantiles;

probs

A numeric vector of probabilities with values in ⁠[0, 1]⁠ to use in combination with cutoff = "quantile". By default, it corresponds to quartiles (c(0, 0.25, 0.5, 0.75, 1)).

Value

A tibble with the same dimension as sig_data, having a column sample_id with sample identifiers and one column for each input signature giving sample classes.

See Also

hack_sig(), stats::quantile()

Examples

scores <- hack_sig(test_expr, "immune")
stratify_sig(scores)

Acare/hacksig documentation built on April 14, 2025, 6:18 a.m.