Learn R Programming

sigminer (version 0.1.11)

sig_summarize_subtypes: Get summary of signature subtypes

Description

Summarize genotypes/phenotypes based on signature subtypes. For categorical type, calculate fisher p value (using stats::fisher.test) and count table. For continuous type, calculate anova p value (using stats::aov), summary table and Tukey Honest significant difference (using stats::TukeyHSD). The result of this function can be plotted by draw_subtypes_comparison().

Usage

sig_summarize_subtypes(data, col_subtype, cols_to_summary, type = "ca",
  verbose = FALSE)

Arguments

data

a data.frame contains signature subtypes and genotypes/phenotypes (including categorical and continuous type data) want to analyze. User need to construct this data.frame by him/herself.

col_subtype

column name of signature subtypes.

cols_to_summary

column names of genotypes/phenotypes want to summarize based on subtypes.

type

a characater vector with length same as cols_to_summary, 'ca' for categorical type and 'co' for continuous type.

verbose

if TRUE, print extra information.

Value

a list contains data, summary, p value etc..

See Also

Other signature analysis series function: sig_assign_samples, sig_estimate, sig_extract, sig_get_activity, sig_get_correlation, sig_get_similarity, sig_prepare

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
)
# }

Run the code above in your browser using DataLab