Skip to contents

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.

Examples

scores <- hack_sig(test_expr, "immune")
#> Warning:  No genes are present in 'expr_data' for the following signatures:
#>  rooney2015_cyt
#>  To obtain CINSARC, ESTIMATE and Immunophenoscore with the original procedures, see:
#> ?hack_cinsarc
#> ?hack_estimate
#> ?hack_immunophenoscore
stratify_sig(scores)
#> # A tibble: 20 × 19
#>    sample_id ayers2017_immexp bai2019_immune fan2021_ferroptosis fang2021_irgs
#>    <chr>     <chr>            <chr>          <chr>               <chr>        
#>  1 sample1   low              high           high                low          
#>  2 sample10  low              high           high                low          
#>  3 sample11  high             high           low                 high         
#>  4 sample12  high             high           high                high         
#>  5 sample13  low              high           low                 low          
#>  6 sample14  high             low            low                 low          
#>  7 sample15  low              low            low                 high         
#>  8 sample16  low              high           high                low          
#>  9 sample17  low              high           low                 low          
#> 10 sample18  low              low            low                 high         
#> 11 sample19  high             low            high                high         
#> 12 sample2   low              low            high                low          
#> 13 sample20  high             high           low                 high         
#> 14 sample3   high             low            high                high         
#> 15 sample4   high             low            high                low          
#> 16 sample5   high             low            low                 high         
#> 17 sample6   high             high           high                high         
#> 18 sample7   high             low            low                 low          
#> 19 sample8   low              high           low                 high         
#> 20 sample9   low              low            high                low          
#> # ℹ 14 more variables: he2021_ferroptosis_a <chr>, he2021_ferroptosis_b <chr>,
#> #   huang2022_ferroptosis <chr>, li2021_ferroptosis_c <chr>,
#> #   li2021_ferroptosis_d <chr>, li2021_irgs <chr>, liu2020_immune <chr>,
#> #   liu2021_mgs <chr>, lu2020_npc <chr>, lu2021_ferroptosis <chr>,
#> #   qiang2021_irgs <chr>, she2020_irgs <chr>, xu2021_ferroptosis <chr>,
#> #   zou2020_npc <chr>