Make boxplot and show expression or score level of signature across subsets.

sig_boxplot(
  data,
  sigs,
  group_col,
  target_group,
  type = c("score", "expression"),
  method = "t.test",
  slot = "counts",
  gene_id = "SYMBOL"
)

# S4 method for matrix,vector,vector,character
sig_boxplot(
  data,
  sigs,
  group_col,
  target_group,
  type = c("score", "expression"),
  method = "t.test",
  gene_id = "SYMBOL"
)

# S4 method for Matrix,vector,vector,character
sig_boxplot(
  data,
  sigs,
  group_col,
  target_group,
  type = c("score", "expression"),
  method = "t.test",
  gene_id = "SYMBOL"
)

# S4 method for data.frame,vector,vector,character
sig_boxplot(
  data,
  sigs,
  group_col,
  target_group,
  type = c("score", "expression"),
  method = "t.test",
  gene_id = "SYMBOL"
)

# S4 method for DGEList,vector,character,character
sig_boxplot(
  data,
  sigs,
  group_col,
  target_group,
  type = c("score", "expression"),
  method = "t.test",
  slot = "counts",
  gene_id = "SYMBOL"
)

# S4 method for ExpressionSet,vector,character,character
sig_boxplot(
  data,
  sigs,
  group_col,
  target_group,
  type = c("score", "expression"),
  method = "t.test",
  gene_id = "SYMBOL"
)

# S4 method for Seurat,vector,character,character
sig_boxplot(
  data,
  sigs,
  group_col,
  target_group,
  type = c("score", "expression"),
  method = "t.test",
  slot = "counts",
  gene_id = "SYMBOL"
)

# S4 method for SummarizedExperiment,vector,character,character
sig_boxplot(
  data,
  sigs,
  group_col,
  target_group,
  type = c("score", "expression"),
  method = "t.test",
  slot = "counts",
  gene_id = "SYMBOL"
)

# S4 method for list,vector,character,character
sig_boxplot(
  data,
  sigs,
  group_col,
  target_group,
  type = c("score", "expression"),
  method = "t.test",
  slot = "counts",
  gene_id = "SYMBOL"
)

Arguments

data

expression data, can be matrix, DGEList, eSet, seurat, sce...

sigs

a vector of signature (Symbols)

group_col

character or vector, specify the column name to compare in coldata

target_group

pattern, specify the group of interest as reference

type

one of "score" and "expression", to plot score or expression of the signature

method

a character string indicating which method to be used for stat_compare_means() to compare the means across groups, could be "t.test", 'wilcox.test', 'anova'..., default "t.test"

slot

character, indicate which slot used as expression, optional

gene_id

character, indicate the ID type of rowname of expression data's , could be one of 'ENSEMBL', 'SYMBOL', ... default 'SYMBOL'

Value

patchwork or ggplot of boxplot

Examples

data("im_data_6", "nk_markers")
p <- sig_boxplot(
  im_data_6,
  sigs = nk_markers$HGNC_Symbol[1:30],
  group_col = "celltype:ch1", target_group = "NK",
  gene_id = "ENSEMBL"
)
#> 'select()' returned 1:many mapping between keys and columns
#> Warning: 2 genes missing: ENSG00000275302, ENSG00000271503