print_color_list: Print color list of color vectors or color functions

print_color_listR Documentation

Description

Print color list of color vectors or color functions

Usage

print_color_list(
  x,
  do_print = TRUE,
  colorized = TRUE,
  digits = 4,
  max_entries = Inf,
  ...
)

Arguments

x

list of character color vectors, or function defined by circlize::colorRamp2() which encodes rgb colors and breaks in attributes "colors" and "breaks" respectively.

do_print

logical indicating whether to print output. The list is returned invisibly.

colorized

logical indicating whether to print output using jamba::printDebug() with colorized output.

digits

numeric number of digits, passed to signif() to limit the number of digits displayed as a label for color function entries in x.

max_entries

numeric maximum number of entries displayed in any given element of x.

...

additional arguments are ignored.

Value

list named by names(x) of the input data, each element contains a character vector of R colors named by respective label. The names are derived either directly from the input color vector, or by the attr(i, "breaks") encoded into the color function by circlize::colorRamp2().

See Also

Other jam color functions: assign_numeric_colors(), design2colors(), df_to_numcolors(), mean_hue(), quick_complement_color()

Examples

# generate example data.frame of annotations
n <- 100;
set.seed(12);
anno_df <- data.frame(
   group=sample(c("A", "B", "B"),
      size=n,
      replace=TRUE),
   tss_score=rnorm(n) + 4,
   h3k4me1_score=rnorm(n) + 4
);

# generate a list of colors for the data.frame
scl <- design2colors(anno_df,
   group_colnames="group",
   color_sub=c(tss_score="royalblue",
      h3k4me1_score="slateblue"),
   plot_type="none")

# print the list of colors, color functions, in colorized text
print_color_list(scl)


jmw86069/platjam documentation built on Sept. 26, 2024, 3:31 p.m.