MyNixOS website logo
Description

A Tidy Framework to Hack Gene Expression Signatures.

A collection of cancer transcriptomics gene signatures as well as a simple and tidy interface to compute single sample enrichment scores either with the original procedure or with three alternatives: the "combined z-score" of Lee et al. (2008) <doi:10.1371/journal.pcbi.1000217>, the "single sample GSEA" of Barbie et al. (2009) <doi:10.1038/nature08460> and the "singscore" of Foroutan et al. (2018) <doi:10.1186/s12859-018-2435-4>. The 'get_sig_info()' function can be used to retrieve information about each signature implemented.

hacksig

Lifecycle:experimental CRANstatus Codecov testcoverage R-CMD-check

The goal of hacksig is to provide a simple and tidy interface to compute single sample scores for gene signatures and methods applied in cancer transcriptomics.

Scores can be obtained either for custom lists of genes or for a manually curated collection of gene signatures, including:

One can choose to apply either the original publication method or one of three single sample scoring alternatives, namely: combined z-score, single sample GSEA and singscore.

Installation

You can install the released version of hacksig from CRAN with:

install.packages("hacksig")

Or the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("Acare/hacksig")

Usage

You can learn more about usage of the package in vignette("hacksig").

library(hacksig)
library(dplyr)
library(future)

Get available signatures

get_sig_info()
#> # A tibble: 23 × 4
#>   signature_id       signature_keywords              publication_doi description
#>   <chr>              <chr>                           <chr>           <chr>      
#> 1 ayers2017_immexp   ayers2017_immexp|immune expand… 10.1172/JCI911… Immune exp…
#> 2 bai2019_immune     bai2019_immune|head and neck|h… 10.1155/2019/3… Immune/inf…
#> 3 cinsarc            cinsarc|metastasis|sarcoma|sts  10.1038/nm.2174 Biomarker …
#> 4 dececco2014_int172 dececco2014_int172|head and ne… 10.1093/annonc… Signature …
#> 5 eschrich2009_rsi   eschrich2009_rsi|radioresistan… 10.1016/j.ijro… Genes aime…
#> # … with 18 more rows

Check your signatures

check_sig(test_expr, signatures = "estimate")
#> # A tibble: 2 × 5
#>   signature_id     n_genes n_present frac_present missing_genes
#>   <chr>              <int>     <int>        <dbl> <named list> 
#> 1 estimate_stromal     141        91        0.645 <chr [50]>   
#> 2 estimate_immune      141        74        0.525 <chr [67]>

Compute single sample scores

hack_sig(test_expr, signatures = c("ifng", "cinsarc"), method = "zscore")
#> # A tibble: 20 × 3
#>   sample_id cinsarc muro2016_ifng
#>   <chr>       <dbl>         <dbl>
#> 1 sample1    -0.482       -0.511 
#> 2 sample2    -2.61         0.400 
#> 3 sample3     1.44         0.347 
#> 4 sample4    -0.538        0.0849
#> 5 sample5    -0.537        0.390 
#> # … with 15 more rows

Stratify your samples

test_expr %>% 
    hack_sig("estimate", method = "singscore", direction = "up") %>% 
    hack_class(cutoff = "median")
#> # A tibble: 20 × 3
#>   sample_id estimate_immune estimate_stromal
#>   <chr>     <chr>           <chr>           
#> 1 sample1   low             low             
#> 2 sample2   high            low             
#> 3 sample3   low             low             
#> 4 sample4   low             high            
#> 5 sample5   low             high            
#> # … with 15 more rows

Speed-up computation time

plan(multisession)
hack_sig(test_expr, method = "ssgsea")
#> Warning: ℹ No genes are present in 'expr_data' for the following signatures:
#> x rooney2015_cyt
#> # A tibble: 20 × 23
#>   sample_id ayers2017_immexp bai2019_immune cinsarc dececco2014_int172
#>   <chr>                <dbl>          <dbl>   <dbl>              <dbl>
#> 1 sample1             -3914.          2316.   -13.5              1288.
#> 2 sample2             -3348.          1350. -1070.               1322.
#> 3 sample3              1697.          1829.  1805.                685.
#> 4 sample4               366.          5611.   326.               1684.
#> 5 sample5               969.          1224.   290.                718.
#> # … with 15 more rows, and 18 more variables: eschrich2009_rsi <dbl>,
#> #   estimate_immune <dbl>, estimate_stromal <dbl>, eustace2013_hypoxia <dbl>,
#> #   fang2021_irgs <dbl>, hu2021_derbp <dbl>, ips_cp <dbl>, ips_ec <dbl>,
#> #   ips_mhc <dbl>, ips_sc <dbl>, li2021_irgs <dbl>, liu2020_immune <dbl>,
#> #   liu2021_mgs <dbl>, lohavanichbutr2013_hpvneg <dbl>, muro2016_ifng <dbl>,
#> #   qiang2021_irgs <dbl>, she2020_irgs <dbl>, wu2020_metabolic <dbl>

Contributing

If you have any suggestions about adding new features to hacksig, please open an issue request on GitHub. Gene-level information about gene signatures are stored in data-raw/hacksig_signatures.csv and can be used as a template for requests.

Metadata

Version

0.1.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows