Pretty mutual exclusivity plot
pretty_mutual_exclusivity.Rd
Pretty mutual exclusivity plot
Usage
pretty_mutual_exclusivity(
maf_data,
mut_mat,
cn_mat,
corr_mat,
p_mat,
min_mutation_percent = 2,
genes,
these_samples_metadata,
q_threshold = 0.05,
drop_positive_correlations = FALSE,
exclude_insignificant_genes = TRUE,
engine = "ggcorrplot",
font_size = 7,
use_alpha = FALSE,
clustering_distance = "binary",
gene_anno_df,
size_factor = 0.01,
split,
return_data = FALSE,
include_silent = FALSE,
include_hotspots = FALSE,
review_hotspots = FALSE,
bonferroni = FALSE,
verbose = FALSE,
metadataBarHeight = 3,
metadataBarFontsize = 4,
legend_direction = "horizontal",
annotate_by_pathology = TRUE,
show_heatmap_legend = TRUE,
cut_k,
width = 10
)
Examples
suppressMessages(library(GAMBLR.open))
suppressMessages(library(ComplexHeatmap))
bl_fl_dlbcl_meta = get_gambl_metadata() %>%
dplyr::filter(pathology %in% c("DLBCL","FL","BL"), seq_type != "mrna") %>%
check_and_clean_metadata(.,duplicate_action="keep_first")
#> Using the bundled metadata in GAMBLR.data...
#> Duplicate rows (keeping first occurrence) for 'sample_id' and 'seq_type' have been dropped.
dlbcl_meta = dplyr::filter(bl_fl_dlbcl_meta,pathology=="DLBCL") %>%
check_and_clean_metadata(.,duplicate_action="keep_first")
all_coding <- get_all_coding_ssm(bl_fl_dlbcl_meta)
if (FALSE) { # \dontrun{
lymphgens = get_lymphgen(flavour = "no_cnvs.no_sv.with_A53")
lg_feats = lymphgens$feature_annotation
lg_genes = unique(lg_feats$Feature)
pretty_mutual_exclusivity(
maf_data = all_coding,
genes = lg_genes,
these = dlbcl_meta,
size_factor = 0.007,
engine = "ComplexHeatmap",
font_size = 6,
use_alpha = FALSE,
clustering_distance = "binary",
include_hotspots = TRUE)
} # }
fl_bl_dlbcl_genes = dplyr::filter(GAMBLR.data::lymphoma_genes,
FL_Tier == 1 | BL_Tier == 1 | DLBCL_Tier ==1) %>%
pull(Gene)
# because the first steps of this are slow we can
# store the output matrix as a shortcut for subsequent runs
suppressWarnings(
suppressMessages({
outs = pretty_mutual_exclusivity(
maf_data = all_coding,
genes = fl_bl_dlbcl_genes,
these = bl_fl_dlbcl_meta,
engine = "ComplexHeatmap",
font_size = 5,
use_alpha = TRUE,
clustering_distance = "binary",
include_hotspots = FALSE,
return_data = TRUE
)
draw(outs$plot)
}))
suppressWarnings(
suppressMessages({
pretty_mutual_exclusivity(
mut_mat=outs$mut_mat,
corr_mat = outs$corr_mat,
p_mat = outs$p_mat,
maf_data = all_coding,
genes = fl_bl_dlbcl_genes,
these = bl_fl_dlbcl_meta,
engine = "ComplexHeatmap",
font_size = 5,
use_alpha = TRUE,
size_factor = 0.004,
clustering_distance = "euclidean",
include_hotspots = FALSE
)
}))
suppressWarnings(
suppressMessages({
pretty_mutual_exclusivity(
p_mat = outs$p_mat,
maf_data = all_coding,
genes = fl_bl_dlbcl_genes,
these = dlbcl_meta,
engine = "ComplexHeatmap",
font_size = 5,
use_alpha = TRUE,
size_factor = 0.004,
clustering_distance = "euclidean",
legend_direction = "vertical",
include_hotspots = FALSE)
}))