dend_anno_barplot

dend_anno_barplot(
  anno,
  dend,
  section_wedges = NULL,
  bar_variables = NULL,
  nr_hist = TRUE,
  panel_width = 0.2
)

Arguments

anno

Sample annotations. The first column should be sample_name, and each annotation should have \_id, \_label, and \_color columns. Requires cluster_id which needs to be sequential in order of the dendrogram.

dend

Dendrogram object.

section_wedges

Default is NULL. Use annotation to separate Can be used to generate lines between sections to divide leaves of dendrogram, e.g. separating subclass, class.

bar_variables

base name of variables to be represented as bargraphs below dendrogram. Annotation variables need to be represented as \_id, \_label, \_color in anno.

nr_hist

plotting of cluster size below dend. Default is TRUE.

return_type

What values to return - can be "plot", "data", or "both". Default is "plot".

Examples

# First, load the example data
load("data/dend_anno_example/dend.rda")
#> Warning: cannot open compressed file 'data/dend_anno_example/dend.rda', probable reason 'No such file or directory'
#> Error in readChar(con, 5L, useBytes = TRUE): cannot open the connection
load("data/dend_anno_example/anno.df.rda")
#> Warning: cannot open compressed file 'data/dend_anno_example/anno.df.rda', probable reason 'No such file or directory'
#> Error in readChar(con, 5L, useBytes = TRUE): cannot open the connection

# Then, run the function with the loaded data
dend.plot <- dend_anno_barplot(
  anno = anno.df,
  dend = dend,
  section_wedges = "class",
  bar_variables = c("sex", "batch"),
  nr_hist = TRUE
)
#> Error in dend_anno_barplot(anno = anno.df, dend = dend, section_wedges = "class",     bar_variables = c("sex", "batch"), nr_hist = TRUE): object 'anno.df' not found