Skip to contents

Identify the most likely combination of known mutational signatures which explain the mutational profile observed in a sample of interest.

Usage

sig_fit(catalogue, signatures, method = "nnls")

Arguments

catalogue

catalogue of mutations observed in your sample. A named vector where names are channel and values are counts.

signatures

a channel X signature matrix where values represent fractional contributions of each channels.

method

how should fitting be performed. nnls: Use non-negative least squares method

Value

a named vector with 1 element per signature. Values indicate the estimated number of mutation drawn from that signature.

Examples

observed_counts <- c(
"C>A" = 183,
"C>G" = 779,
"C>T" = 588,
"T>A" = 706,
"T>C" = 384,
"T>G" = 127
)

signatures <- simulate_signature_matrix(
  signatures = c("sig1", "sig2", "sig3", "sig4"),
  channels = c("C>A", "C>G", "C>T", "T>A", "T>C", "T>G"),
  seed=1
)


# fitting using nnls method
sig_fit(observed_counts, signatures, method = "nnls")
#> Error in sig_fit(observed_counts, signatures, method = "nnls"): The package "nnls" is required to fit signatures to data when method =
#> nnls