assignSigPerMut: Assign a mutational signature to each mutation in a vcf or...

View source: R/assignSigPerMut.R

assignSigPerMutR Documentation

Assign a mutational signature to each mutation in a vcf or bed-like dataframe

Description

This function performs the following steps to assign a signature to each mutation in a vcf or bed-like dataframe: - Extract contexts and count occurrences - Calculate signature contributions by fitting contexts counts to reference signature profiles - Multiply each reference signature profile by the signature contribution vector. This gives the probability of each context to be assigned to a signature - Assign each context a signature based on the maximum probability signature - Assign each mutation a signature based on its context

Usage

assignSigPerMut(
  vcf.file = NULL,
  df = NULL,
  mode = "snv",
  output = "df",
  signature.profiles = NULL,
  args.extract.sigs = list(vcf.filter = "PASS"),
  fit.method = "strict",
  args.fit = NULL,
  min.mut.load = "auto",
  min.sig.abs.contrib = "auto",
  min.sig.rel.contrib = 0.05,
  verbose = F
)

Arguments

vcf.file

Path to the vcf file

df

A dataframe containing the columns: chrom, pos, ref, alt. Alternative input option to vcf.file

mode

Can be 'snv','sbs','indel' or 'dbs'. 'mode' defines which 'extractSigs*()' function to use. Additionally, if 'signature.profiles' is unspecified, the correct signature profile matrix will be automatically chosen

output

Can be 'df' (a dataframe with chrom, pos, ref, alt, context, assigned_sig, sig_prob), 'df.compact' (a dataframe with context, assigned_sig, sig_prob), 'details' or 'vector' (a vector whose names are assigned_sig, and values are sig_prob).

signature.profiles

A matrix containing the mutational signature profiles, where rows are the mutation contexts and the columns are the mutational signatures.

args.extract.sigs

A list of args that can be passed to the 'extractSigs*()' functions

fit.method

Can be 'lsq' or 'strict'. Method for fitting context counts to signature profiles. See documentation for 'fitToSignatures()' for more details

args.fit

A list of args that can be passed to the 'fitToSignatures*()' functions

min.mut.load

Samples with fewer mutations than this value will have no mutations assigned to any signatures (all mutations assigned as NA). If 'auto', one of the following values will be selected based on the mut type (i.e. 'mode'): snv=500, dbs=10, indel=50

min.sig.abs.contrib

Mutations attributed to signatures with absolute contribution lower than this value will be assigned NA instead. If 'auto', one of the following values will be selected based on the mut type (i.e. 'mode'): snv=100, dbs=5, indel=10

min.sig.rel.contrib

Signatures with low relative contribution (less than this value, e.g. 0.05 for 5 percent) of will be excluded from the assignment.

verbose

Print progress messages?

Value

See 'output'


UMCUGenetics/mutSigExtractor documentation built on Aug. 30, 2024, 2:12 p.m.