Skip to contents

Visualizing variant (SSM or SVs) counts per chromosome.

Usage

fancy_v_chrcount(
  this_sample_id,
  maf_data,
  maf_path = NULL,
  ssm = TRUE,
  projection = "grch37",
  min_vaf = 0,
  variant_type_col = 10,
  chromosome_col = 5,
  plot_title = paste0(this_sample_id),
  y_interval = 1,
  hide_legend = FALSE,
  plot_subtitle = "Variant Count Distribution Per Chromosome",
  chr_select = paste0("chr", c(1:22)),
  add_qc_metric = FALSE,
  this_seq_type = "genome"
)

Arguments

this_sample_id

Sample to be plotted.

maf_data

Optional parameter with maf like df already loaded into R.

maf_path

Optional parameter with path to external maf like file.

ssm

Set to FALSE to get plotting data from [GAMBLR::get_combined_sv] (SVs). Default value is TRUE (plots SSM retrieved from annotate_cn_by_ssm$maf)

projection

Genome build for returned variants (only applicable for ssm = FALSE)

min_vaf

The minimum tumour VAF for a SV to be returned. Recommended: 0 (only applicable for ssm = FALSE).

variant_type_col

Index of column holding Variant Type (to be used with either maf_data or maf_path).

chromosome_col

Index of column holding Chromosome (to be used with either maf_data or maf_path).

plot_title

Title of plot (default to sample ID).

y_interval

Optional parameter for specifying intervals on y-axis.

hide_legend

Set to True to remove legend from plot, default is FALSE.

plot_subtitle

Subtitle for created plot.

chr_select

vector of chromosomes to be included in plot, defaults to autosomes.

add_qc_metric

Boolean statement, if set to TRUE specified QC metric will be added (second y-axis).

this_seq_type

Default is "genome".

Value

A plot as a ggplot object (grob).

Details

Takes a maf data frame (or path to a maf), counts the number of variants per chromosome. Selected chromosomes (`chr_select`) are plotted along the x-axis and the variant counts are represented on the y-axis. This function can plot both Structural Variants (SV) and Simple Shared Motifs (SSM). It plots SVs per default and SSM can be added with setting `ssm = TRUE`. This plot can also be restricted to only show coding mutations. To do so, set `coding_only` to TRUE. In addition, the returned plot can also be superimposed with a sample-specific mean coverage (from [GAMBLR::collate_results]). To do so, set `add_qc_metric` to TRUE. A collection of parameters for customizing the returned plot are also available. e.g `plot_title`, `y_interval`, `hide_legend`, and `plot_subtitle`.

Examples

if (FALSE) { # \dontrun{

library(GAMBLR.open)

#plot ssm
fancy_v_chrcount(this_sample_id = "DOHH-2",
                 y_interval = 10)
} # }