1 Introduction

The concept of mutational signatures was introduced in a series of papers by Ludmil Alexandrov et al. (Alexandrov, Nik-Zainal, Wedge, Aparicio, et al. 2013) and (Alexandrov, Nik-Zainal, Wedge, Campbell, et al. 2013). A computational framework was published (Alexandrov 2012) with the purpose to detect a limited number of mutational processes which then describe the whole set of SNVs (single nucleotide variants) in a cohort of cancer samples. The general approach (Alexandrov, Nik-Zainal, Wedge, Aparicio, et al. 2013) is as follows:

  1. The SNVs are categorized by their nucleotide exchange. In total there are \(4 \times 3 = 12\) different nucleotide exchanges, but if summing over reverse complements only \(12 / 2 = 6\) different categories are left. For every SNV detected, the motif context around the position of the SNV is extracted. This may be a trinucleotide context if taking one base upstream and one base downstream of the position of the SNV, but larger motifs may be taken as well (e.g. pentamers). Taking into account the motif context increases combinatorial complexity: in the case of the trinucleotide context, there are \(4 \times 6 \times 4 = 96\) different variant categories. These categories are called features in the following text. The number of features will be called \(n\).
  2. A cohort consists of different samples with the number of samples denoted by \(m\). For each sample we can count the occurences of each feature, yielding an \(n\)-dimensional vector (\(n\) being the number of features) per sample. For a cohort, we thus get an \(n \times m\) -dimensional matrix, called the mutational catalogue \(V\). It can be understood as a summary indicating which sample has how many variants of which category, but omitting the information of the genomic coordinates of the variants.
  3. The mutational catalogue \(V\) is quite big and still carries a lot of complexity. For many analyses a reduction of complexity is desirable. One way to achieve such a complexity reduction is a matrix decomposition: we would like to find two smaller matrices \(W\) and \(H\) which if multiplied would span a high fraction of the complexity of the big matrix \(V\) (the mutational catalogue). Remember that \(V\) is an \(n \times m\) -dimensional matrix, \(n\) being the number of features and \(m\) being the number of samples. \(W\) in this setting is an \(n \times l\) -dimensional matrix and \(H\) is an \(l \times m\) -dimensional matrix. According to the nomeclature defined in (Alexandrov, Nik-Zainal, Wedge, Aparicio, et al. 2013), the columns of \(W\) are called the mutational signatures and the columns of \(H\) are called exposures. \(l\) denotes the number of mutational signatures. Hence the signatures are \(n\)-dimensional vectors (with \(n\) being the number of features), while the exposures are \(l\)-dimensional vectors (\(l\) being the number of signatures). Note that as we are dealing with count data, we would like to have only positive entries in \(W\) and \(H\). A mathematical method which is able to do such a decomposition is the NMF (nonnegative matrix factorization). It basically solves the problem as illustrated in the following figure (Image taken from


Of course the whole concept only leads to a reduction in complexity if \(l < n\), i.e. if the number of signatures is smaller than the number of features, as indicated in the above figure. Note that the NMF itself solves the above problem for a given number of signatures \(l\). The framework of Ludmil Alexandrov et al. (Alexandrov, Nik-Zainal, Wedge, Aparicio, et al. 2013) performs not only the NMF decomposition itself, but also identifies the appropriate number of signatures by an iterative procedure.

Another software, the Bioconductor package SomaticSignatures to perform analyses of mutational signatures is available (Gehring et al. 2015) which allows the matrix decomposition to be performed by NMF and alternatively by PCA (principal component analysis). Both methods have in common that they can be used for discovery, i.e. for the extraction of new signatures. However, they only work well if the analyzed data set has a minimum size, i.e. a minimum number of samples and minimum numbers of counts per feature per sample.

The package YAPSA introduced here is complementary to these existing software packages. It is designed for a supervised analysis of mutational signatures, i.e. an analysis with already known signatures \(W\), and with much lower requirements on statistical power of the input data.

2 The YAPSA package

In a context where mutational signatures \(W\) are already known (because they were decribed and published as in (Alexandrov, Nik-Zainal, Wedge, Aparicio, et al. 2013) or they are available in a database as under, we might want to just find the exposures \(H\) for these known signatures in the mutational catalogue \(V\) of a given cohort. Mathematically, this is a different and potentially simpler task.

The YAPSA-package (Yet Another Package for Signature Analysis) presented here provides the function LCD (linear combination decomposition) to perform this task. The advantage of this method is that there are no constraints on the cohort size, so LCD can be run for as little as one sample and thus be used e.g. for signature analysis in personalized oncology. In contrast to NMF, LCD is very fast and requires very little computational resources. The YAPSA package provides additional functions for signature analysis, e.g. for stratifying the mutational catalogue to determine signature exposures in different strata, part of which will be discussed later in this vignette.

2.1 Linear Combination Decomposition (LCD)

In the following, we will denote the columns of \(V\) by \(V_{(\cdot j)}\), which corresponds to the mutational catalogue of sample \(j\). Analogously we denote the columns of \(H\) by \(H_{(\cdot j)}\), which is the exposure vector of sample \(j\). Then LCD is designed to solve the optimization problem:

  1. \[ \begin{aligned} \min_{H_{(\cdot j)} \in \mathbb{R}^l}||W \cdot H_{(\cdot j)} - V_{(\cdot j)}|| \quad \forall j \in \{1...m\} \\ \textrm{under the constraint of non-negativity:} \quad H_{(ij)} >= 0 \quad \forall i \in \{1...l\} \quad \forall j \in \{1...m\} \end{aligned} \]

Remember that \(j\) is the index over samples, \(m\) is the number of samples, \(i\) is the index over signatures and \(l\) is the number of signatures. LCD uses the function lsei from the package lsei (Wang, Lawson, and Hanson 2015). Note that the optimization procedure is carried out for every \(V_{(\cdot j)}\), i.e. for every column of \(V\) separately. Of course \(W\) is constant, i.e. the same for every \(V_{(\cdot j)}\).

This procedure is highly sensitive: as soon as a signature has a contribution or an exposure in at least one sample of a cohort, it will be reported (within the floating point precision of the operating system). This might blur the picture and counteracts the initial purpose of complexity reduction. Therefore there is a function LCD_complex_cutoff. This function takes as a second argument a cutoff (a value between zero and one). In the analysis, it will keep only those signatures which have a cumulative (over the cohort) normalized exposure greater than this cutoff. In fact it runs the LCD-procedure twice: once to find initial exposures, summing over the cohort and excluding the ones with too low a contribution as described just above, and a second time doing the analysis only with the signatures left over. Beside the exposures H corresponding to this reduced set of signatures, the function LCD_complex_cutoff also returns the reduced set of signatures itself.

Another R package for the supervised analysis of mutational signatures is available: deconstructSigs (Rosenthal et al. 2016). One difference between LCD_complex_cutoff as described here in YAPSA and the corresponding function whichSignatures in deconstructSigs is that LCD_complex_cutoff accepts different cutoffs and signature-specific cutoffs (accounting for potentially different detectability of different signatures), whereas in whichSignatures in deconstructSigs a general fixed cutoff is set to be 0.06. Furthermore, YAPSA has a function for a stratified analysis as described in the following paragraph.

2.2 Stratification of the Mutational Catalogue (SMC)

For some questions it is useful to assign the SNVs detected in the samples of a cohort to categories. In the following these categories have to be exclusive, i.e. one SNV must be in one and only one category. The categories will be called strata in the following and the procedure stratification. The number of strata will be denoted by \(s\). For example one could evaluate whether an SNV falls into a region of high, intermediate or low mutation density by applying meaningful cutoffs on intermutation distance. Following the above convention, there are three strata: high, intermediate and low mutation density. If we have already performed an analysis of mutational signatures for the whole mutational catalogue of the cohort, we have identified a set of signatures of interest and the corresponding exposures. We now could ask the question if some of the signatures are enriched or depleted in one or the other stratum, yielding a strata-specific signature enrichment and depletion pattern. The function SMC (Stratification of the Mutational Catalogue) solves the stratified optimization problem:

  1. \[ \begin{aligned} \min_{H_{(\cdot j)}^k \in \mathbb{R}^l}||W \cdot H_{(\cdot j)}^{k} - V_{(\cdot j)}^{k}|| \quad \forall j,k \\ \textrm{under the constraint of non-negativity:} \quad H_{(ij)}^{k} >= 0 \quad \forall i,j,k \\ \textrm{and the additional contraint:} \quad \sum_{k=1}^{s} H^{k} = H \\ \textrm{where H is defined by the optimization:} \quad \min_{H_{(\cdot j)} \in \mathbb{R}^l}||W \cdot H_{(\cdot j)} - V_{(\cdot j)}|| \quad \forall j \\ \textrm{also under the constraint of non-negativity:} \quad H_{(ij)} >= 0 \quad \forall i,j \quad \textrm{and} \quad V = \sum_{k=1}^{s} V^{k} \end{aligned} \]

Remember that \(j\) is the index over samples, \(m\) is the number of samples, \(i\) is the index over signatures, \(l\) is the number of signatures, \(k\) is the index over strata and \(s\) is the number of strata. Note that the last two lines of equation (2) correspond to equation (1). The very last part of equation (2) reflects the additivity of the stratified mutational catalogues \(V^{k}\) which is due to the fact that by definition the sets of SNVs they were constructed from (i.e. the strata) are exclusive.

The SMC-procedure can also be applied when an NMF analysis has been performed and the exposures \(\widetilde{H}\) of this NMF analysis should be used as input and constraint for the SMC. It then solves the task:

  1. \[ \begin{aligned} \min_{H_{(\cdot j)}^k \in \mathbb{R}^l}||W \cdot H_{(\cdot j)}^{k} - V_{(\cdot j)}^{k}|| \quad \forall j,k \\ \textrm{under the constraint of non-negativity:} \quad H_{(ij)}^{k} >= 0 \quad \forall i,j,k \\ \textrm{and the additional contraint:} \quad \sum_{k=1}^{s} H^{k} = \widetilde{H} \\ \end{aligned} \]

Applying SMC that way, the initial LCD decomposition of the unstratified mutational catalogue is omitted and it’s result replaced by the exposures extracted by the NMF analysis.

3 Example: a cohort of B-cell lymphomas

We will now apply some functions of the YAPSA package to Whole Genome Sequencing datasets published in Alexandrov et al. (2013) First we have to load this data and get an overview (first subsection). Then we will load data on published signatures (second subsection). Only in the third subsection we will actually start using the YAPSA functions.


3.1 Example data

In the following, we will load and get an overview of the data used in the analysis by Alexandrov et al. (Alexandrov, Nik-Zainal, Wedge, Aparicio, et al. 2013)

3.1.1 Loading example data


This created a data frame with 128639 rows. It is equivalent to executing the R code

lymphoma_Nature2013_ftp_path <- paste0(
  "somatic_mutation_data/Lymphoma B-cell/",
  "Lymphoma B-cell_clean_somatic_mutations_",
lymphoma_Nature2013_raw_df <- read.csv(file=lymphoma_Nature2013_ftp_path,

The format is inspired by the vcf format with one line per called variant. Note that the files provided at that url have no header information, therefore we have to add some. We will also slightly adapt the data structure:

names(lymphoma_Nature2013_raw_df) <- c("PID","TYPE","CHROM","START",
lymphoma_Nature2013_df <- subset(lymphoma_Nature2013_raw_df,TYPE=="subs",
names(lymphoma_Nature2013_df)[2] <- "POS"
1 183502381 G A 07-35482
18 60985506 T A 07-35482
18 60985748 G T 07-35482
18 60985799 T C 07-35482
2 242077457 A G 07-35482
6 13470412 C T 07-35482

Here, we have selected only the variants characterized as subs (those are the single nucleotide variants we are interested in for the mutational signatures analysis, small indels are filtered out by this step), so we are left with 128212 variants or rows. Note that there are 48 different samples:

##  [1] 07-35482       1060           1061           1065          
##  [5] 1093           1096           1102           4101316       
##  [9] 4105105        4108101        4112512        4116738       
## [13] 4119027        4121361        4125240        4133511       
## [17] 4135350        4142267        4158726        4159170       
## [21] 4163639        4175837        4177856        4182393       
## [25] 4189200        4189998        4190495        4193278       
## [29] 4194218        4194891        515            DLBCL-PatientA
## [33] DLBCL-PatientB DLBCL-PatientC DLBCL-PatientD DLBCL-PatientE
## [37] DLBCL-PatientF DLBCL-PatientG DLBCL-PatientH DLBCL-PatientI
## [41] DLBCL-PatientJ DLBCL-PatientK DLBCL-PatientL DLBCL-PatientM
## [45] EB2            FL009          FL-PatientA    G1            
## 48 Levels: 07-35482 1060 1061 1065 1093 1096 1102 4101316 ... G1

For convenience later on, we annotate subgroup information to every variant (indirectly through the sample it occurs in). For reasons of simplicity, we also restrict the analysis to the Whole Genome Sequencing (WGS) datasets:

lymphoma_Nature2013_df$SUBGROUP <- "unknown"
DLBCL_ind <- grep("^DLBCL.*",lymphoma_Nature2013_df$PID)
lymphoma_Nature2013_df$SUBGROUP[DLBCL_ind] <- "DLBCL_other"
MMML_ind <- grep("^41[0-9]+$",lymphoma_Nature2013_df$PID)
lymphoma_Nature2013_df <- lymphoma_Nature2013_df[MMML_ind,]
for(my_PID in rownames(lymphoma_PID_df)) {
  PID_ind <- which(as.character(lymphoma_Nature2013_df$PID)==my_PID)
  lymphoma_Nature2013_df$SUBGROUP[PID_ind] <-
lymphoma_Nature2013_df$SUBGROUP <- factor(lymphoma_Nature2013_df$SUBGROUP)
## Levels: WGS_B WGS_D WGS_F WGS_I

3.1.2 Displaying example data

Rainfall plots provide a quick overview of the mutational load of a sample. To this end we have to compute the intermutational distances. But first we still do some reformatting…

lymphoma_Nature2013_df <- translate_to_hg19(lymphoma_Nature2013_df,"CHROM")
lymphoma_Nature2013_df$change <- 
lymphoma_Nature2013_df <- 
lymphoma_Nature2013_df <- annotate_intermut_dist_cohort(lymphoma_Nature2013_df,
lymphoma_Nature2013_df$col <- 

Now we can select one sample and make the rainfall plot. The plot function used here relies on the package gtrellis by Zuguang Gu (Zuguang Gu 2015).

choice_PID <- "4121361"
PID_df <- subset(lymphoma_Nature2013_df,PID==choice_PID)
Example rainfall plot in a trellis structure.

(#fig:make_rainfall_plot)Example rainfall plot in a trellis structure.

This shows a rainfall plot typical for a lymphoma sample with clusters of increased mutation density e.g. at the immunoglobulin loci.

3.2 Loading the signature information

As stated above, one of the functions in the YAPSA package (LCD) is designed to do mutational signatures analysis with known signatures. There are (at least) two possible sources for signature data: i) the ones published initially by Alexandrov et al. (Alexandrov, Nik-Zainal, Wedge, Aparicio, et al. 2013), and ii) an updated and curated current set of mutational signatures is maintained by Ludmil Alexandrov at The following three subsections describe how you can load the data from these resources. Alternatively, you can bypass the three following subsections because the signature datasets are also included in this package:


However, the curated set of signatures might change in the future, therefore it is recommended to rebuild it from the above mentioned website as described in the following subsections.

3.2.1 Loading the initial set of signatures

We first load the (older) set of signatures as published in Alexandrov et al. (Alexandrov, Nik-Zainal, Wedge, Aparicio, et al. 2013):

Alex_signatures_path <- paste0("",
AlexInitialArtif_sig_df <- read.csv(Alex_signatures_path,header=TRUE,sep="\t")
Substitution.Type Trinucleotide Somatic.Mutation.Type Signature.1A
C>A ACA A[C>A]A 0.0112
C>A ACC A[C>A]C 0.0092
C>A ACG A[C>A]G 0.0015
C>A ACT A[C>A]T 0.0063
C>A CCA C[C>A]A 0.0067
C>A CCC C[C>A]C 0.0074
C>A CCG C[C>A]G 0.0009
C>A CCT C[C>A]T 0.0073
C>A GCA G[C>A]A 0.0083

We will now reformat the data frame:

Alex_rownames <- paste(AlexInitialArtif_sig_df[,1],
                       AlexInitialArtif_sig_df[,2],sep=" ")
select_ind <- grep("Signature",names(AlexInitialArtif_sig_df))
AlexInitialArtif_sig_df <- AlexInitialArtif_sig_df[,select_ind]
number_of_Alex_sigs <- dim(AlexInitialArtif_sig_df)[2]
names(AlexInitialArtif_sig_df) <- gsub("Signature\\.","A",
rownames(AlexInitialArtif_sig_df) <- Alex_rownames
      caption="Exemplary data from the initial Alexandrov signatures.")
(#tab:reformat_old_sigs)Exemplary data from the initial Alexandrov signatures
A1A A1B A2 A3 A4 A5
C>A ACA 0.0112 0.0104 0.0105 0.0240 0.0365 0.0149
C>A ACC 0.0092 0.0093 0.0061 0.0197 0.0309 0.0089
C>A ACG 0.0015 0.0016 0.0013 0.0019 0.0183 0.0022
C>A ACT 0.0063 0.0067 0.0037 0.0172 0.0243 0.0092
C>A CCA 0.0067 0.0090 0.0061 0.0194 0.0461 0.0097
C>A CCC 0.0074 0.0047 0.0012 0.0161 0.0614 0.0050
C>A CCG 0.0009 0.0013 0.0006 0.0018 0.0088 0.0028
C>A CCT 0.0073 0.0098 0.0011 0.0157 0.0432 0.0111
C>A GCA 0.0083 0.0169 0.0093 0.0107 0.0376 0.0119

This results in a data frame for signatures, containing 27 signatures as column vectors. It is worth noting that in the initial publication, only a subset of these 27 signatures were validated by an orthogonal sequencing technology. So we can filter down:

AlexInitialValid_sig_df <- AlexInitialArtif_sig_df[,grep("^A[0-9]+",
number_of_Alex_validated_sigs <- dim(AlexInitialValid_sig_df)[2]

We are left with 22 signatures.

3.2.2 Loading the updated set of mutational signatures

An updated and curated set of mutational signatures is maintained by Ludmil Alexandrov at We will use this set for the following analysis:

Alex_COSMIC_signatures_path <- 
AlexCosmicValid_sig_df <- read.csv(Alex_COSMIC_signatures_path,
Alex_COSMIC_rownames <- paste(AlexCosmicValid_sig_df[,1],
                              AlexCosmicValid_sig_df[,2],sep=" ")
COSMIC_select_ind <- grep("Signature",names(AlexCosmicValid_sig_df))
AlexCosmicValid_sig_df <- AlexCosmicValid_sig_df[,COSMIC_select_ind]
number_of_Alex_COSMIC_sigs <- dim(AlexCosmicValid_sig_df)[2]
names(AlexCosmicValid_sig_df) <- gsub("Signature\\.","AC",
rownames(AlexCosmicValid_sig_df) <- Alex_COSMIC_rownames
      caption="Exemplary data from the updated Alexandrov signatures.")
(#tab:load_sigs)Exemplary data from the updated Alexandrov signatures
C>A ACA 0.0110983 0.0006827 0.0221723 0.0365 0.0149415 0.0017
C>A ACC 0.0091493 0.0006191 0.0178717 0.0309 0.0089609 0.0028
C>A ACG 0.0014901 0.0000993 0.0021383 0.0183 0.0022078 0.0005
C>A ACT 0.0062339 0.0003239 0.0162651 0.0243 0.0092069 0.0019
C>G ACA 0.0018011 0.0002635 0.0240026 0.0097 0.0116710 0.0013
C>G ACC 0.0025809 0.0002699 0.0121603 0.0054 0.0072921 0.0012
C>G ACG 0.0005925 0.0002192 0.0052754 0.0031 0.0023038 0.0000
C>G ACT 0.0029640 0.0006110 0.0232777 0.0054 0.0116962 0.0018
C>T ACA 0.0295145 0.0074416 0.0178722 0.0120 0.0218392 0.0312

This results in a data frame containing 30 signatures as column vectors. For reasons of convenience and comparability with the initial signatures, we reorder the features. To this end, we adhere to the convention chosen in the initial publication by Alexandrov et al. (Alexandrov, Nik-Zainal, Wedge, Aparicio, et al. 2013) for the initial signatures.

COSMIC_order_ind <- match(Alex_rownames,Alex_COSMIC_rownames)
AlexCosmicValid_sig_df <- AlexCosmicValid_sig_df[COSMIC_order_ind,]
      caption=paste0("Exemplary data from the updated Alexandrov ",
                     "signatures, rows reordered."))
(#tab:reorder_features)Exemplary data from the updated Alexandrov signatures, rows reordered
C>A ACA 0.0110983 0.0006827 0.0221723 0.0365 0.0149415 0.0017
C>A ACC 0.0091493 0.0006191 0.0178717 0.0309 0.0089609 0.0028
C>A ACG 0.0014901 0.0000993 0.0021383 0.0183 0.0022078 0.0005
C>A ACT 0.0062339 0.0003239 0.0162651 0.0243 0.0092069 0.0019
C>A CCA 0.0065959 0.0006774 0.0187817 0.0461 0.0096749 0.0101
C>A CCC 0.0073424 0.0002137 0.0157605 0.0614 0.0049523 0.0241
C>A CCG 0.0008928 0.0000068 0.0019634 0.0088 0.0028006 0.0091
C>A CCT 0.0071866 0.0004163 0.0147229 0.0432 0.0110135 0.0571
C>A GCA 0.0082326 0.0003520 0.0096965 0.0376 0.0118922 0.0024

Note that the order of the features, i.e. nucleotide exchanges in their trinucleotide content, is changed from the fifth line on as indicated by the row names.

3.2.3 Preparation for later analysis

For every set of signatures, the functions in the YAPSA package require an additional data frame containing meta information about the signatures. In that data frame you can specify the order in which the signatures are going to be plotted and the colours asserted to the different signatures. In the following subsection we will set up such a data frame. However, the respective data frames are also stored in the package. If loaded by data(sigs) the following code block can be bypassed.

signature_colour_vector <- c("darkgreen","green","pink","goldenrod",
bio_process_vector <- c("spontaneous deamination","spontaneous deamination",
                        "defect DNA MMR","UV light exposure","unknown",
                        "IG hypermutation","POL E mutations","temozolomide",
AlexInitialArtif_sigInd_df <- data.frame(sig=colnames(AlexInitialArtif_sig_df))
AlexInitialArtif_sigInd_df$index <- seq_len(dim(AlexInitialArtif_sigInd_df)[1])
AlexInitialArtif_sigInd_df$colour <- signature_colour_vector
AlexInitialArtif_sigInd_df$process <- bio_process_vector

COSMIC_signature_colour_vector <- c("green","pink","goldenrod",
COSMIC_bio_process_vector <- c("spontaneous deamination","APOBEC",
                               "defect DNA DSB repair hom. recomb.",
                               "tobacco mutatgens, benzo(a)pyrene",
                               "defect DNA MMR, found in MSI tumors",
                               "UV light exposure","unknown","POL eta and SHM",
                               "altered POL E",
                               "alkylating agents, temozolomide",
                               "defect DNA MMR","unknown","unknown",
                               "associated w. small indels at repeats",
                               "unknown","aristocholic acid","unknown",
                               "aflatoxin","unknown","defect DNA MMR",
                               "unknown","unknown","tobacco chewing","unknown")
AlexCosmicValid_sigInd_df <- data.frame(sig=colnames(AlexCosmicValid_sig_df))
AlexCosmicValid_sigInd_df$index <- seq_len(dim(AlexCosmicValid_sigInd_df)[1])
AlexCosmicValid_sigInd_df$colour <- COSMIC_signature_colour_vector
AlexCosmicValid_sigInd_df$process <- COSMIC_bio_process_vector

3.3 Performing an LCD analysis

Now we can start using the functions from the YAPSA package. We will start with a mutational signatures analysis using known signatures (the ones we loaded in the above paragraph). For this, we will use the functions LCD and LCD_complex_cutoff.

3.3.1 Building a mutational catalogue

This section uses functions which are to a large extent wrappers for functions in the package SomaticSignatures by Julian Gehring (Gehring et al. 2015).

word_length <- 3

lymphomaNature2013_mutCat_list <- 
    this_seqnames.field = "CHROM", this_start.field = "POS",
    this_end.field = "POS", this_PID.field = "PID",
    this_subgroup.field = "SUBGROUP",
    this_refGenome = BSgenome.Hsapiens.UCSC.hg19,
    this_wordLength = word_length)

The function create_mutation_catalogue_from_df returns a list object with several entries. We will use the one called matrix.

## [1] "matrix" "frame"
lymphomaNature2013_mutCat_df <-
4116738 4119027 4121361 4125240 4133511 4135350
C>A ACA 127 31 72 34 49 75
C>A ACC 104 36 39 19 36 80
C>A ACG 13 2 2 1 6 8
C>A ACT 102 33 48 22 47 56
C>A CCA 139 43 47 29 51 70
C>A CCC 66 34 35 7 25 42
C>A CCG 9 7 6 3 7 11
C>A CCT 167 47 50 32 58 84
C>A GCA 90 47 66 29 45 66

3.3.2 LCD analysis without any cutoff

The LCD function performs the decomposition of a mutational catalogue into a priori known signatures and the respective exposures to these signatures as described in the second section of this vignette. We use the “new” signatures from the COSMIC website.

current_sig_df <- AlexCosmicValid_sig_df
current_sigInd_df <- AlexCosmicValid_sigInd_df
lymphomaNature2013_COSMICExposures_df <-

Some adaptation (extracting and reformatting the information which sample belongs to which subgroup):

COSMIC_subgroups_df <- 

The resulting signature exposures can be plotted using custom plotting functions. First as absolute exposures:

  in_exposures_df = lymphomaNature2013_COSMICExposures_df,
  in_subgroups_df = COSMIC_subgroups_df)
## Warning: `offset` is deprecated, use `location` instead.
Absoute exposures of the COSMIC signatures in the lymphoma mutational catalogues, no cutoff for the LCD (Linear Combination Decomposition).

(#fig:exposures_barplot_LCD)Absoute exposures of the COSMIC signatures in the lymphoma mutational catalogues, no cutoff for the LCD (Linear Combination Decomposition).

Here, as no colour information was given to the plotting function exposures_barplot, the identified signatures are coloured in a rainbow palette. If you want to assign colours to the signatures, this is possible via a data structure of type sigInd_df.

  in_exposures_df = lymphomaNature2013_COSMICExposures_df,
  in_signatures_ind_df = current_sigInd_df,
  in_subgroups_df = COSMIC_subgroups_df)
## Warning: `offset` is deprecated, use `location` instead.