Create a circos plot visualizing SVS and SSM with optional gene annotations.

fancy_circos_plot(
  this_sample_id,
  gene_list,
  ssm_calls = TRUE,
  sv_calls = TRUE,
  chr_select = paste0("chr", c(1:22)),
  vaf_cutoff = 0,
  coding_only = FALSE,
  from_flatfile = TRUE,
  use_augmented_maf = TRUE,
  projection = "grch37",
  this_seq_type = "genome",
  plot_title = paste0(this_sample_id),
  out,
  pdf = TRUE,
  file_name = paste0(this_sample_id, "_circos.pdf")
)

Arguments

this_sample_id

Sample to be plotted.

gene_list

Optional parameter to annotate genes on the circos plot from a data frame of genes. Is compatible with gene_to_region (return_as = "bed") output format. See examples.

ssm_calls

Boolean parameter for plotting ssm. Default is TRUE.

sv_calls

Boolean parameter for plotting SVs, default is TRUE.

chr_select

Optional argument for subset on selected chromosomes, default is all autosomes.

vaf_cutoff

Threshold for filtering variants on VAF (events with a VAF > cutoff will be retained).

coding_only

Optional. Set to TRUE to restrict to plotting only coding mutations.

from_flatfile

If set to TRUE the function will use flat files instead of the database.

use_augmented_maf

Boolean statement if to use augmented maf, default is TRUE.

projection

Genomic projection for variants and circos plot. Accepted values are grch37 and hg38, default is grch37.

this_seq_type

Seq type for returned CN segments. One of "genome" (default) or "capture".

plot_title

Optional parameter for naming your plot, default is this_sample.

out

Path to output folder, to where the plot will be exported.

pdf

Set to FALSE for png, default is TRUE (pdf).

file_name

Optional parameter for specifying the file name of generated circos plot, default is "this_sample_circos.pdf". If pdf is set to FALSE, a png will be generated, thus the .png extension needs to be attached to the file_name.

Value

Nothing.

Details

This function is using RCircos to create sample-level cirocs plots, annotating SVs and SSM with the potential of adding gene annotations. To control what variants are to be plotted, simply use the two Boolean parameters; ssm_calls and sv_calls (both TRUE by default). Provide the sample ID of interest in with the this_sample_id parameter. This function calls assign_cn_to_ssm and get_combined_sv to retrieve data for plotting. Since this function does not create a grob, but rather outputs a rendered PDF/PNG, the user has to provide an output path with the out parameter. In addition, the user can control the output format. For PDF, set pdf to TRUE (default) and to export the created plot as PNG, set the same parameter to FALSE. This function also has convenient filtering parameters available, see parameter descriptions for more information and how to properly use the filtering parameters. Lastly, this plot can also highlight genes of interest. To do so, provide a data frame (comparable to the return from gene_to_region(return_as = "bed")) to the gene_list parameter.

Examples

if (FALSE) {
#retrieve gene names for FL genes
fl_genes = dplyr::filter(GAMBLR.data::lymphoma_genes_lymphoma_genes_v0.0, FL == TRUE) %>%
  pull(Gene)

# get regions for selected genes
fl_genes_list = gene_to_region(gene_symbol = fl_genes,
                               return_as = "bed")

fancy_circos_plot(this_sample_id = "DOHH-2",
                  ssm_calls = FALSE,
                  gene_list = fl_genes_list,
                  chr_select = c("chr8",
                                 "chr14",
                                 "chr18"),
                  out = "../../plots/",
                  plot_title = "DOHH-2 (SVs) Example Plot",
                  pdf = FALSE,
                  file_name = "dohh2_example.png")
}