selectColors: Map a distribution to a color scheme

View source: R/segmenTools.R

selectColorsR Documentation

Map a distribution to a color scheme

Description

Returns a list containing colors and breaks, to be used in image plots, and the cut data and colors for each datum. Note that the function is specifically used for color scheme selection in the genomeBrowser project.

Usage

selectColors(
  x,
  mn,
  mx,
  q = 0.1,
  colf = grDevices::gray.colors,
  reverse = FALSE,
  n = 100,
  plot = TRUE,
  xlab = "score",
  xlim,
  heights = c(0.75, 0.25),
  mai = c(0.75, 0.75, 0.1, 0.1),
  ylim,
  legendf,
  ...
)

Arguments

x

data vector

mn

minimal value to cut data at, if missing quantile will be used with parameter q or q[1]

mx

maximal value to cut data at, if missing the quantile q[2] or, if only one q is provided, 1-q[1] will be used

q

parameter probs for quantile selection of mn/mx data cuts, here a single value or two values; see mn and mx arguments

colf

color map function used to create a color gradient, eg. gray.colors or viridis

reverse

revert color order

n

number of colors, first argument to colf

plot

plot a legend, ie. a histogram of the full data and an image of the color scheme below

xlab

x-axis label to use in legend plot

xlim

optional limits to x-axis

heights

relative heights of histogram and image plots

mai

par("mai") plot parameter for plot margins

ylim

y-axis limits for histogram

legendf

legend plot function, called after the upper distribution plot, can be used to add a legend

...

further arguments to colf, e.g. start and end in gray.colors


raim/segmenTools documentation built on May 5, 2024, 11:30 a.m.