A Quick Start of sigminer Package"

library(markdown)
library(knitr)
knitr::opts_chunk$set(
    error = FALSE,
    tidy  = TRUE,
    message = FALSE,
    fig.align = "center",
    collapse = TRUE,
    comment = "#>")
options(width = 100)
options(rmarkdown.html_vignette.check_title = FALSE)

Assume you have already gotten a catalog matrix (sample-by-component) like below:

library(sigminer)
data("simulated_catalogs")
mat <- t(simulated_catalogs$set1)

mat[1:5, 1:5]

Extract signatures with:

# Here I reduce the values for n_bootstrap and n_nmf_run
# for reducing the run time.
# In practice, you should keep default or increase the values
# for better estimation.
#
# The input data here is simulated from 10 mutational signatures
e1 <- bp_extract_signatures(
  mat,
  range = 8:12,
  n_bootstrap = 5,
  n_nmf_run = 10
)
e1 <- readRDS("e1.rds")

Check which signature number is proper:

bp_show_survey2(e1, highlight = 10)

Get the 10 signatures:

obj <- bp_get_sig_obj(e1, 10)

Show signature profile:

show_sig_profile(obj, mode = "SBS", style = "cosmic")

Show signature activity (a.k.a. exposure) profile:

show_sig_exposure(obj, rm_space = TRUE)

Calculate the similarity to COSMIC reference signatures:

sim <- get_sig_similarity(obj, sig_db = "SBS")
if (require(pheatmap)) {
  pheatmap::pheatmap(sim$similarity)
}

More

Please go to reference list for well organized functions and documentation.

For more about mutational signature and sigminer usage, you can read sigminer-book.



Try the sigminer package in your browser

Any scripts or data that you put into this service are public.

sigminer documentation built on Aug. 21, 2023, 9:08 a.m.