Decomp Tumor2Sig Manual

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 39

DownloadDecomp Tumor2Sig-manual
Open PDF In BrowserView PDF
Package ‘decompTumor2Sig’
October 17, 2018
Type Package
Title Decomposition of individual tumors into mutational signatures by
signature refitting
Depends R(>= 3.5), ggplot2
Imports methods, Matrix, quadprog(>= 1.5-5), vcfR, GenomicRanges,
stats, GenomicFeatures, Biostrings, BiocGenerics, S4Vectors,
plyr, utils, graphics, BSgenome.Hsapiens.UCSC.hg19,
TxDb.Hsapiens.UCSC.hg19.knownGene, VariantAnnotation,
SummarizedExperiment, ggseqlogo, gridExtra
Suggests pmsignature, knitr, rmarkdown, BiocStyle
Version 1.3.5
Date 2018-10-17
Encoding UTF-8
Description Uses quadratic programming for signature refitting, i.e., to
decompose the mutation catalog from an individual tumor sample into a set of
given mutational signatures (either Alexandrov-model signatures or
Shiraishi-model signatures), computing weights that reflect the
contributions of the signatures to the mutation load of the tumor.
License GPL-2
URL http://rmpiro.net/decompTumor2Sig/,
https://github.com/rmpiro/decompTumor2Sig
BugReports https://github.com/rmpiro/decompTumor2Sig/issues
biocViews Software, SNP, Sequencing, DNASeq, GenomicVariation,
SomaticMutation, BiomedicalInformatics, Genetics,
BiologicalQuestion, StatisticalMethod
VignetteBuilder knitr
RoxygenNote 6.1.0
NeedsCompilation no
Author Rosario M. Piro [aut, cre],
Sandra Krueger [ctb]
Maintainer Rosario M. Piro 
1

2

decompTumor2Sig-package

R topics documented:
decompTumor2Sig-package . . .
composeGenomesFromExposures
computeExplainedVariance . . . .
convertAlexandrov2Shiraishi . . .
convertGenomesFromVRanges . .
decomposeTumorGenomes . . . .
determineSignatureDistances . . .
downgradeShiraishiSignatures . .
evaluateDecompositionQuality . .
getGenomesFromMutFeatData . .
getSignaturesFromEstParam . . .
isAlexandrovSet . . . . . . . . . .
isExposureSet . . . . . . . . . . .
isShiraishiSet . . . . . . . . . . .
isSignatureSet . . . . . . . . . . .
mapSignatureSets . . . . . . . . .
plotDecomposedContribution . . .
plotExplainedVariance . . . . . .
plotMutationDistribution . . . . .
readAlexandrovSignatures . . . .
readGenomesFromMPF . . . . . .
readGenomesFromVCF . . . . . .
readShiraishiSignatures . . . . . .
sameSignatureFormat . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

Index

2
4
6
7
8
10
13
15
16
18
19
20
21
22
23
24
26
28
29
31
32
34
35
37
39

decompTumor2Sig-package
decompTumor2Sig - Decomposition of individual tumors into mutational signatures by signature refitting

Description
The decompTumor2Sig package uses quadratic programming to decompose the somatic mutation catalog from an individual tumor sample (or multiple individual tumor samples) into a set
of given mutational signatures (either of the "Alexandrov model" by Alexandrov et al, Nature
500(7463):415-421, 2013, or the "Shiraishi model" by Shiraishi et al, PLoS Genet 11(12):e1005657,
2015), thus computing weights (or "exposures") that reflect the contributions of the signatures to
the mutation load of the tumor.
Details
Package:
Type:
Version:
Date:
License:

decompTumor2Sig
Package
1.3.5
2018-10-17
GPL (>=2)

decompTumor2Sig-package

3

The package provides the following functions:
composeGenomesFromExposures():

computeExplainedVariance():

convertAlexandrov2Shiraishi():
convertGenomesFromVRanges():

decomposeTumorGenomes():

determineSignatureDistances():

downgradeShiraishiSignatures():

evaluateDecompositionQuality():

getGenomesFromMutFeatData():

getSignaturesFromEstParam():

isAlexandrovSet():

isExposureSet():

isShiraishiSet():

isSignatureSet():

mapSignatureSets():
plotDecomposedContribution():

(re-)construct tumor genome mutation
frequencies from the signatures and
their corresponding exposures, or
contributions.
determine the variance explained by
estimated signature contributions
(i.e., exposures to signatures).
convert a set of Alexandrov
signatures to Shiraishi signatures.
convert a genome or set of genomes
from a VariantAnnotation::VRanges
object.
determine the weights/contributions of
a set of signatures to each of a set of
individual tumor genomes.
for a given signature
compute its distances to each of a set
of target signatures.
downgrade Shiraishi signatures
by removing flanking bases and/or the
transcription direction.
evaluate the quality of a
decomposition by comparing the
re-composed (=re-constructed) tumor
mutation frequencies to those actually
observed in the tumor genome.
extract the genomes from a
MutationFeatureData object as
provided by, for example,
pmsignature::readMPFile.
extract a set of signatures from an
EstimatedParameters object as
returned by function getPMSignature
of the pmsignature package.
checks whether the input list is
compatible with the Alexandrov format
(probability vectors).
checks whether the input list is
compatible with exposure output obtained
from decomposeTumorGenomes.
checks whether the input list is
compatible with the Shiraishi format
(matrices or data.frames of
probabilities).
checks whether the input list is
compatible with either the Alexandrov
or Shiraishi format.
find a mapping from one signature
set to another.
plot the decomposition of a
genome into mutational signatures

4

composeGenomesFromExposures

plotExplainedVariance():

plotMutationDistribution():

readAlexandrovSignatures():
readGenomesFromMPF():
readGenomesFromVCF():
readShiraishiSignatures():
sameSignatureFormat():

(i.e., the contributions of, or
exposures to, the signatures).
plot the variance of a genome’s
mutation patterns which can be
explained with an increasing number
of signatures.
plot a single signature or the
mutation frequency data for a single
genome.
read Alexandrov signatures in the
COSMIC format from a flat file or URL.
read a genome or set of genomes from a
Mutation Position Format (MPF) file.
read a genome or set of genomes from a
Variant Call Format (VCF) file.
read Shiraishi signatures from
flat files.
checks whether two input lists are sets
of signatures of the same format.

Author(s)
Rosario M. Piro [aut, cre], Sandra Krueger [ctb]
Freie Universitaet Berlin
Maintainer: Rosario M. Piro
E-Mail:  or 
References
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2018) decompTumor2Sig: Identification of mutational signatures active in individual
tumors. BMC Bioinformatics (accepted for publication).
Krueger, Piro (2017) Identification of Mutational Signatures Active in Individual Tumors. NETTAB
2017 - Methods, Tools & Platforms for Personalized Medicine in the Big Data Era, October 16-18,
2017, Palermo, Italy. PeerJ Preprints 5:e3257v1, 2017.

composeGenomesFromExposures
Compose tumor genomes from exposures.

Description
‘composeGenomesFromExposures()‘ re-composes (or predicts) tumor genomes (i.e., their mutation
frequencies) from the given mutational signatures and their corresponding exposures, or contributions. The (re-)composition is performed by computing the weighted sum of the mutational signatures, where the weights are the exposures (=contributions) of the corresponding signatures. This
can, for example, be used to verify that a decomposition obtained from decomposeTumorGenomes
is meaningful.

composeGenomesFromExposures

5

Usage
composeGenomesFromExposures(exposures, signatures)
Arguments
exposures

(Mandatory) A single vector or list of vectors containing the estimated signature
contributions/exposures as computed by the function decomposeTumorGenomes.
A list of vectors is used if the (re-)composition shall be performed for multiple
genomes. The number of elements of each exposure vector must correspond to
the number of signatures.

signatures

(Mandatory) The list of signatures (vectors, data frames or matrices) for which
the exposures were obtained. Each of the list objects represents one mutational
signature. Vectors are used for Alexandrov signatures, data frames or matrices
for Shiraishi signatures.

Value
A list of "predicted" genomes, i.e., the frequencies of their mutational patterns computed as weighted
sums of the mutational signatures, where the weights correspond to the contributions of, i.e., exposures to, the corresponding signatures.
Author(s)
Rosario M. Piro
Freie Universitaet Berlin
Maintainer: Rosario M. Piro
E-Mail:  or 
Rosario M. Piro, Freie Universitaet Berlin, 
References
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2018) decompTumor2Sig: Identification of mutational signatures active in individual
tumors. BMC Bioinformatics (accepted for publication).
Krueger, Piro (2017) Identification of Mutational Signatures Active in Individual Tumors. NETTAB
2017 - Methods, Tools & Platforms for Personalized Medicine in the Big Data Era, October 16-18,
2017, Palermo, Italy. PeerJ Preprints 5:e3257v1, 2017.
See Also
decompTumor2Sig
decomposeTumorGenomes
Examples
### get Alexandrov signatures from COSMIC
signatures <- readAlexandrovSignatures()
### load preprocessed breast cancer genomes (object 'genomes') from
### Nik-Zainal et al (PMID: 22608084)
gfile <- system.file("extdata",
"Nik-Zainal_PMID_22608084-genomes-Alexandrov_3bases.Rdata",

6

computeExplainedVariance
package="decompTumor2Sig")
load(gfile)
### compute exposures
exposures <- decomposeTumorGenomes(genomes, signatures, verbose=FALSE)
### re-compose (predict) tumor genome features from exposures
predGenomes <- composeGenomesFromExposures(exposures, signatures)

computeExplainedVariance
Compute the explained variance.

Description
‘computeExplainedVariance()‘ computes for one or more tumors the variance which is explained
by the estimated contributions (exposures) of a set of signatures when compared to the observed
genomes.
Usage
computeExplainedVariance(exposures, signatures, genomes)
Arguments
exposures

(Mandatory) A single vector or list of vectors containing the estimated signature
contributions/exposures as provided by the function decomposeTumorGenomes.
A list of vectors is used if the explained variance shall be computed for multiple
genomes. The number of exposure vectors must correspond to the number of
genomes. The number of elements of each exposure vector must correspond to
the number of signatures.

signatures

(Mandatory) The list of signatures (vectors, data frames or matrices) for which
the exposures were obtained. Each of the list objects represents one mutational
signature. Vectors are used for Alexandrov signatures, data frames or matrices
for Shiraishi signatures.

genomes

(Mandatory) Can be either a vector, a data frame or a matrix (for an individual
tumor genome), or a list of one of these object types (for multiple tumors). Each
tumor genome must be of the same form as the signatures.

Value
A numeric vector of explained variances, one for each genome.
Author(s)
Rosario M. Piro
Freie Universitaet Berlin
Maintainer: Rosario M. Piro
E-Mail:  or 

convertAlexandrov2Shiraishi

7

References
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2018) decompTumor2Sig: Identification of mutational signatures active in individual
tumors. BMC Bioinformatics (accepted for publication).
Krueger, Piro (2017) Identification of Mutational Signatures Active in Individual Tumors. NETTAB
2017 - Methods, Tools & Platforms for Personalized Medicine in the Big Data Era, October 16-18,
2017, Palermo, Italy. PeerJ Preprints 5:e3257v1, 2017.
See Also
decompTumor2Sig
decomposeTumorGenomes
plotExplainedVariance
Examples
### get Alexandrov signatures from COSMIC
signatures <- readAlexandrovSignatures()
### load preprocessed breast cancer genomes (object 'genomes') from
### Nik-Zainal et al (PMID: 22608084)
gfile <- system.file("extdata",
"Nik-Zainal_PMID_22608084-genomes-Alexandrov_3bases.Rdata",
package="decompTumor2Sig")
load(gfile)
### compute exposures
exposures <- decomposeTumorGenomes(genomes, signatures, verbose=FALSE)
### compute explained variance for the tumor genomes
computeExplainedVariance(exposures, signatures, genomes)

convertAlexandrov2Shiraishi
Convert Alexandrov-type signatures to Shiraishi signatures

Description
‘convertAlexandrov2Shiraishi()‘ converts a set Alexandrov signatures to the Shiraishi model, summing the respective frequencies of base changes, and upstream and downstream flanking bases. In
most cases, the resulting Shiraishi signatures don’t provide information on the transcription strand,
as this is not part of the standard Alexandrov signatures. While the conversion is mainly thought for
signatures, it actually works also for mutation frequency data from genomes which have the same
format. [Attention: this conversion entails a loss of specificity and the applicability of Shiraishi
signatures derived from Alexandrov signatures has not been extensively explored!]
Usage
convertAlexandrov2Shiraishi(signatures)

8

convertGenomesFromVRanges

Arguments
signatures

(Mandatory) A list of Alexandrov signatures with named elements as produced
by readAlexandrovSignatures.

Value
A list of Shiraishi signatures that can be used for decomposeTumorGenomes.
Author(s)
Rosario M. Piro
Freie Universitaet Berlin
Maintainer: Rosario M. Piro
E-Mail:  or 
References
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2018) decompTumor2Sig: Identification of mutational signatures active in individual
tumors. BMC Bioinformatics (accepted for publication).
Krueger, Piro (2017) Identification of Mutational Signatures Active in Individual Tumors. NETTAB
2017 - Methods, Tools & Platforms for Personalized Medicine in the Big Data Era, October 16-18,
2017, Palermo, Italy. PeerJ Preprints 5:e3257v1, 2017.
See Also
decompTumor2Sig
readAlexandrovSignatures
readShiraishiSignatures
Examples
### get Alexandrov signatures from COSMIC
signAlexandrov <- readAlexandrovSignatures()
### convert them to the Shiraishi model
signShiraishi <- convertAlexandrov2Shiraishi(signAlexandrov)

convertGenomesFromVRanges
Convert genomes from a VRanges object

Description
‘convertGenomesFromVRanges()‘ converts the SNVs of a single tumor genome (sample) or a set
of genomes from a VRanges object (package VariantAnnotation) and determines the mutation
frequencies according to a specific model of mutational signatures (Alexandrov or Shiraishi), such
that the resulting format can be used as genomes input for decomposeTumorGenomes.

convertGenomesFromVRanges

9

Usage
convertGenomesFromVRanges(vranges, numBases=5, type="Shiraishi",
trDir=TRUE,
refGenome=BSgenome.Hsapiens.UCSC.hg19::BSgenome.Hsapiens.UCSC.hg19,
transcriptAnno=
TxDb.Hsapiens.UCSC.hg19.knownGene::TxDb.Hsapiens.UCSC.hg19.knownGene,
verbose=TRUE)
Arguments
vranges

(Mandatory) The VRanges object which specifies the mutations.

numBases

(Mandatory) Total number of bases (mutated base and flanking bases) to be used
for sequence patterns. Must be odd. Default: 5

type

(Mandatory) Signature model or type ("Alexandrov" or "Shiraishi"). Default: "Shiraishi"

trDir

(Mandatory) Specifies whether the transcription direction is taken into account
in the signature model. If so, only mutations within genomic regions with a
defined transcription direction can be considered. Default: TRUE

refGenome

(Mandatory) The reference genome (BSgenome) needed to extract sequence patterns. Default: BSgenome object for hg19.

transcriptAnno (Optional) Transcript annotation (TxDb object) used to determine the transcription direction. This is required only if trDir is TRUE. Default: TxDb object for
hg19.
verbose

(Optional) Print information about reading and processing the mutation data.
Default: TRUE

Value
A list containing the genomes in terms of frequencies of the mutated sequence patterns. This list of
genomes can be used for decomposeTumorGenomes.
Author(s)
Rosario M. Piro
Freie Universitaet Berlin
Maintainer: Rosario M. Piro
E-Mail:  or 

References
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2018) decompTumor2Sig: Identification of mutational signatures active in individual
tumors. BMC Bioinformatics (accepted for publication).
Krueger, Piro (2017) Identification of Mutational Signatures Active in Individual Tumors. NETTAB
2017 - Methods, Tools & Platforms for Personalized Medicine in the Big Data Era, October 16-18,
2017, Palermo, Italy. PeerJ Preprints 5:e3257v1, 2017.

10

decomposeTumorGenomes

See Also
decompTumor2Sig
decomposeTumorGenomes
readGenomesFromVCF
readGenomesFromMPF
getGenomesFromMutFeatData
Examples
### load the reference genome and the transcript annotation database
refGenome <- BSgenome.Hsapiens.UCSC.hg19::BSgenome.Hsapiens.UCSC.hg19
transcriptAnno 15)!
constrainToMaxContribution
(Optional) [Note: this is EXPERIMENTAL and is usually not needed!] If TRUE,
the maximum contribution that can be attributed to a signature will be constraint
by the variant feature counts (e.g., specific flanking bases) observed in the individual tumor genome. If, for example, 30% of all observed variants have a specific feature and 60% of the variants produced by a mutational process/signature
will manifest the feature, then the signature can have contributed up to 0.3/0.6
(=0.5 or 50%) of the observed variants. The lowest possible contribution over all

12

decomposeTumorGenomes
signature features will be taken as the allowed maximum contribution of the signature. This allowed maximum will additionally be increased by the value specified as tolerance (see below). For the illustrated example and tolerance=0.1
a contribution of up to 0.5+0.1 = 0.6 (or 60%) of the signature would be allowed.
tolerance

(Optional) If constrainToMaxContribution is TRUE, the maximum contribution computed for a signature is increased by this value (see above). If the
parameter constrainToMaxContribution is FALSE, the tolerance value is ignored. Default: 0.1.

verbose

(Optional) If TRUE some information about the processed genome and used number of signatures will be printed.

Value
A list of signature weight vectors (also called ’exposures’), one for each tumor genome. E.g., the
first vector element of the first list object is the weight/contribution of the first signature to the
first tumor genome. IMPORTANT: If minExplainedVariance is specified, then the exposures of a
genome will NOT be returned if the minimum explained variance is not reached within the requested
minimum and maximum numbers of signatures (minNumSignatures and maxNumSignatures)!
The corresponding exposure vector will be set to NULL.
Author(s)
Rosario M. Piro, Sandra Krueger
Freie Universitaet Berlin
Maintainer: Rosario M. Piro
E-Mail:  or 
References
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2018) decompTumor2Sig: Identification of mutational signatures active in individual
tumors. BMC Bioinformatics (accepted for publication).
Krueger, Piro (2017) Identification of Mutational Signatures Active in Individual Tumors. NETTAB
2017 - Methods, Tools & Platforms for Personalized Medicine in the Big Data Era, October 16-18,
2017, Palermo, Italy. PeerJ Preprints 5:e3257v1, 2017.
See Also
decompTumor2Sig
Examples
### get Alexandrov signatures from COSMIC
signatures <- readAlexandrovSignatures()
### load reference genome
refGenome <- BSgenome.Hsapiens.UCSC.hg19::BSgenome.Hsapiens.UCSC.hg19
### read breast cancer genomes from Nik-Zainal et al (PMID: 22608084)
gfile <- system.file("extdata",
"Nik-Zainal_PMID_22608084-VCF-convertedfromMPF.vcf.gz",
package="decompTumor2Sig")
genomes <- readGenomesFromVCF(gfile, numBases=3, type="Alexandrov",

determineSignatureDistances

13

trDir=FALSE, refGenome=refGenome, verbose=FALSE)
### compute exposures
exposures <- decomposeTumorGenomes(genomes, signatures, verbose=FALSE)
### (for further examples on searching subsets, please see the vignette)

determineSignatureDistances
Determine differences between a given signature and a set of target
signatures.

Description
‘determineSignatureDistances()‘ determines all distances (i.e., differences) between a given signature (of type Alexandrov or Shiraishi) and a set of target signatures (of the same type). This can
help to compare signatures that have been determined in different ways or from different datasets.
Different distance measures can be used (see details below).
Usage
determineSignatureDistances(fromSignature, toSignatures,
method="euclidean")
Arguments
fromSignature

(Mandatory) A single signature of the Alexandrov (vector) or Shiraishi type
(data frame or matrix).

toSignatures

(Mandatory) The list of target signatures for which to compute the distances to
fromSignature. These target signatures must be of the same type and format
as fromSignature.

method

(Optional) The distance measure to be used. This can be one of the following: "frobenius" for Frobenius distance between matrices (only for Shiraishi
signatures); "rss" for the residual sum of squares (squared error); or any distance measure available for the function dist of the stats package. Default:
"euclidean".

Details
Distances that can be used are:
"frobenius"
"rss"
"euclidean"
"maximum"
"manhattan"
"canberra"

Forbenius distance between real-valued matrices
(or Shiraishi signatures) A and B:
F = sqrt(trace( (A-B) %*% t(A-B) ))
Residual sum of squares (i.e., squared error):
rss = sum((A-B)^2)
(see ?dist for details)
(see ?dist for details)
(see ?dist for details)
(see ?dist for details)

14

determineSignatureDistances
"binary"
"minkowski"

(see ?dist for details)
(see ?dist for details)

Value
A signature-named vector containing all distances. This vector has the same order as the target
signature list, so it is not sorted according to distance.
Author(s)
Rosario M. Piro
Freie Universitaet Berlin
Maintainer: Rosario M. Piro
E-Mail:  or 
References
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2018) decompTumor2Sig: Identification of mutational signatures active in individual
tumors. BMC Bioinformatics (accepted for publication).
Krueger, Piro (2017) Identification of Mutational Signatures Active in Individual Tumors. NETTAB
2017 - Methods, Tools & Platforms for Personalized Medicine in the Big Data Era, October 16-18,
2017, Palermo, Italy. PeerJ Preprints 5:e3257v1, 2017.
See Also
decompTumor2Sig
mapSignatureSets
Examples
### get Alexandrov signatures from COSMIC
signAlexandrov <- readAlexandrovSignatures()
### convert them to Shiraishi signatures
signAlex2Shi <- convertAlexandrov2Shiraishi(signAlexandrov)
### define an arbitrary signature just for testing
### (similar to signature 1)
testSig <- matrix(c(0.1,
0, 0.7, 0.1, 0.1,
0,
0.3, 0.2, 0.3, 0.2,
0,
0,
0.2, 0.1, 0.5, 0.2,
0,
0), nrow=3, byrow=TRUE)
### compute distances of the test signature to the converted
### Alexandrov signatures from COSMIC
determineSignatureDistances(testSig, signAlex2Shi, method="frobenius")

downgradeShiraishiSignatures

15

downgradeShiraishiSignatures
Downgrade Shiraishi-type signatures.

Description
‘downgradeShiraishiSignatures()‘ downgrades/trims signatures of the Shiraishi type by discarding
flanking bases (reducing the length of the sequence pattern) and/or the transcription direction. The
downgrade doesn’t pose a problem because the flanking bases and the transcription direction are
considered as independent features according to the Shiraishi model of mutational signatures.
Usage
downgradeShiraishiSignatures(signatures, numBases=NULL,
removeTrDir=FALSE)
Arguments
signatures
numBases

removeTrDir

(Mandatory) A list of Shiraishi signatures that need to be downgraded/trimmed.
(Conditionally optional) The total number of bases (mutated base plus flanking
bases around the mutated base) that should be kept. All further flanking bases
farther away from the mutated bases are dropped. If specified, numBases must
be odd and smaller than the current number of bases of the signatures. If NULL,
no flanking bases will be dropped. At least one of numBases or removeTrDir
must be specified.
(Conditionally optional) Logical value that specifies whether information on
the transcript direction should be dropped (if present at all). At least one of
numBases or removeTrDir must be specified.

Value
A list of Shiraishi signatures that have been accordingly downgraded.
Author(s)
Rosario M. Piro
Freie Universitaet Berlin
Maintainer: Rosario M. Piro
E-Mail:  or 
References
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2018) decompTumor2Sig: Identification of mutational signatures active in individual
tumors. BMC Bioinformatics (accepted for publication).
Krueger, Piro (2017) Identification of Mutational Signatures Active in Individual Tumors. NETTAB
2017 - Methods, Tools & Platforms for Personalized Medicine in the Big Data Era, October 16-18,
2017, Palermo, Italy. PeerJ Preprints 5:e3257v1, 2017.
See Also
decompTumor2Sig

16

evaluateDecompositionQuality

Examples
### Load 15 Shiraishi signatures obtained from 435 tumor genomes from
### Alexandrov et al. (number of bases: 5, transcription direction: yes)
sfile <- system.file("extdata",
"Alexandrov_PMID_23945592_435_tumors-pmsignature-15sig.Rdata",
package="decompTumor2Sig")
load(sfile)
### downgrade the signatures to include only 3 bases and drop the
### transcription direction
downgradeShiraishiSignatures(signatures, numBases=3, removeTrDir=TRUE)

evaluateDecompositionQuality
Evaluate tumor decomposition quality.

Description
‘evaluateDecompositionQuality()‘ evaluates the quality of the decomposition into exposures of a
single tumor. The function evaluates the quality of a decomposition obtained from the function
decomposeTumorGenomes by comparing the re-composed (=re-constructed) tumor genome mutation frequencies to those actually observed in the tumor genome. Tumor genome mutation frequencies are reconstructed using composeGenomesFromExposures and the results can optionally
be plotted.
Usage
evaluateDecompositionQuality(exposure, signatures, genome,
plot=FALSE)
Arguments
exposure

(Mandatory) A single vector containing the estimated signature contributions,
or exposures, of a single tumor as provided by decomposeTumorGenomes. The
number of elements of the exposure vector must correspond to the number of
signatures (see below).

signatures

(Mandatory) The list of signatures (vectors, data frames or matrices) for which
the exposures were obtained. Each of the list objects represents one mutational
signature. Vectors are used for Alexandrov signatures, data frames or matrices
for Shiraishi signatures.

genome

(Mandatory) A single tumor genome in form of mutation frequencies specified
either in the Alexandrov or the Shiraishi format (must match the format used for
signatures, see above).

plot

(Optional) If FALSE (default), the numerical results (see below) will be returned.
If TRUE, the reconstructed mutation frequencies will be plotted against the original, observed mutation frequencies and the numerical results will be integrated
as text labels in the plot.

evaluateDecompositionQuality

17

Value
A named list object containing measurements for the Pearson correlation coefficient between the
reconstructed and observed mutation frequencies, and the explained variance; or alternatively, a plot
with these measurements (see option plot above).
Author(s)
Rosario M. Piro
Freie Universitaet Berlin
Maintainer: Rosario M. Piro
E-Mail:  or 
Rosario M. Piro, Freie Universitaet Berlin, 
References
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2018) decompTumor2Sig: Identification of mutational signatures active in individual
tumors. BMC Bioinformatics (accepted for publication).
Krueger, Piro (2017) Identification of Mutational Signatures Active in Individual Tumors. NETTAB
2017 - Methods, Tools & Platforms for Personalized Medicine in the Big Data Era, October 16-18,
2017, Palermo, Italy. PeerJ Preprints 5:e3257v1, 2017.
See Also
decompTumor2Sig
decomposeTumorGenomes
composeGenomesFromExposures
computeExplainedVariance
Examples
### get Alexandrov signatures from COSMIC
signatures <- readAlexandrovSignatures()
### load preprocessed breast cancer genomes (object 'genomes') from
### Nik-Zainal et al (PMID: 22608084)
gfile <- system.file("extdata",
"Nik-Zainal_PMID_22608084-genomes-Alexandrov_3bases.Rdata",
package="decompTumor2Sig")
load(gfile)
### compute exposures
exposures <- decomposeTumorGenomes(genomes, signatures, verbose=FALSE)
### evaluate the decomposition by comparing to the original data
evaluateDecompositionQuality(exposures[[1]], signatures, genomes[[1]])

18

getGenomesFromMutFeatData

getGenomesFromMutFeatData
Get genomes (mutation frequencies) from MutationFeatureData.

Description
‘getGenomesFromMutFeatData()‘ takes a MutationFeatureData object (mutation count data) as
read by the ’pmsignature’ package (e.g., by pmsignature::readMPFile, version 0.3.0) and extracts the mutation counts of the genomes therein. For passing the genomes to decomposeTumorGenomes,
the mutation counts must be normalized to mutation frequencies, which is done by default. [IMPORTANT: set normalize to FALSE only if you are interested in full integer counts, but do not pass
unnormalized counts to decomposeTumorGenomes!]
Usage
getGenomesFromMutFeatData(mutFeatData, normalize=TRUE)
Arguments
mutFeatData

(Mandatory) A MutationFeatureData object as constructed, for example, by
pmsignature::readMPFile.

normalize

(Optional) Boolean value to specify whether to normalize the mutation count
data to mutation fractions between 0 and 1. This is the default and NECESSARY in case you want to pass the return value to decomposeTumorGenomes.
Set normalize to FALSE only if you are interested in full integer counts, but do
not pass unnormalized counts to decomposeTumorGenomes!

Value
A list of mutation frequencies (or mutation counts if not normalized), one object per genome. The
format is either according to the Shiraishi or the Alexandrov model, depending on how the mutation
data was loaded with pmsignature.
Author(s)
Rosario M. Piro and Sandra Krueger
Freie Universitaet Berlin
Maintainer: Rosario M. Piro
E-Mail:  or 
References
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2018) decompTumor2Sig: Identification of mutational signatures active in individual
tumors. BMC Bioinformatics (accepted for publication).
Krueger, Piro (2017) Identification of Mutational Signatures Active in Individual Tumors. NETTAB
2017 - Methods, Tools & Platforms for Personalized Medicine in the Big Data Era, October 16-18,
2017, Palermo, Italy. PeerJ Preprints 5:e3257v1, 2017.
See Also
decompTumor2Sig

getSignaturesFromEstParam

19

Examples
### get breast cancer genomes from
### Nik-Zainal et al (PMID: 22608084) in the format produced by
### pmsignature (PMID: 26630308)
pmsigdata <- system.file("extdata",
"Nik-Zainal_PMID_22608084-pmsignature-G.Rdata",
package="decompTumor2Sig")
load(pmsigdata)
### extract the genomes from the pmsignature G object
genomes <- getGenomesFromMutFeatData(G, normalize=TRUE)

getSignaturesFromEstParam
Get signatures from an EstimatedParameters object.

Description
‘getSignaturesFromEstParam()‘ takes an EstimatedParameters object (signatures data) as computed by the ’pmsignature’ package (by pmsignature::getPMSignature; version 0.3.0) and extracts the signature information. The signatures can then be passed to decomposeTumorGenomes.
Usage
getSignaturesFromEstParam(Param)
Arguments
Param

(Mandatory) A pmsignature::EstimatedParameters object as those produced
by the de novo signature construction method pmsignature::getPMSignature.

Value
A list of Shiraishi signatures, one object per signature. Please see readShiraishiSignatures or
the decompTumor2Sig vignette for more information on the format of Shiraishi signatures.
Author(s)
Rosario M. Piro and Sandra Krueger
Freie Universitaet Berlin
Maintainer: Rosario M. Piro
E-Mail:  or 
References
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2018) decompTumor2Sig: Identification of mutational signatures active in individual
tumors. BMC Bioinformatics (accepted for publication).
Krueger, Piro (2017) Identification of Mutational Signatures Active in Individual Tumors. NETTAB
2017 - Methods, Tools & Platforms for Personalized Medicine in the Big Data Era, October 16-18,
2017, Palermo, Italy. PeerJ Preprints 5:e3257v1, 2017.

20

isAlexandrovSet

See Also
decompTumor2Sig
readShiraishiSignatures
Examples
### load signatures for breast cancer genomes from
### Nik-Zainal et al (PMID: 22608084) in the format produced by
### pmsignature (PMID: 26630308)
pmsigdata <- system.file("extdata",
"Nik-Zainal_PMID_22608084-pmsignature-Param.Rdata",
package="decompTumor2Sig")
load(pmsigdata)
### extract the signatures from the pmsignature Param object
signatures <- getSignaturesFromEstParam(Param)

isAlexandrovSet

isAlexandrovSet

Description
‘isAlexandrovSet()‘ checks whether the input object is a set (list) of numeric objects compatible
with the Alexandrov format (probability vectors; sum up to 1). NOTE: These can also be genomes
compatible with the Alexandrov format!
Usage
isAlexandrovSet(x)
Arguments
x

Object to be checked.

Value
Logical value (true or false).
Author(s)
Rosario M. Piro
Freie Universitaet Berlin
Maintainer: Rosario M. Piro
E-Mail:  or 

isExposureSet

21

References
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2018) decompTumor2Sig: Identification of mutational signatures active in individual
tumors. BMC Bioinformatics (accepted for publication).
Krueger, Piro (2017) Identification of Mutational Signatures Active in Individual Tumors. NETTAB
2017 - Methods, Tools & Platforms for Personalized Medicine in the Big Data Era, October 16-18,
2017, Palermo, Italy. PeerJ Preprints 5:e3257v1, 2017.
See Also
decompTumor2Sig
readAlexandrovSignatures
isSignatureSet
Examples
### get Alexandrov signatures from COSMIC
signAlexandrov <- readAlexandrovSignatures()
isAlexandrovSet(signAlexandrov)

isExposureSet

isExposureSet

Description
‘isExposureSet()‘ checks whether the input object is a set (list) of numeric objects compatible with
exposure output obtained from decomposeTumorGenomes.
Usage
isExposureSet(x)
Arguments
x

Object to be checked.

Value
Logical value (true or false).
Author(s)
Rosario M. Piro
Freie Universitaet Berlin
Maintainer: Rosario M. Piro
E-Mail:  or 

22

isShiraishiSet

References
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2018) decompTumor2Sig: Identification of mutational signatures active in individual
tumors. BMC Bioinformatics (accepted for publication).
Krueger, Piro (2017) Identification of Mutational Signatures Active in Individual Tumors. NETTAB
2017 - Methods, Tools & Platforms for Personalized Medicine in the Big Data Era, October 16-18,
2017, Palermo, Italy. PeerJ Preprints 5:e3257v1, 2017.
See Also
decompTumor2Sig
decomposeTumorGenomes
Examples
### get Alexandrov signatures from COSMIC
signatures <- readAlexandrovSignatures()
### load reference genome
refGenome <- BSgenome.Hsapiens.UCSC.hg19::BSgenome.Hsapiens.UCSC.hg19
### read breast cancer genomes from Nik-Zainal et al (PMID: 22608084)
gfile <- system.file("extdata",
"Nik-Zainal_PMID_22608084-VCF-convertedfromMPF.vcf.gz",
package="decompTumor2Sig")
genomes <- readGenomesFromVCF(gfile, numBases=3, type="Alexandrov",
trDir=FALSE, refGenome=refGenome, verbose=FALSE)
### compute exposures
exposures <- decomposeTumorGenomes(genomes, signatures, verbose=FALSE)
isExposureSet(exposures)

isShiraishiSet

isShiraishiSet

Description
‘isShiraishiSet()‘ checks whether the input object is a set (list) of numeric objects compatible with
the Shiraishi format (matrices or data.frames of probabilities; 6 columns, each row sums up to 1).
NOTE: These can also be genomes compatible with the Shiraishi format!
Usage
isShiraishiSet(x)
Arguments
x

Object to be checked.

isSignatureSet

23

Value
Logical value (true or false).
Author(s)
Rosario M. Piro
Freie Universitaet Berlin
Maintainer: Rosario M. Piro
E-Mail:  or 
References
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2018) decompTumor2Sig: Identification of mutational signatures active in individual
tumors. BMC Bioinformatics (accepted for publication).
Krueger, Piro (2017) Identification of Mutational Signatures Active in Individual Tumors. NETTAB
2017 - Methods, Tools & Platforms for Personalized Medicine in the Big Data Era, October 16-18,
2017, Palermo, Italy. PeerJ Preprints 5:e3257v1, 2017.
See Also
decompTumor2Sig
isSignatureSet
readShiraishiSignatures
Examples
### get Alexandrov signatures from COSMIC
signAlexandrov <- readAlexandrovSignatures()
### convert them to the Shiraishi model
signShiraishi <- convertAlexandrov2Shiraishi(signAlexandrov)
isShiraishiSet(signShiraishi)

isSignatureSet

isSignatureSet

Description
‘isSignatureSet()‘ checks whether the input object is a set (list) of numeric objects compatible with
either the Alexandrov format (probability vectors; see isAlexandrovSet) or the Shiraishi format
(matrices or data.frames of probabilities; see isShiraishiSet). NOTE: These can also be genomes
compatible with one of the two formats!
Usage
isSignatureSet(x)
Arguments
x

Object to be checked.

24

mapSignatureSets

Value
Logical value (true or false).
Author(s)
Rosario M. Piro
Freie Universitaet Berlin
Maintainer: Rosario M. Piro
E-Mail:  or 
References
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2018) decompTumor2Sig: Identification of mutational signatures active in individual
tumors. BMC Bioinformatics (accepted for publication).
Krueger, Piro (2017) Identification of Mutational Signatures Active in Individual Tumors. NETTAB
2017 - Methods, Tools & Platforms for Personalized Medicine in the Big Data Era, October 16-18,
2017, Palermo, Italy. PeerJ Preprints 5:e3257v1, 2017.
See Also
decompTumor2Sig
isAlexandrovSet
isShiraishiSet
Examples
### get Alexandrov signatures from COSMIC
signAlexandrov <- readAlexandrovSignatures()
isSignatureSet(signAlexandrov)

mapSignatureSets

Map one signature set to another.

Description
‘mapSignatureSets()‘ determines a mapping from one set of signatures to another. Both Alexandrov
and Shiraishi signatures can be handled, but both sets must be of the same type. The mapping can
either be a unique (one-to-one) mapping or identify best matches while allowing multiple signatures to be mapped to the same target signature if it is the best match for more than one signature.
Different distance measures can be used (see details below).
Usage
mapSignatureSets(fromSignatures, toSignatures, method="euclidean",
unique=FALSE)

mapSignatureSets

25

Arguments
fromSignatures (Mandatory) A set (list) of signatures of the Alexandrov (vector) or Shiraishi
type (data frame or matrix), that has to be mapped to the signatures of a second
set (toSignatures).
toSignatures

(Mandatory) The set (list) of signatures to which the set of fromSignatures has
to be mapped.

method

(Optional) The distance measure to be used. This can be one of the following: "frobenius" for Frobenius distance between matrices (only for Shiraishi
signatures); "rss" for the residual sum of squares (squared error); or any distance measure available for the function dist() of the stats package. Default:
"euclidean".

unique

(Optional) If set to FALSE (default), then for each signature of fromSignatures
the best match (minimum distance) from toSignatures is selected. The selected signatures need not be unique, i.e., one signature of toSignatures may
be the best match for multiple signatures of fromSignatures. If set to TRUE, i.e.,
if a unique (one-to-one) mapping is required, an iterative approach is performed:
in each step, the best matching pair from fromSignatures and toSignatures is
mapped and then removed from the list of signatures that remain to be mapped,
such that they cannot be selected again.

Details
Distances that can be used are:
"frobenius"
"rss"
"euclidean"
"maximum"
"manhattan"
"canberra"
"binary"
"minkowski"

Forbenius distance between real-valued matrices
(or Shiraishi signatures) A and B:
F = sqrt(trace( (A-B) %*% t(A-B) ))
Residual sum of squares (i.e., squared error):
rss = sum((A-B)^2)
(see ?dist for details)
(see ?dist for details)
(see ?dist for details)
(see ?dist for details)
(see ?dist for details)
(see ?dist for details)

Value
A vector having as elements the mapped signatures of toSignatures, and as names the signatures
of fromSignatures with which they have been associated.
Author(s)
Rosario M. Piro
Freie Universitaet Berlin
Maintainer: Rosario M. Piro
E-Mail:  or 
References
http://rmpiro.net/decompTumor2Sig/

26

plotDecomposedContribution
Krueger, Piro (2018) decompTumor2Sig: Identification of mutational signatures active in individual
tumors. BMC Bioinformatics (accepted for publication).
Krueger, Piro (2017) Identification of Mutational Signatures Active in Individual Tumors. NETTAB
2017 - Methods, Tools & Platforms for Personalized Medicine in the Big Data Era, October 16-18,
2017, Palermo, Italy. PeerJ Preprints 5:e3257v1, 2017.

See Also
decompTumor2Sig
determineSignatureDistances
Examples
### get Alexandrov signatures from COSMIC
signAlexandrov <- readAlexandrovSignatures()
### convert them to Shiraishi signatures
signAlex2Shi <- convertAlexandrov2Shiraishi(signAlexandrov)
### define a small set of arbitrary signatures just for testing
### (similar to signatures 1, 5 and 13, respectively)
test1 <- matrix(c( 0.1, 0,
0.7, 0.1, 0.1, 0,
0.3, 0.2, 0.3, 0.2, 0,
0,
0.2, 0.1, 0.5, 0.2, 0,
0 ), nrow=3, byrow=TRUE)
test2 <- matrix(c( 0.1, 0.1, 0.3, 0.1, 0.3,
0.3, 0.25, 0.2, 0.25, 0,
0.3, 0.2, 0.2, 0.3, 0,

0.1,
0,
0 ), nrow=3, byrow=TRUE)

test3 <- matrix(c( 0.1, 0.7, 0.2,
0,
0,
0,
0.5, 0.1, 0,

0,
0,
0

0,
0,
1.0, 0,
0.4, 0,

), nrow=3, byrow=TRUE)

fromSig <- list(sig1=test1, sig2=test2, sig3=test3)
### compute distances of the test signature to the converted
### Alexandrov signatures from COSMIC
mapSignatureSets(fromSig, signAlex2Shi, method="frobenius", unique=TRUE)

plotDecomposedContribution
Plot the decomposition (contributions/exposures) of a tumor genome.

Description
‘plotDecomposedContribution()‘ plots the decomposition of a tumor genome, i.e., the contributions/exposures obtained from decomposeTumorGenomes for a set of signatures.
Usage
plotDecomposedContribution(decomposition, signatures=NULL,
removeNA=TRUE)

plotDecomposedContribution

27

Arguments
decomposition

(Mandatory) A decomposition vector (exposure vector) obtained for a single
tumor genome.

signatures

(Optional) A list object containing the signatures used to compute the decomposition. If specified, the signature labels used in the plot will be taken from
the element names of the list; otherwise signature names will be taken from the
exposure object (decomposition) or named from sign_1 to sign_N.

removeNA

(Optional) If TRUE (default), signatures with an NA as exposure will not be included on the x-axis of the the plot. Exposures can be NA if they have been
determined with a greedy search.

Value
Returns (or draws) a plot of the decomposed tumor genome (i.e., contributions of the single signatures).
Author(s)
Rosario M. Piro
Freie Universitaet Berlin
Maintainer: Rosario M. Piro
E-Mail:  or 
References
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2018) decompTumor2Sig: Identification of mutational signatures active in individual
tumors. BMC Bioinformatics (accepted for publication).
Krueger, Piro (2017) Identification of Mutational Signatures Active in Individual Tumors. NETTAB
2017 - Methods, Tools & Platforms for Personalized Medicine in the Big Data Era, October 16-18,
2017, Palermo, Italy. PeerJ Preprints 5:e3257v1, 2017.
See Also
decompTumor2Sig
decomposeTumorGenomes
Examples
### get Alexandrov signatures from COSMIC
signatures <- readAlexandrovSignatures()
### load preprocessed breast cancer genomes (object 'genomes') from
### Nik-Zainal et al (PMID: 22608084)
gfile <- system.file("extdata",
"Nik-Zainal_PMID_22608084-genomes-Alexandrov_3bases.Rdata",
package="decompTumor2Sig")
load(gfile)
### compute exposures
exposures <- decomposeTumorGenomes(genomes, signatures, verbose=FALSE)
### plot signature composition of the first genome

28

plotExplainedVariance
plotDecomposedContribution(exposures[[1]], signatures=NULL)

plotExplainedVariance Plot the explained variance as a function of the number of signatures

Description
‘plotExplainedVariance()‘ plots the explained variance of a single tumor genome’s mutation patterns as a function of the number of signatures (increasing subsets of signatures) used for decomposition. For each number K of signatures, the highest variance explained by possible subsets of
K signatures will be plotted (full or greedy search, see below). This can help to evaluate what
minimum threshold for the explained variance can be used to decompose tumor genomes with the
function decomposeTumorGenomes.
Usage
plotExplainedVariance(genome, signatures, minExplainedVariance=NULL,
minNumSignatures=2, maxNumSignatures=NULL, greedySearch=FALSE)
Arguments
genome

(Mandatory) The mutation load of a single genome in Alexandrov- of Shiraishiformat, i.e. as vector or matrix. The format must be the same as the one used
for the signatures (see below).

signatures

(Mandatory) The list of signatures (vectors, data frames or matrices) which are
to be evaluated. Each of the list objects represents one mutational signature.
Vectors are used for Alexandrov signatures, data frames or matrices for Shiraishi
signatures.
minExplainedVariance
(Optional) If a numeric value between 0 and 1 is specified, the plot highlights the
smallest subset of signatures which is sufficient to explain at least the specified
fraction of the variance of the genome’s mutation patterns. If, for example,
minExplainedVariance is 0.99 the smallest subset of signatures that explains
at least 99% of the variance will be highlighted.
minNumSignatures
(Optional) The plot will be generated only for K>=minNumSignatures.
maxNumSignatures
(Optional) The plot will be generated only for K<=maxNumSignatures.
greedySearch

(Optional) If greedySearch is set to TRUE then not all possible combinations of
minNumSignatures to maxNumSignatures signatures will be checked. Instead,
first all possible combinations for exactly minNumSignatures will be checked
to select the best starting set, then iteratively the next best signature will be
added (maximum increase in explained variability) until maxNumSignatures is
reached). NOTE: while this is only an approximation, it is highly recommended
for large sets of signatures (>15)!

Value
Returns (or draws) a plot of the explained variance as a function of the number of signatures.

plotMutationDistribution

29

Author(s)
Rosario M. Piro
Freie Universitaet Berlin
Maintainer: Rosario M. Piro
E-Mail:  or 
References
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2018) decompTumor2Sig: Identification of mutational signatures active in individual
tumors. BMC Bioinformatics (accepted for publication).
Krueger, Piro (2017) Identification of Mutational Signatures Active in Individual Tumors. NETTAB
2017 - Methods, Tools & Platforms for Personalized Medicine in the Big Data Era, October 16-18,
2017, Palermo, Italy. PeerJ Preprints 5:e3257v1, 2017.
See Also
decompTumor2Sig
decomposeTumorGenomes
computeExplainedVariance
Examples
### get 15 pre-processed Shiraishi signatures computed (object 'signatures')
### from 435 tumor genomes Alexandrov et al (PMID: 23945592)
### using the pmsignature package
sfile <- system.file("extdata",
"Alexandrov_PMID_23945592_435_tumors-pmsignature-15sig.Rdata",
package="decompTumor2Sig")
load(sfile)
### load preprocessed breast cancer genomes (object 'genomes') from
### Nik-Zainal et al (PMID: 22608084)
gfile <- system.file("extdata",
"Nik-Zainal_PMID_22608084-genomes-Shiraishi_5bases_trDir.Rdata",
package="decompTumor2Sig")
load(gfile)
### plot the explained variance for 2 to 6 signatures of the first genome
plotExplainedVariance(genomes[[1]], signatures,
minExplainedVariance=0.98, minNumSignatures=2, maxNumSignatures=6)

plotMutationDistribution
Plot mutation frequency data of a mutational signature or tumor
genome.

Description
‘plotMutationDistribution()‘ plots a single signature or the mutation frequency data for a single
genome. This works for signatures or genome data of both the Shiraishi and the Alexandrov type.

30

plotMutationDistribution

Usage
plotMutationDistribution(mutData, colors = NULL, strip = NULL)
Arguments
mutData

(Mandatory) The signature or genome mutation frequency data to be plotted.
This can either be a matrix (Shiraishi model) or a numeric vector (Alexandrov
model).

colors

Vector of colors to be used for the base change data. For Alexandrov-type data,
this vector must contain six elements (one per base change). For Shiraishi-type
data, this vector must contain four elements (one per base). If NULL (default), for
Alexandrov-type data, the colors are set to those used by the COSMIC website;
for Shiraishi-type data, the consensus base colors for sequence logos will be
used.

strip

Background color for strip labels; used only for Alexandrov-type data. If NULL
(default), "papayawhip" will be used.

Value
Returns (or draws) a plot according to the Alexandrov or Shiraishi model of mutational signatures.
Author(s)
Rosario M. Piro
Freie Universitaet Berlin
Maintainer: Rosario M. Piro
E-Mail:  or 
References
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2018) decompTumor2Sig: Identification of mutational signatures active in individual
tumors. BMC Bioinformatics (accepted for publication).
Krueger, Piro (2017) Identification of Mutational Signatures Active in Individual Tumors. NETTAB
2017 - Methods, Tools & Platforms for Personalized Medicine in the Big Data Era, October 16-18,
2017, Palermo, Italy. PeerJ Preprints 5:e3257v1, 2017.
See Also
decompTumor2Sig
Examples
### Attention: using plotMutationDistribution requires the package
### pmsignature to be installed!
### get Alexandrov signatures from COSMIC
signatures <- readAlexandrovSignatures()
### plot the first Alexandrov signature
plotMutationDistribution(signatures[[1]])

readAlexandrovSignatures

31

### read four Shiraishi signatures for breast cancer genomes from
### Nik-Zainal et al (PMID: 22608084) from flat files
sigfiles <- system.file("extdata",
paste0("Nik-Zainal_PMID_22608084-pmsignature-sig",1:4,".tsv"),
package="decompTumor2Sig")
signatures <- readShiraishiSignatures(sigfiles)
### plot the first Shiraishi signature
plotMutationDistribution(signatures[[1]])

readAlexandrovSignatures
Read Alexandrov-type signatures (COSMIC format).

Description
‘readAlexandrovSignatures()‘ reads a set of Alexandrov-type signatures (COSMIC format) from
a flat file or URL. Signatures must be specified in the tab-separated format used by the COSMIC
website; see details below or
http://cancer.sanger.ac.uk/cosmic/signatures -> "Download signatures".
Usage
readAlexandrovSignatures(file)
Arguments
file

(Mandatory) Can be a file name or an URL for download. Default (COSMIC):
"http://cancer.sanger.ac.uk/cancergenome/assets/signatures_probabilities.txt"

Details
COSMIC format for Alexandrov signatures:
Subst.
C>A
C>A
C>A
C>A
[...]
T>G
T>G

Trinucleotide
ACA
ACC
ACG
ACT

Mutation Type
A[C>A]A
A[C>A]C
A[C>A]G
A[C>A]T

Signature 1
0.0110983262
0.0091493407
0.0014900705
0.0062338852

Signature 2
0.0006827082
0.0006191072
0.0000992790
0.0003238914

...
...
...
...
...

TTG
TTT

T[T>G]G
T[T>G]T

0.0020310769
0.0040301281

0.0002066152
0.0000235982

...
...

Value
A list of Alexandrov signatures that can be used for decomposeTumorGenomes.
Author(s)
Rosario M. Piro
Freie Universitaet Berlin

32

readGenomesFromMPF
Maintainer: Rosario M. Piro
E-Mail:  or 

References
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2018) decompTumor2Sig: Identification of mutational signatures active in individual
tumors. BMC Bioinformatics (accepted for publication).
Krueger, Piro (2017) Identification of Mutational Signatures Active in Individual Tumors. NETTAB
2017 - Methods, Tools & Platforms for Personalized Medicine in the Big Data Era, October 16-18,
2017, Palermo, Italy. PeerJ Preprints 5:e3257v1, 2017.
See Also
decompTumor2Sig
readShiraishiSignatures
Examples
### get Alexandrov signatures from COSMIC
signatures <- readAlexandrovSignatures()

readGenomesFromMPF

Read tumor genomes from an MPF file (Mutation Position Format).

Description
‘readGenomesFromMPF()‘ reads somatic mutations of a single tumor genome (sample) or a set of
genomes from an MPF file (Mutation Position Format; see details below) and determines the mutation frequencies according to a specific model of mutational signatures (Alexandrov or Shiraishi).
Usage
readGenomesFromMPF(file, numBases=5, type="Shiraishi", trDir=TRUE,
refGenome=BSgenome.Hsapiens.UCSC.hg19::BSgenome.Hsapiens.UCSC.hg19,
transcriptAnno=
TxDb.Hsapiens.UCSC.hg19.knownGene::TxDb.Hsapiens.UCSC.hg19.knownGene,
verbose=TRUE)
Arguments
file

(Mandatory) The name of the MPF file (can be compressed with gzip).

numBases

(Mandatory) Total number of bases (mutated base and flanking bases) to be used
for sequence patterns. Must be odd. Default: 5

type

(Mandatory) Signature model or type ("Alexandrov" or "Shiraishi"). Default: "Shiraishi"

trDir

(Mandatory) Specifies whether the transcription direction is taken into account
in the signature model. If so, only mutations within genomic regions with a
defined transcription direction can be considered. Default: TRUE

readGenomesFromMPF
refGenome

33

(Mandatory) The reference genome (BSgenome) needed to extract sequence patterns. Default: BSgenome object for hg19.

transcriptAnno (Optional) Transcript annotation (TxDb object) used to determine the transcription direction. This is required only if trDir is TRUE. Default: TxDb object for
hg19.
verbose

(Optional) Print information about reading and processing the mutation data.
Default: TRUE

Details
An MPF file has the following format (one line per mutation and patient/sample):
[sampleID][chrom][position][ref_bases][alt_bases]
Value
A list containing the genomes in terms of frequencies of the mutated sequence patterns. This list of
genomes can be used for decomposeTumorGenomes.
Author(s)
Rosario M. Piro
Freie Universitaet Berlin
Maintainer: Rosario M. Piro
E-Mail:  or 
References
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2018) decompTumor2Sig: Identification of mutational signatures active in individual
tumors. BMC Bioinformatics (accepted for publication).
Krueger, Piro (2017) Identification of Mutational Signatures Active in Individual Tumors. NETTAB
2017 - Methods, Tools & Platforms for Personalized Medicine in the Big Data Era, October 16-18,
2017, Palermo, Italy. PeerJ Preprints 5:e3257v1, 2017.
See Also
decompTumor2Sig
decomposeTumorGenomes
readGenomesFromVCF
getGenomesFromMutFeatData
Examples
### load reference genome and transcript annotation (if direction is needed)
refGenome <- BSgenome.Hsapiens.UCSC.hg19::BSgenome.Hsapiens.UCSC.hg19
transcriptAnno  or 

readShiraishiSignatures

35

References
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2018) decompTumor2Sig: Identification of mutational signatures active in individual
tumors. BMC Bioinformatics (accepted for publication).
Krueger, Piro (2017) Identification of Mutational Signatures Active in Individual Tumors. NETTAB
2017 - Methods, Tools & Platforms for Personalized Medicine in the Big Data Era, October 16-18,
2017, Palermo, Italy. PeerJ Preprints 5:e3257v1, 2017.
See Also
decompTumor2Sig
decomposeTumorGenomes
readGenomesFromMPF
getGenomesFromMutFeatData
Examples
### load reference genome and transcript annotation (if direction is needed)
refGenome <- BSgenome.Hsapiens.UCSC.hg19::BSgenome.Hsapiens.UCSC.hg19
transcriptAnno A, C>G, C>T, T>A, T>C, and T>G
Following 2k lines (for k up- and downstream flanking bases): Frequencies of the bases A, C, G,
and T, followed by two 0 values
Final line (only if transcription direction is considered): Frequencies of occurrences on the transcription strand, and on the opposite strand, followed by four 0 values.
Example:
1.8874e-14
3.8079e-01
1.5311e-01
1.2378e-01
3.4891e-01
5.6435e-01

0.10974
0.12215
0.34214
0.10243
0.15346
0.43565

0.045918
0.191456
0.179774
0.163461
0.156687
0.000000

0.11308
0.30561
0.32497
0.61032
0.34094
0.00000

0.07429
0.00000
0.00000
0.00000
0.00000
0.00000

0.65697
0.00000
0.00000
0.00000
0.00000
0.00000

Value
A list of Shiraishi signatures that can be used for decomposeTumorGenomes.
Author(s)
Rosario M. Piro and Sandra Krueger
Freie Universitaet Berlin
Maintainer: Rosario M. Piro
E-Mail:  or 
References
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2018) decompTumor2Sig: Identification of mutational signatures active in individual
tumors. BMC Bioinformatics (accepted for publication).
Krueger, Piro (2017) Identification of Mutational Signatures Active in Individual Tumors. NETTAB
2017 - Methods, Tools & Platforms for Personalized Medicine in the Big Data Era, October 16-18,
2017, Palermo, Italy. PeerJ Preprints 5:e3257v1, 2017.
See Also
decompTumor2Sig
readAlexandrovSignatures
getSignaturesFromEstParam
Examples
### read four Shiraishi signatures for breast cancer genomes from
### Nik-Zainal et al (PMID: 22608084) from flat files
sigfiles <- system.file("extdata",
paste0("Nik-Zainal_PMID_22608084-pmsignature-sig",1:4,".tsv"),
package="decompTumor2Sig")

sameSignatureFormat

37

signatures <- readShiraishiSignatures(sigfiles)

sameSignatureFormat

sameSignatureFormat

Description
‘sameSignatureFormat()‘ checks whether two input object are sets (lists) of numeric objects both
compatible with the same signature format (probability vectors for Alexandrov signatures and probability matrices or data.frames for Shiraishi signatures). For Shiraishi signatures also the number of
flanking bases and the presence of transcription-strand information are compared. For Alexandrov
signatures also the number of triplet changes are compared.
Usage
sameSignatureFormat(x, y)
Arguments
x

First object to be checked.

y

Second object to be checked.

Value
Logical value (true or false).
Author(s)
Rosario M. Piro
Freie Universitaet Berlin
Maintainer: Rosario M. Piro
E-Mail:  or 
References
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2018) decompTumor2Sig: Identification of mutational signatures active in individual
tumors. BMC Bioinformatics (accepted for publication).
Krueger, Piro (2017) Identification of Mutational Signatures Active in Individual Tumors. NETTAB
2017 - Methods, Tools & Platforms for Personalized Medicine in the Big Data Era, October 16-18,
2017, Palermo, Italy. PeerJ Preprints 5:e3257v1, 2017.
See Also
decompTumor2Sig
isAlexandrovSet
isShiraishiSet

38

sameSignatureFormat

Examples
### get Alexandrov signatures from COSMIC
signAlexandrov <- readAlexandrovSignatures()
### convert them to the Shiraishi model
signShiraishi <- convertAlexandrov2Shiraishi(signAlexandrov)
sameSignatureFormat(signAlexandrov, signShiraishi)

Index
composeGenomesFromExposures, 4, 17
computeExplainedVariance, 6, 17, 29
convertAlexandrov2Shiraishi, 7
convertGenomesFromVRanges, 8
decomposeTumorGenomes, 5, 7, 10, 10, 17, 22,
27, 29, 33, 35
decompTumor2Sig, 5, 7, 8, 10, 12, 14, 15, 17,
18, 20–24, 26, 27, 29, 30, 32, 33,
35–37
decompTumor2Sig
(decompTumor2Sig-package), 2
decompTumor2Sig-package, 2
determineSignatureDistances, 13, 26
downgradeShiraishiSignatures, 15
evaluateDecompositionQuality, 16
getGenomesFromMutFeatData, 10, 18, 33, 35
getSignaturesFromEstParam, 19, 36
isAlexandrovSet, 20, 24, 37
isExposureSet, 21
isShiraishiSet, 22, 24, 37
isSignatureSet, 21, 23, 23
mapSignatureSets, 14, 24
plotDecomposedContribution, 26
plotExplainedVariance, 7, 28
plotMutationDistribution, 29
readAlexandrovSignatures, 8, 21, 31, 36
readGenomesFromMPF, 10, 32, 35
readGenomesFromVCF, 10, 33, 34
readShiraishiSignatures, 8, 20, 23, 32, 35
sameSignatureFormat, 37

39



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.5
Linearized                      : No
Page Count                      : 39
Page Mode                       : UseOutlines
Author                          : 
Title                           : 
Subject                         : 
Creator                         : LaTeX with hyperref package
Producer                        : pdfTeX-1.40.15
Create Date                     : 2018:10:17 17:32:25+02:00
Modify Date                     : 2018:10:17 17:32:25+02:00
Trapped                         : False
PTEX Fullbanner                 : This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2015/dev/Debian) kpathsea version 6.2.1dev
EXIF Metadata provided by EXIF.tools

Navigation menu