prettyCoOncoplot returns ggplot-compatible figure of 2 prettyOncoplot side-by-side.

prettyCoOncoplot(
  maf,
  metadata,
  comparison_column,
  comparison_values,
  label1,
  label2,
  ...
)

Arguments

maf

Required argument. A maftools object containing the mutations you want to plot on both oncoplots.

metadata

Required argument. A data.frame with metadata for both oncoplots.

comparison_column

Required: the name of the metadata column containing the comparison values.

comparison_values

Optional: If the comparison column contains more than two values or is not a factor, specify a character vector of length two in the order you would like the factor levels to be set, reference group first.

label1

Optional argument. Label to be shown as a title for the oncoplot #1.

label2

Optional argument. Label to be shown as a title for the oncoplot #2.

...

prettyOncoplot arguments, see that function for more info on avaialble parameters.

Value

A ggplot object with 2 oncoplots side-by-side.

Details

This function will generate a graphic displaying 2 oncoplots side-by-side. Optionally user can annotate each oncoplot with it's own title that will be displayed at the top. All the arguments recognized by prettyOncoplot are supported and can be specified when calling this function. For both oncoplots the same specified parameters will be applied (e.g. genes to display, split columns, font size, top annotation etc). If the provided argument is not recognized by prettyOncoplot, it will be discarded. If you want a specific order of oncoplots on the left and right, please ensure the argument comparison_column is a factor with first level being the group you want to be plotted on the left side. For developers: new arguments added to prettyOncoplot in the future are expected to be out-of-the-box compatible with this function nd would not need code modifications.

Examples

#get data for plotting
ssm = get_coding_ssm(limit_cohort = c("BL_Adult", "BL_Pediatric"), seq_type = "genome")
#> reading from: /projects/nhl_meta_analysis_scratch/gambl/results_local/all_the_things/slms_3-1.0_vcf2maf-1.3/genome--projection/deblacklisted/augmented_maf/all_slms-3--grch37.CDS.maf
#> mutations from 1652 samples
#> after linking with metadata, we have mutations from 219 samples
ssm = maftools::read.maf(ssm)
#> -Validating
#> -Silent variants: 10604 
#> -Summarizing
#> -Processing clinical data
#> --Missing clinical data
#> -Finished in 3.529s elapsed (9.005s cpu) 
meta = get_gambl_metadata()
meta = dplyr::filter(meta, cohort %in% c("BL_Adult", "BL_Pediatric"))

#build plot
prettyCoOncoplot(maf = ssm,
                 metadata = meta,
                 comparison_column = "cohort",
                 include_noncoding = NULL,
                 minMutationPercent = 0,
                 genes = c("MYC",
                           "TET2",
                           "TP53",
                           "DDX3X",
                           "ID3"),
                 metadataColumns = c("pathology",
                                     "EBV_status_inf",
                                     "pairing_status",
                                     "cohort"),
                 splitColumnName = "EBV_status_inf",
                 metadataBarHeight = 10,
                 fontSizeGene = 12,
                 metadataBarFontsize = 10,
                 legend_row = 2,
                 label1 = "Adult",
                 label2 = "Pediatric")
#> -Processing clinical data
#> --Possible FLAGS among top ten genes:
#>   TTN
#> -Processing clinical data
#> [1] "numcases: 124"
#> [1] "numgenes: 5"
#> Error in gpar(fontsize = legendFontSize): could not find function "gpar"