knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%", warning = FALSE )
The cancer genome is shaped by various mutational processes over its lifetime, stemming from exogenous and cell-intrinsic DNA damage, and error-prone DNA replication, leaving behind characteristic mutational spectra, termed mutational signatures. This package, sigminer, helps users to extract, analyze and visualize signatures from genome alteration records, thus providing new insight into cancer study.
For pipeline tool, please see its co-evolutionary CLI sigflow.
SBS signatures:
library(sigminer) load(system.file("extdata", "toy_mutational_signature.RData", package = "sigminer", mustWork = TRUE )) # Show signature profile p1 <- show_sig_profile(sig2, mode = "SBS", style = "cosmic", x_label_angle = 90) p1
Copy number signatures:
load(system.file("extdata", "toy_copynumber_signature_by_W.RData", package = "sigminer", mustWork = TRUE )) # Show signature profile p2 <- show_sig_profile(sig, style = "cosmic", mode = "copynumber", method = "W", normalize = "feature" ) p2
show_sig_profile(get_sig_db("CNS_TCGA")$db[, 1:3], style = "cosmic", mode = "copynumber", method = "S", check_sig_names = FALSE)
DBS signatures:
DBS = system.file("extdata", "DBS_signatures.rds", package = "sigminer", mustWork = TRUE) DBS = readRDS(DBS) # Show signature profile p3 <- show_sig_profile(DBS$db[, 1:3] %>% as.matrix(), mode = "DBS", style = "cosmic", check_sig_names = FALSE) p3
INDEL (i.e. ID) signatures:
ID = system.file("extdata", "ID_signatures.rds", package = "sigminer", mustWork = TRUE) ID = readRDS(ID) # Show signature profile p4 <- show_sig_profile(ID$db[, 4:6] %>% as.matrix(), mode = "ID", style = "cosmic", check_sig_names = FALSE) p4
Genome rearrangement signatures:
p5 <- show_cosmic_sig_profile(sig_index = c("R1", "R2", "R3"), sig_db = "RS_Nik_lab", style = "cosmic", show_index = FALSE) p5
You can install the stable release of sigminer from CRAN with:
install.packages("BiocManager") BiocManager::install("sigminer", dependencies = TRUE)
You can install the development version of sigminer from Github with:
remotes::install_github("ShixiangWang/sigminer", dependencies = TRUE) # For Chinese users, run remotes::install_git("https://gitee.com/ShixiangWang/sigminer", dependencies = TRUE)
You can also install sigminer from conda bioconda
channel with
# Please note version number of the bioconda release # You can install an individual environment firstly with # conda create -n sigminer # conda activate sigminer conda install -c bioconda -c conda-forge r-sigminer
A complete documentation of sigminer can be read online at https://shixiangwang.github.io/sigminer-book/. All functions are well organized and documented at https://shixiangwang.github.io/sigminer/reference/index.html. For usage of a specific function fun
, run ?fun
in your R console to see its documentation.
copynumber
packageFor some extra features provided by sigminer, copynumber package is required. Due to the removal of the copynumber package from Bioc, I had to remove it from the dependencies in v2.2.0. You can install the package from https://github.com/shixiangwang/copynumber/. It is generally recommended as I have added some features, although other forks of this package exist on GitHub.
remotes::install_github("ShixiangWang/copynumber")
If you use sigminer in academic field, please cite one of the following papers.
library("ggplot2") library("cranlogs") library("dplyr") library("spiralize") library("ComplexHeatmap") library("lubridate") df <- cran_downloads("sigminer", from = "2019-07-01", to = "2024-06-07") if (!is.null(df)) { day_diff = as.double(df$date[nrow(df)] - df$date[1], "days") year_mean = tapply(df$count, lubridate::year(df$date), function(x) mean(x[x > 0])) df$diff = log2(df$count/year_mean[as.character(lubridate::year(df$date))]) df$diff[is.infinite(df$diff)] = 0 q = quantile(abs(df$diff), 0.99) # adjust outliers df$diff[df$diff > q] = q df$diff[df$diff < -q] = -q spiral_initialize_by_time(xlim = range(df[, 1]), padding = unit(2, "cm"), verbose = FALSE) spiral_track(height = 0.8) spiral_horizon(df$date, df$diff, use_bars = TRUE) spiral_highlight("start", "2019-12-31", type = "line", gp = gpar(col = 1)) spiral_highlight("2020-01-01", "2020-12-31", type = "line", gp = gpar(col = 2)) spiral_highlight("2021-01-01", "2021-12-31", type = "line", gp = gpar(col = 3)) spiral_highlight("2022-01-01", "2022-12-31", type = "line", gp = gpar(col = 4)) spiral_highlight("2023-01-01", "2023-12-31", type = "line", gp = gpar(col = 5)) spiral_highlight("2024-01-01", "end", type = "line", gp = gpar(col = 6)) s = current_spiral() d = seq(15, 360, by = 30) %% 360 for(i in seq_along(d)) { foo = polar_to_cartesian(d[i]/180*pi, (s$max_radius + 1)*1.05) grid.text(month.name[i], x = foo[1, 1], y = foo[1, 2], default.unit = "native", rot = ifelse(d[i] > 0 & d[i] < 180, d[i] - 90, d[i] + 90), gp = gpar(fontsize = 10)) } lgd = packLegend( Legend(title = "Difference to\nyearly average", at = c("higher", "lower"), legend_gp = gpar(fill = c("#D73027", "#313695"))), Legend(title = "Year", type = "lines", at = 2019:2024, legend_gp = gpar(col = 1:5)) ) draw(lgd, x = unit(1, "npc") + unit(10, "mm"), just = "left") }
Please properly cite the following references when you are using any corresponding features. The references are also listed in the function documentation. Very thanks to the works, sigminer cannot be created without the giants.
The software is made available for non commercial research purposes only under the MIT. However, notwithstanding any provision of the MIT License, the software currently may not be used for commercial purposes without explicit written permission after contacting patents' authors.
Related patents:
https://kms.shanghaitech.edu.cn/handle/2MSLDSTB/127042
MIT © 2019-Present Shixiang Wang, Xue-Song Liu
MIT © 2018 Anand Mayakonda
Sigminer v1-v2 are supported by Cancer Biology Group \@ShanghaiTech
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.