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…¹ bai20…² fan20…³ fang2…⁴ he202…⁵ he202…⁶ huang…⁷ li202…⁸
#>    <chr>     <chr>       <chr>   <chr>   <chr>   <chr>   <chr>   <chr>   <chr>  
#>  1 sample1   low         high    high    low     low     low     low     high   
#>  2 sample10  low         high    high    low     high    high    high    low    
#>  3 sample11  high        high    low     high    low     low     low     high   
#>  4 sample12  high        high    high    high    high    high    high    low    
#>  5 sample13  low         high    low     low     high    high    high    low    
#>  6 sample14  high        low     low     low     low     high    high    low    
#>  7 sample15  low         low     low     high    low     low     low     low    
#>  8 sample16  low         high    high    low     low     low     low     low    
#>  9 sample17  low         high    low     low     low     low     low     high   
#> 10 sample18  low         low     low     high    high    high    high    high   
#> 11 sample19  high        low     high    high    high    low     low     high   
#> 12 sample2   low         low     high    low     high    high    high    high   
#> 13 sample20  high        high    low     high    high    high    high    high   
#> 14 sample3   high        low     high    high    low     high    high    low    
#> 15 sample4   high        low     high    low     high    high    high    low    
#> 16 sample5   high        low     low     high    high    low     low     low    
#> 17 sample6   high        high    high    high    low     low     low     high   
#> 18 sample7   high        low     low     low     low     low     low     high   
#> 19 sample8   low         high    low     high    low     low     low     high   
#> 20 sample9   low         low     high    low     high    high    high    low    
#> # … with 10 more variables: 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>, and abbreviated variable names
#> #   ¹​ayers2017_immexp, ²​bai2019_immune, ³​fan2021_ferroptosis, ⁴​fang2021_irgs,
#> #   ⁵​he2021_ferroptosis_a, ⁶​he2021_ferroptosis_b, ⁷​huang2022_ferroptosis,
#> #   ⁸​li2021_ferroptosis_c