determineSignatureDistances {decompTumor2Sig} | R Documentation

## 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"` | Forbenius distance between real-valued matrices
| (or Shiraishi signatures) `A` and `B`:
| `F = sqrt(trace( (A-B) %*% t(A-B) ))`
`"rss"` | Residual sum of squares (i.e., squared error):
| `rss = sum((A-B)^2)`
`"euclidean"` | (see `?dist` for details)
`"maximum"` | (see `?dist` for details)
`"manhattan"` | (see `?dist` for details)
`"canberra"` | (see `?dist` for details)
`"binary"` | (see `?dist` for details)
`"minkowski"` | (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: <rmpiro@gmail.com> or <r.piro@fu-berlin.de>

### 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")

[Package decompTumor2Sig version 2.0.0 Index]