# Load packages
+library(GAMBLR.data)
+library(GAMBLR.viz)
+library(dplyr)
Tutorial: The prettiest forestplot
+One of the integral parts of this package is the analysis and display of the differences in the frequency of mutations for two different groups in a given cohort. Because it is easy to use, conducts flexible comparisons, and generates easy-to-follow display items, it is called prettyForestPlot
and it belongs to the pretty
family of GAMBLR.viz functions. There is no specific formatting or data preparation needed for the analysis and visualization, and the only required inputs are the mutation data (can be maf format or binary feature matrix), metadata (containing sample identifiers in sample_id
column and annotation of the group that will be used in comparison), and a character of the column name in metadata where the sample annotations are specified. This tutorial will demonstate the example of the inputs and showcase the main features of this function.
Prepare setup
+We will first import the necessary packages:
+Next, we will get some data to display. The metadata is expected to be a data frame with one required column: sample_id
and another column that will contain sample annotations according to the comparison group. In this example, we will use as example the data set and variant calls from the study that identified genetic subgroup of Burkitt lymphoma (BL).
<- get_gambl_metadata() %>%
+ metadata filter(cohort == "BL_Thomas")
Next, we will obtain the coding mutations that will be used in the plotting. The data is a data frame in a standartized maf format.
+<- get_ssm_by_samples(
+ maf these_samples_metadata = metadata,
+ tool_name = "publication",
+ projection = "hg38"
+
+ )
+# How does it look like?
+dim(maf)
[1] 47043 45
+head(maf) %>%
+select(
+
+ Tumor_Sample_Barcode,
+ Hugo_Symbol,
+ Variant_Classification )
Tumor_Sample_Barcode Hugo_Symbol Variant_Classification
+1: Akata CPTP Missense_Mutation
+2: Akata FNDC10 Missense_Mutation
+3: Akata MORN1 Missense_Mutation
+4: Akata MEGF6 Missense_Mutation
+5: Akata NPHP4 Silent
+6: Akata GPR157 Missense_Mutation
+For the purpose of this tutorial, we will focus on a small subset of genes known to be significantly mutated in BL.
+<- lymphoma_genes_bl_v_latest$Gene
+ genes head(genes)
[1] "ALPK2" "ARHGEF1" "ARID1A" "B2M" "BACH2" "BCL10"
+Now we have our metadata and mutations we want to explore, so we are ready to start visualizing the data.
+The default forest plot
+The forest plot is ready to be called with the default parameters after just providing the metadata and data frame with mutations in standard maf format. Here is an example of the output with all default parameters:
+<- "EBV_status_inf" # character of column name for comparison
+ comparison_column <- prettyForestPlot(
+ fp metadata = metadata,
+ maf = maf,
+ genes = genes,
+ comparison_column = comparison_column
+ )