fancy_proportions_plot.Rd
This function takes all the available proportional quality control metrics and a vector of sample IDs (plotted on the x-ais) and plots the vlaues along the y-axis.
This function provides straightforward subsetting parameters allowing for a straightforward execution.
Either provide a data frame with sample IDs in the first column to the these_samples_ids
parameter.
Or, call one of the optional parameters for using an already subset metadata table (subset to the sample IDs of interest).
If these_samples_ids
and these_samples_metadata
is not provided, the user can subset al GAMBL samples on the fly with keep_cohort
and/or keep_pathology
.
This function also provides parameters for easy customization of the plot aesthetics. For example, the subtitle of the plot can easily be controlled with the plot_subtitle
parameter.
For usage examples and more information, refer to the parameter descriptions and examples in the fancy vignette.
fancy_proportions_plot(
these_sample_ids,
metadata,
these_samples_metadata,
keep_cohort,
keep_pathology,
seq_type = "genome",
plot_subtitle = ""
)
Data frame with sample IDs (to be plotted) in the first column.
Optional, user can provide a metadata df to subset sample IDs from.
GAMBL metadata subset to the cases you want to process.
Optional parameter to be used when these_sample is NULL. Calls get_gambl_metadata and filters on the cohort supplied in this parameter.
Optional parameter to be used when these_sample is NULL. Calls get_gambl_metadata and filters on the pathology supplied in this parameter.
Selected seq type for incoming QC metrics.
Plotting parameter, subtitle of generated plot.
A plot as a ggplot object (grob).
Visualize proportional metrics for selected samples.
#Example 1 - using these_sample_ids parameter
#subset on FL cases with QC metrics available and plot
metadata = get_gambl_metadata() %>%
kridel_fl = dplyr::filter(metadata, pathology == "FL",
cohort == "FL_Kridel")
#> Error in get_gambl_metadata() %>% kridel_fl = dplyr::filter(metadata, pathology == "FL", cohort == "FL_Kridel"): invalid (NULL) left side of assignment
kridel_fl_samples = dplyr::select(kridel_fl, sample_id)
#> Error in dplyr::select(kridel_fl, sample_id): object 'kridel_fl' not found
fancy_proportions_plot(these_sample_ids = kridel_fl_samples)
#> /projects/nhl_meta_analysis_scratch/gambl/results_local/shared/gambl_genome_results.tsv
#> Error in dplyr::filter(., sample_id %in% sample_table$sample_id): ℹ In argument: `sample_id %in% sample_table$sample_id`.
#> Caused by error in `h()`:
#> ! error in evaluating the argument 'table' in selecting a method for function '%in%': object 'kridel_fl_samples' not found
#Example 2 - using already filtered metadata (these_samples_metadata)
fancy_proportions_plot(these_samples_metadata = kridel_fl)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'as.data.frame': object 'kridel_fl' not found
#Example 3 - using in-house metadata filtering options
fancy_proportions_plot(keep_cohort = "FL_Kridel",
keep_pathology = "FL")
#> /projects/nhl_meta_analysis_scratch/gambl/results_local/shared/gambl_genome_results.tsv
#> QC Metric successfully retreived for 56 samples out of a total of 56 samples in input sample table.