Skip to contents

Compare two signature catalogues by overlaying one over the other

Usage

sig_visualise_compare(
  catalogue1,
  catalogue2,
  compare = c("count", "fraction"),
  names = c("Sample 1", "Sample 2"),
  channel_order = "auto",
  palette = "auto",
  na.value = "grey",
  subtitle = NULL,
  title = NULL,
  options = vis_options()
)

Arguments

catalogue1, catalogue2

a sigverse catalogue (tally) representing an observed mutational profile (data.frame)

compare

what metric to compare (counts or fractions)

names

a 2 element character vector describing the names that should be used to describe catalogue 1 and 2 retrospectively.

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

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.

na.value

colour to use when type = NA

subtitle

plot subtitle

title

plot title

options

other visualisation options. See vis_options() for details

Value

a ggplot object.

Examples

library(sigstats) # For combining signature models
library(TCGAcatalogues) # For pulling example TCGA catalogue data

# Load a catalogue collection (Tally of variant types)
catalogues <- catalogues_load("BRCA", type = "SBS_96")

# Get catalogue of 2 different samples
sample1 = "TCGA-OL-A6VQ-01A-12D-A41F-09"
sample2 = "TCGA-OL-A97C-01A-32D-A41F-09"
catalogue_sample1 <- catalogues[[sample1]]
catalogue_sample2 <- catalogues[[sample2]]


# Compare the two catalogues
ggcompare <- sig_visualise_compare(
  catalogue1 = catalogue_sample1,
  catalogue2 = catalogue_sample2
)
#>  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 interactive
sig_make_interactive(ggcompare)