View source: R/mapSignatureSets.R
mapSignatureSets | R Documentation |
'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).
mapSignatureSets(fromSignatures, toSignatures, method="euclidean", unique=FALSE)
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 |
(Mandatory) The set (list) of signatures to which the
set of |
method |
(Optional) The distance measure to be used. This can be one
of the following: |
unique |
(Optional) If set to |
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 vector having as elements the mapped signatures of
toSignatures
, and as names the signatures of fromSignatures
with which they have been associated.
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
determineSignatureDistances
### 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.1, 0.3, 0.25, 0.2, 0.25, 0, 0, 0.3, 0.2, 0.2, 0.3, 0, 0 ), nrow=3, byrow=TRUE) test3 <- matrix(c( 0.1, 0.7, 0.2, 0, 0, 0, 0, 0, 0, 1.0, 0, 0, 0.5, 0.1, 0, 0.4, 0, 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.