Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

extractSignatures

Extract mutational signatures from trinucleotide context.


Description

Decompose a matrix of 96 substitution classes into n signatures.

Usage

extractSignatures(
  mat,
  n = NULL,
  plotBestFitRes = FALSE,
  parallel = 4,
  pConstant = NULL
)

Arguments

mat

Input matrix of diemnsion nx96 generated by trinucleotideMatrix

n

decompose matrix into n signatures. Default NULL. Tries to predict best value for n by running NMF on a range of values and chooses based on cophenetic correlation coefficient.

plotBestFitRes

plots consensus heatmap for range of values tried. Default FALSE

parallel

Default 4. Number of cores to use.

pConstant

A small positive value to add to the matrix. Use it ONLY if the functions throws an non-conformable arrays error

Details

This function decomposes a non-negative matrix into n signatures.

Value

a list with decomposed scaled signatures, signature contributions in each sample and NMF object.

See Also

Examples

## Not run: 
laml.maf <- system.file("extdata", "tcga_laml.maf.gz", package = "maftools")
laml <- read.maf(maf = laml.maf)
laml.tnm <- trinucleotideMatrix(maf = laml, ref_genome = 'BSgenome.Hsapiens.UCSC.hg19', prefix = 'chr',
add = TRUE, useSyn = TRUE)
library("NMF")
laml.sign <- extractSignatures(mat = laml.tnm, plotBestFitRes = FALSE, n = 2, pConstant = 0.01)

## End(Not run)

maftools

Summarize, Analyze and Visualize MAF Files

v2.6.05
MIT + file LICENSE
Authors
Anand Mayakonda [aut, cre] (<https://orcid.org/0000-0003-1162-687X>)
Initial release
2015-12-14

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.