Learn R Programming

sigminer (version 0.1.11)

draw_subtypes_comparison: Plot comparison between signature subtypes

Description

Using result data from sig_summarize_subtypes function, this function plot genotypes/phenotypes comparison between signature subtypes using ggplot2 package and return a list of ggplot object contains individual and combined plots. The combined plot is easily saved to local using cowplot::save_plot().

Usage

draw_subtypes_comparison(subtype_summary, xlab = "subtype",
  ylab_co = NA, legend_title_ca = NA, show_pvalue = TRUE, ...)

Arguments

subtype_summary

a list from result of sig_summarize_subtypes function.

xlab

lab name of x axis for all plots.

ylab_co

lab name of y axis for plots of continuous type data. Of note, this argument should be a character vector has same length as subtype_summary, the location for categorical type data should mark with NA.

legend_title_ca

legend title for plots of categorical type data. Of note, this argument should be a character vector has same length as subtype_summary, the location for continuous type data should mark with NA.

show_pvalue

if TRUE, show p value for comparison of continuous data types.

...

other paramters pass to ggpubr::stat_compare_means().

Value

a list of ggplot objects.

See Also

Other signature plot: draw_sig_activity, draw_sig_corrplot, draw_sig_profile

Examples

Run this code
# NOT RUN {
# Load copy number signature
load(system.file("extdata", "toy_copynumber_signature.RData",
  package = "sigminer", mustWork = TRUE
))
# Assign samples to clusters
subtypes <- sig_assign_samples(res$nmfObj, type = "samples")

set.seed(1234)
# Add custom groups
subtypes$new_group <- sample(c("1", "2", "3", "4"), size = nrow(subtypes), replace = TRUE)
# Summarize subtypes
subtypes.sum <- sig_summarize_subtypes(subtypes[, -1],
  col_subtype = "nmf_subtypes",
  cols_to_summary = colnames(subtypes[, -1])[c(-1, -2)],
  type = c("co", "ca"), verbose = TRUE
)
draw_subtypes_comparison(subtypes.sum)
# }

Run the code above in your browser using DataLab