fancy_v_chrcount.Rd
Visualizing variant (SSM or SVs) counts per chromosome.
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)),
coding_only = FALSE,
from_flatfile = TRUE,
use_augmented_maf = TRUE,
add_qc_metric = FALSE,
seq_type = "genome"
)
Sample to be plotted.
Optional parameter with maf like df already loaded into R.
Optional parameter with path to external maf like file.
Set to FALSE to get plotting data from get_combined_sv (SVs). Default value is TRUE (plots SSM retrieved from annotate_cn_by_ssm$maf)
Genome build for returned variants (only applicable for ssm = FALSE)
The minimum tumour VAF for a SV to be returned. Recommended: 0 (only applicable for ssm = FALSE).
Index of column holding Variant Type (to be used with either maf_data or maf_path).
Index of column holding Chromosome (to be used with either maf_data or maf_path).
Title of plot (default to sample ID).
Optional parameter for specifying intervals on y-axis.
Set to True to remove legend from plot, default is FALSE.
Subtitle for created plot.
vector of chromosomes to be included in plot, defaults to autosomes.
Optional. Set to TRUE to restrict to plotting only coding mutations.
If set to true the function will use flat files instead of the database.
Boolean statement if to use augmented maf, default is FALSE.
Boolean statement, if set to TRUE specified QC metric will be added (second y-axis).
Default is "genome".
A plot as a ggplot object (grob).
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 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
.
#plot ssm
fancy_v_chrcount(this_sample_id = "HTMCP-01-06-00422-01A-01D",
ssm = TRUE)
#> trying to find output from: battenberg
#> looking for flatfile: /projects/nhl_meta_analysis_scratch/gambl/results_local/gambl/battenberg_current/99-outputs/seg/genome--projection/HTMCP-01-06-00422-01A-01D--HTMCP-01-06-00422-10A-01D--matched.battenberg.grch37.seg
#> Warning: Removed 2 rows containing missing values (`position_stack()`).
#plot SVs for chr 1-5
fancy_v_chrcount(this_sample_id = "HTMCP-01-06-00422-01A-01D",
ssm = FALSE,
min_vaf = 0,
projection = "grch37",
chr_select = paste0("chr", c(1:5)),
plot_subtitle = "SV Count Distribution (chr1-5)")
#> Warning: number of columns of result is not a multiple of vector length (arg 3)
#> Warning: Removed 18 rows containing missing values (`position_stack()`).