Description Usage Arguments Value Examples
View source: R/sigfit_utility.R
convert_signatures
converts mutational signatures between two representations relative to
different sets of mutational opportunities.
1 2 3 4 5 | convert_signatures(
signatures,
opportunities_from = NULL,
opportunities_to = NULL
)
|
signatures |
Either a numeric matrix of mutational signatures, with one row per signature
and one column per mutation type, or a list of matrices generated via |
opportunities_from |
Mutational opportunities that are currently imposed on the signatures.
This can be a numeric vector of mutational opportunities, with one element per mutation type.
Character values |
opportunities_to |
Mutational opportunities that are to be imposed on the signatures.
Admits the same values as |
A numeric matrix of transformed signatures with the same dimensions as signatures
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # Load COSMIC signatures
# (these are relative to the human genome mutational opportunities)
data("cosmic_signatures_v2")
# Plot COSMIC signature 1
barplot(cosmic_signatures_v2[1,])
# Convert signatures from genome-relative to exome-relative representation
exome_sigs <- convert_signatures(cosmic_signatures_v2,
opportunities_from = "human-genome",
opportunities_to = "human-exome")
barplot(exome_sigs[1,])
# Normalise signatures to a sequence-independent representation
normalised_sigs <- convert_signatures(cosmic_signatures_v2,
opportunities_from = "human-genome",
opportunities_to = NULL)
barplot(normalised_sigs[1,])
# Convert back to genome-relative opportunities
genome_sigs <- convert_signatures(normalised_sigs,
opportunities_from = NULL,
opportunities_to = "human-genome")
barplot(genome_sigs[1,])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.