File: merge_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 (52 lines) | stat: -rw-r--r-- 1,479 bytes parent folder | download | duplicates (3)
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/merge_signatures.R
\name{merge_signatures}
\alias{merge_signatures}
\title{Merge signatures based on cosine similarity}
\usage{
merge_signatures(
  signatures,
  cos_sim_cutoff = 0.8,
  merge_char = ";",
  verbose = TRUE
)
}
\arguments{
\item{signatures}{Signature matrix (dimensions: x mutation types
X n signatures)}

\item{cos_sim_cutoff}{Cutoff for cosine similarity. Signatures are merged when their
cosine similarity is higher than the limit. Default: 0.8}

\item{merge_char}{Character used to merge the signature names. This character shouldn't
be in the signature names beforehand. Default: ";"}

\item{verbose}{Verbosity. If TRUE it shows which signatures got merged. Default: TRUE}
}
\value{
Signature matrix (dimensions: x mutation types
X n signatures)
}
\description{
This function merges signatures based on their cosine similarity.
It iteratively merges the two signatures with the highest cosine similarity.
Merging is stopped when the maximum cosine similarity is lower than the limit.
}
\examples{

## Get signatures
signatures <- get_known_signatures()

## Merge signatures
merge_signatures(signatures)


## Merge signatures using a stricter cutoff
merge_signatures(signatures, cos_sim_cutoff = 0.9)

## Merge signatures using a different merging character
merge_signatures(signatures, merge_char = "_")

## Merge signatures silently
merge_signatures(signatures, verbose = FALSE)
}