merge_signatures: Merge signatures based on cosine similarity

View source: R/merge_signatures.R

merge_signaturesR Documentation

Merge signatures based on cosine similarity

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

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


## 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)

CuppenResearch/MutationalPatterns documentation built on Nov. 23, 2022, 4:13 a.m.