mergeSignature: Creates a new mutational signature by taking a linear...

Description Usage Arguments Value See Also Examples

View source: R/mergeSignature.R

Description

This function creates a new mutational signature by taking a linear combination of k other signatures s11,s12,...,skn located in a matrix of mutational signatures. In order to use this function, a weight vector w1, w2...wk must be specified. The new mutational signature is created by multiplying the component signature values by the corresponding weights. The formula for the entries of the new signature is s11w1+s21w2+...+sk1wk, s12w1+s22w2+...+sk2wk,...s1nw1+s2nw2+...+sknwk. The function returns this new signature plus all of the signatures in the original dataset that were not merged into the new matrix of signatures.

Usage

1
mergeSignature(sigmatrix,sig,weights)

Arguments

sigmatrix

A mutsig object of mutational signatures.

sig

A vector that describes the signatures to be merged.

weights

A vector that describes the relative weights of each of the component signatures in the merged mutational signature.

Value

A new matrix of signatures consisting of the signatures in the original matrix of mutational signatures that were not merged as well as the mutational signature that is a result of merging the input signatures. For example, if there were 10 signatures in the original signature matrix and signatures 1-6 were set to be merged, then the output value would be a matrix of 5 signatures(signature 7,8,9,10 and the result of merging signatures 1-6).

See Also

addSignature, renameSignature and deleteSignature.

Examples

1
2
3
4
weights=rep(1/27,27)      
mergeSignature(signatures.cosmic,1:27,weights)      
weights=rep(1/6,6)  
mergeSignature(signatures.cosmic,1:6,weights)   

sjdlabgroup/MutSigTools documentation built on Oct. 5, 2019, 3:31 a.m.