PoisonAlien / maftools

Summarize, Analyze and Visualize MAF files from TCGA or in-house studies.
http://bioconductor.org/packages/release/bioc/html/maftools.html
MIT License
452 stars 222 forks source link

Add per sample mutational signature functionality #152

Closed jharenza closed 1 year ago

jharenza commented 6 years ago

Integrate deconstructSigs into package for investigation of mutational signatures on a per-sample level.

kunstner commented 4 years ago

Hi,

I would like to know whether this enhancement will be implemented soon?

Thanks, Axel

PoisonAlien commented 4 years ago

Hi Axel, Sorry for the delay and not following it up. However, I do not have any immediate plans to include it as a dependency :|

ShixiangWang commented 4 years ago

@kunstner Do you mean the signature exposure in each sample? If this is what you want, you can use {sigminer} package, which is compatible with {maftools}.

The current version of {sigminer} is under development, you have to install it from Github.

remotes::install_github("ShixiangWang/sigminer@V3")

An example:

library(maftools)
laml.maf = system.file('extdata', 'tcga_laml.maf.gz', package = 'maftools')
laml = read.maf(maf = laml.maf)

library(BSgenome.Hsapiens.UCSC.hg19, quietly = TRUE)
laml.tnm = trinucleotideMatrix(maf = laml, prefix = 'chr', add = TRUE, ref_genome = "BSgenome.Hsapiens.UCSC.hg19")
dim(laml.tnm$nmf_matrix)

library(NMF)
library(sigminer)

laml.sig = sig_extract(laml.tnm$nmf_matrix, n_sig = 3, pConstant = 1e-9)
get_sig_exposure(laml.sig)
get_sig_exposure(laml.sig, type = "relative")
kunstner commented 4 years ago

@ShixiangWang Thanks! That's what I was looking for. In the past, I iterated over all samples to perform the analysis but this seems way more elegant.

kunstner commented 4 years ago

@ShixiangWang One more thing. Is it possible to relate the found signatures to e.g. know COSMIC profiles?

ShixiangWang commented 4 years ago

@kunstner Yep! You can use get_sig_similarity() function. It is modified from source code of maftools, you can run ?sigminer::get_sig_similarity in your R console to see the doc.

ShixiangWang commented 4 years ago

Recently, I uploaded sigminer package v1.0 to CRAN, and the per-sample exposure quantification has been documented in https://shixiangwang.gitee.io/sigminer-doc/sigfit.html. I hope it is helpful for related issues.