Plot Alignment Metrics
fancy_alignment_plot.Rd
Visualize (stacked barplot) genomic read-subsets (metrics) across a selection of samples.
Usage
fancy_alignment_plot(
these_sample_ids,
metadata,
these_samples_metadata,
comparison_group,
seq_type = "genome",
add_mean = TRUE,
add_corrected_coverage = TRUE,
keep_cohort,
keep_pathology,
this_color_palette = c(TotalReads = "#3D405B", TotalUniquelyMapped = "#81B29A",
TotalDuplicatedreads = "#E07A5F"),
plot_sub = ""
)
Arguments
- these_sample_ids
Data frame with sample IDs (to be plotted) in the first column.
- metadata
Optional argument, used to derive sample IDs if sample_table is Null.
- these_samples_metadata
GAMBL metadata subset to the cases you want to process.
- comparison_group
Optional argument for plotting mean alignment metrics. Default is plotting the mean for samples provided. This parameter takes a vector of sample IDs.
- seq_type
Subset qc metrics to a specific seq_type, default is genome.
- add_mean
Set to TRUE to superimpose mean values of plotted variables. Default is TRUE.
- add_corrected_coverage
Set to TRUE to add corrected coverage for selected samples.
- keep_cohort
If no df with sample IDs is supplied (these_sample_ids = NULL) the function returns metadata and subsets on selected cohorts.
- keep_pathology
If no df with sample IDs is supplied (these_sample_ids = NULL) the function returns metadata and subsets on selected pathology.
- this_color_palette
Optional parameter that holds the selected colours for the plotted bars.
- plot_sub
Optional parameter, add a subtitle to the alignment metric plot.
Details
This function is available for plotting relevant alignment metrics (read-subsets) for a selection of samples. Per default, this plot returns the following read-metrics; total n reads, total n uniquely mapped reads, total n duplicated reads. This plot can also be superimposed with read metrics from additional samples, allowing for easy comparisons between different sample populations. To run this function, simply specify the sample IDs you are interested in with `these_sample_ids`. This parameter expects a data frame with sample IDs in the first column. Optionally, the user can also provide an already subset (with the sample IDS of interest) metadata table with `these_samples_metadata`. For adding a comparison group to the returned plot, simply give another cohort/set of samples to the `comparison_group` parameter. Similarly to `these_sample_ids`, this parameter also expects a data frame with sample IDs in the first column. In addition, this plot can also add additional read-metrics such as mean values for all plotted metrics and corrected coverage. To enable these features, simply set `add_mean` and `add_corrected_coverage` to TRUE (default).
Examples
#load packages
if (FALSE) { # \dontrun{
library(dplyr)
library(GAMBLR.data)
#get sample IDs for available genome samples
genome_collated = collate_results(seq_type_filter = "genome") %>%
pull(sample_id)
#subset the collated samples on BL samples
my_samples = get_gambl_metadata() %>%
dplyr::filter(sample_id %in% genome_collated) %>%
dplyr::filter(pathology == "BL") %>% pull(sample_id)
fancy_alignment_plot(these_sample_ids = my_samples)
} # }