-
Notifications
You must be signed in to change notification settings - Fork 225
Expand file tree
/
Copy pathextractSignatures.Rd
More file actions
53 lines (47 loc) · 1.83 KB
/
Copy pathextractSignatures.Rd
File metadata and controls
53 lines (47 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/extractSignatures.R
\name{extractSignatures}
\alias{extractSignatures}
\title{Extract mutational signatures from trinucleotide context.}
\usage{
extractSignatures(
mat,
n = NULL,
nrun = 1,
absolute = FALSE,
plotBestFitRes = FALSE,
parallel = 4,
pConstant = NULL
)
}
\arguments{
\item{mat}{Input matrix of diemnsion nx96 generated by \code{\link{trinucleotideMatrix}}}
\item{n}{decompose matrix into n signatures. Default NULL. Tries to predict best value for \code{n} by running NMF on a range of values and chooses based on cophenetic correlation coefficient.}
\item{nrun}{Default 1. Number of runs to perform}
\item{absolute}{Default FALSE. Returns absolute contribution per sample.}
\item{plotBestFitRes}{plots consensus heatmap for range of values tried. Default FALSE}
\item{parallel}{Default 4. Number of cores to use.}
\item{pConstant}{A small positive value to add to the matrix. Use it ONLY if the functions throws an \code{non-conformable arrays} error}
}
\value{
a list with decomposed scaled signatures, signature contributions in each sample and NMF object.
}
\description{
Decompose a matrix of 96 substitution classes into \code{n} signatures.
}
\details{
This function decomposes a non-negative matrix into n signatures.
}
\examples{
\dontrun{
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)
}
}
\seealso{
\code{\link{trinucleotideMatrix}} \code{\link{plotSignatures}} \code{\link{compareSignatures}}
}