annotate_num: Generate colors and ids for numeric annotations

Description Usage Arguments Value

Description

Generate colors and ids for numeric annotations

Usage

1
2
annotate_num(df, col = NULL, base = NULL, scale = "log10",
  na_val = 0, colorset = c("darkblue", "white", "red"))

Arguments

df

data frame to annotate

col

name of the numeric column to annotate

base

base name for the annotation, which wil be used in the desc table. If not provided, will use col as base.

scale

The scale to use for assigning colors. Options are "linear","log10","log2, and "zscore"

na_val

The value to use to replace NAs. default = 0.

colorset

A vector of colors to use for the color gradient. default = c("darkblue","white","red")

Value

A modified data frame: the annotated column will be renamed base_label, and base_id and base_color columns will be appended


AllenInstitute/scrattch.io documentation built on Nov. 17, 2021, 10:06 a.m.