File: extract_signatures.Rd

package info (click to toggle)
r-bioc-mutationalpatterns 3.16.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,360 kB
  • sloc: sh: 8; makefile: 2
file content (69 lines) | stat: -rw-r--r-- 2,295 bytes parent folder | download | duplicates (2)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/extract_signatures.R
\name{extract_signatures}
\alias{extract_signatures}
\title{Extract mutational signatures from 96 mutation matrix using NMF}
\usage{
extract_signatures(
  mut_matrix,
  rank,
  nrun = 200,
  nmf_type = c("regular", "variational_bayes"),
  single_core = FALSE,
  fudge = NULL,
  seed = 123456
)
}
\arguments{
\item{mut_matrix}{96 mutation count matrix}

\item{rank}{Number of signatures to extract}

\item{nrun}{Number of iterations, default = 200.
A lower number will be faster, but result in less accurate results.}

\item{nmf_type}{Type of NMF to be used.
             Possible values:
             * 'regular'
             * 'variational_bayes'
The 'regular' method comes from the NMF package.
The 'variational_bayes' method comes from the ccfindR package.
This method uses bayesian inference, which makes it easier to determine the
mathematically optimal number of signatures.}

\item{single_core}{Boolean. If TRUE, it forces the NMF algorithm to
use only a single core. This can sometimes prevent issues.
Doesn't apply to variational-bayes NMF}

\item{fudge}{Small positive number that is used for the variational_bayes NMF.
Setting this to a small value like 0.0001 can prevent errors from occurring,
when extracting many signatures at once. In general, we recommend extracting
less signatures when errors occur, but this parameter can be used when that
is not an option.
Default = NULL.}

\item{seed}{Random seed used for the regular NMF, default = 123456}
}
\value{
Named list of mutation matrix, signatures and signature contribution
}
\description{
Decomposes trinucleotide count matrix into signatures and contribution of
those signatures to the spectra of the samples/vcf files.
}
\examples{
## See the 'mut_matrix()' example for how we obtained the mutation matrix:
mut_mat <- readRDS(system.file("states/mut_mat_data.rds",
  package = "MutationalPatterns"
))

## This function is computationally intensive.
# nmf_res <- extract_signatures(mut_mat, rank = 2)

## It's also possible to use a variational Bayes method.
## It requires the ccfindR package to work.
# nmf_res <- extract_signatures(mut_mat, rank = 2, nmf_type = "variational_bayes")
}
\seealso{
\code{\link{mut_matrix}}
}