transformContexts: Various transformation of contexts (e.g. into mutational...

View source: R/transformContexts.R

transformContextsR Documentation

Various transformation of contexts (e.g. into mutational signatures)

Description

Performs the following transformations of each mut type (snv, dbs, indel, sv) in the following order: simplify, least-squares fitting, calculate relative counts. Simplify flattens the 96 snv contexts into 6 contexts, indel contexts into their types (mh, rep, none), and SV type/length contexts into SV type. Least-squares fitting converts contexts into signatures.

Usage

transformContexts(
  contexts = NULL,
  snv = NULL,
  dbs = NULL,
  indel = NULL,
  sv = NULL,
  simplify.types = NULL,
  lsqnonneg.types = NULL,
  rel.types = NULL,
  sig.profiles.snv = SBS_SIGNATURE_PROFILES_V2,
  sig.profiles.dbs = DBS_SIGNATURE_PROFILES,
  sig.profiles.sv = SV_SIGNATURE_PROFILES,
  export.list = F
)

Arguments

contexts

A list containing data frames of snv, indel, and/or sv contexts. Alternatively, these can be specified with the arguments: snv, indel, or sv. This is handy if one only wants to transform a matrix of a certain mut type

snv

See argument 'contexts'.

indel

See argument 'contexts'.

sv

See argument 'contexts'.

simplify.types

Which types to flatten. Accepts: 'snv','indel','sv','all'

lsqnonneg.types

Which types to fit to signatures. Accepts: 'snv', 'sv','all'

rel.types

Which types to convert to relative contribution. Accepts: 'snv','indel','sv','all'

sig.profiles.snv

SNV sig profiles used for lsqnonneg. Defaults to 30 COSMIC signatures

sig.profiles.dbs

DBS sig profiles used for lsqnonneg. Defaults to PCAWG DBS signatures

sig.profiles.sv

SV sig profiles used for lsqnonneg. Defaults to 6 SV signatures from 560 breast cancer paper

export.list

Output a list with the split mutation types rather than a matrix?

Value

A matrix or data frame

Examples

base_dir <- '/Users/lnguyen/hpc/cog_bioinf/cuppen/project_data/Luan_projects/CHORD/Breast_Organoids/matrices/'
contexts <- list(
   snv = readSigsAsDf(paste0(base_dir,'/snv_contexts')),
   indel = readSigsAsDf(paste0(base_dir,'/indel')),
   sv = readSigsAsDf(paste0(base_dir,'/sv_contexts'))
)
transformContexts(contexts, simplify.types=c('snv','indel','sv'), rel.types=c('snv','indel','sv'))

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