merge_signatures: Merge signatures based on cosine similarity

Description Usage Arguments Value Examples

View source: R/merge_signatures.R

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.

Usage

1
2
3
4
5
6
merge_signatures(
  signatures,
  cos_sim_cutoff = 0.8,
  merge_char = ";",
  verbose = TRUE
)

Arguments

signatures

Signature matrix (dimensions: x mutation types X n signatures)

cos_sim_cutoff

Cutoff for cosine similarity. Signatures are merged when their cosine similarity is higher than the limit. Default: 0.8

merge_char

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

verbose

Verbosity. If TRUE it shows which signatures got merged. Default: TRUE

Value

Signature matrix (dimensions: x mutation types X n signatures)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## 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)

MutationalPatterns documentation built on Nov. 14, 2020, 2:03 a.m.