Visualises Signatures. The order channels are displayed are based on the order they appear in the signature data.frame
Usage
sig_visualise(
signature,
class = c("signature", "catalogue", "model"),
title = NULL,
subtitle = NULL,
palette = "auto",
channel_order = "auto",
na.value = "grey",
options = vis_options()
)
Arguments
- signature
a sigverse style signature data.frame. See
sigshared::example_signature()
.- class
type of input signature. Is it a signature (e.g. from sigstash database), a catalogue (e.g. from TCGAcatalogues or a signature analysis), or a model (combination of signatures designed to approximate an observed mutational profile)
- title
plot title
- subtitle
plot subtitle
- palette
colours based on the 'type' column. By default 'auto' will automatically pick a palette if the values of the 'type' column matches COSMIC SBS, Doublet or Indel mutations. Otherwise should be a named vector where names = types and values are colours.
- channel_order
How channels should be ordered on the X axis. By default 'auto' will automatically pick palette if channels are recognised as a standard COSMIC SBS/DBS/INDEL signature, or if not sorts in alphabetical order. Can also be a vector of channels in the order they should appear
- na.value
colour to use when type = NA
- options
other visualisation options. See
vis_options()
for details
Details
If the channels match a known channel type, channel display order will instead be based on a predefined order
Examples
library(sigstash)
library(sigstats)
library(TCGAcatalogues)
# Load Signature
signatures <- sig_load('COSMIC_v3.3.1_SBS_GRCh38')
# Visualise a single signature
sig_visualise(signatures[["SBS2"]])
#> ✔ All channels matched perfectly to set [sbs_96]. Using this set for sort order
#> ✔ All types matched perfectly to set [sbs_type]. Using this set for sort order
#> ✔ Types matched perfectly to palette [snv_type]
# Visualise a catalogue
brca_catalogues <- catalogues_load('BRCA')
sig_visualise(brca_catalogues[["TCGA-3C-AALI-01A-11D-A41F-09"]], class = 'catalogue')
#> ✔ All channels matched perfectly to set [sbs_96]. Using this set for sort order
#> ✔ All types matched perfectly to set [sbs_type]. Using this set for sort order
#> ✔ Types matched perfectly to palette [snv_type]
# Visualise a model (combination of signatures
model <- sig_combine(signatures, model = c('SBS2' = 0.5, 'SBS13' = 0.5), format = "combined")
sig_visualise(model, class = 'model')
#> ✔ All channels matched perfectly to set [sbs_96]. Using this set for sort order
#> ✔ All types matched perfectly to set [sbs_type]. Using this set for sort order
#> ✔ Types matched perfectly to palette [snv_type]
# Make Visualisations Interactive
gg = sig_visualise(model, class = 'model')
#> ✔ All channels matched perfectly to set [sbs_96]. Using this set for sort order
#> ✔ All types matched perfectly to set [sbs_type]. Using this set for sort order
#> ✔ Types matched perfectly to palette [snv_type]
sig_make_interactive(gg)