View source: R/determineSignatureDistances.R
determineSignatureDistances | R Documentation |
'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).
determineSignatureDistances(fromSignature, toSignatures, method="euclidean")
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 |
method |
(Optional) The distance measure to be used. This can be one
of the following: |
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) |
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.
Rosario M. Piro
Politecnico di Milano
Maintainer: Rosario
M. Piro
E-Mail: <rmpiro@gmail.com> or <rosariomichael.piro@polimi.it>
http://rmpiro.net/decompTumor2Sig/
Krueger, Piro (2019) decompTumor2Sig: Identification of mutational
signatures active in individual tumors. BMC Bioinformatics
20(Suppl 4):152.
decompTumor2Sig
mapSignatureSets
### 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.