Skip to contents

Generate sample-level ideogram with copy number information, ssm and gene annotations, etc.

Usage

fancy_ideogram(
  this_sample_id,
  gene_annotation,
  seg_data,
  seg_path = NULL,
  maf_data,
  maf_path = NULL,
  variant_type_col_maf = 10,
  chromosome_col_maf = 5,
  start_col_maf = 6,
  end_col_maf = 7,
  chrom_col_seg = 2,
  start_col_seg = 3,
  end_col_seg = 4,
  cn_col_seg = 7,
  plot_title = paste0(this_sample_id),
  plot_subtitle = "Genome-wide Ideogram (grch37).",
  intersect_regions,
  include_ssm = TRUE,
  ssm_count = TRUE,
  coding_only = FALSE,
  this_seq_type = "genome"
)

Arguments

this_sample_id

Sample to be plotted (for multiple samples, see fancy_multisample_ideogram.

gene_annotation

Annotate ideogram with a set of genes. These genes can either be specified as a vector of characters or a data frame.

seg_data

Optional parameter with copy number df already loaded into R.

seg_path

Optional parameter with path to external seg like file.

maf_data

Optional parameter with maf like df already loaded into R.

maf_path

Optional parameter with path to external maf like file.

variant_type_col_maf

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

chromosome_col_maf

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

start_col_maf

Index of column with variant start coordinates (to be used with either maf_data or maf_path).

end_col_maf

Index of column with variant end coordinates (to be used with either maf_data or maf_path).

chrom_col_seg

Index of column with chromosome annotations (to be used with either maf_data or maf_path).

start_col_seg

Index of column with copy number start coordinates (to be used with either maf_data or maf_path).

end_col_seg

Index of column with copy number end coordinates (to be used with either maf_data or maf_path).

cn_col_seg

Index of column holding copy number information (to be used with either maf_data or maf_path).

plot_title

Title of plot (default to sample ID).

plot_subtitle

Optional argument for plot subtitle.

intersect_regions

Optional parameter for subset variant calls to specific regions. Should be either a vector of characters (chr:start-end) or data frame with regions.

include_ssm

Set to TRUE to plot SSMs (dels and ins).

ssm_count

Optional parameter to summarize n variants per chromosome, inlcude_ssm must be set to TRUE.

coding_only

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

this_seq_type

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

Value

A plot as a ggplot object (grob).

Details

This function generates genome-wide ideograms, visualizing SSM data as well as CN segments. It is also possible to superimpose the plot with gene annotations. Offering a comprehensive overview of all SSM and CN segments of different aneuploidy. The plotting of SSM can be toggled with setting `include_ssm` to TRUE. If so, it is also possible to count the number of SSMs per chromosome with `ssm_count = TRUE`. To get data for plotting, there are a few different options available; like all `fanncy_x_plots` a sample ID can be provided to the `this_sample_id` parameter. If done so, the function will retrieve data (SSm and CN segments) by wrapping the appropriate functions. This data can also be provided with `seg_data`, `seg_path`, `maf_data` and `maf_path`. For more info on how to run with these parameters, refer to the parameter descriptions. In order to annotate the ideogram with genes, simply give the `gene_annotations` parameter a set of genes as a vector of characters or a data frame with gene names in the first column. Another useful parameter for restricting the plotted regions is to call the function with `intersect_regions`. This parameter takes a vector of characters or a data frame with regions that the plotted calls are restricted to.

Examples

#build plot
if (FALSE) { # \dontrun{
fancy_ideogram(this_sample_id = "DOHH-2",
               gene_annotation = "MYC",
               plot_title = "Sample-level Ideogram Example",
               plot_subtitle = "grch37")
} # }