convertPvalueToColorIndex: Convert P-values to color index...

Description Usage Arguments Details Value Examples

View source: R/plot-colour.R

Description

Convert P-values to color index

Usage

1
convertPvalueToColorIndex(p.vals, scale="auto", max.color.index, minimal.p.value=1e-04)

Arguments

p.vals

the P-values (after any multiple testing correction)

scale

the color is calculated liked -log10( p.value) * scale, thus scale is used to scale the -log10 to the desired range. Either a number or "auto" for automatic

max.color.index

the maximal color index to return

minimal.p.value

the minimal P-value we accept (since from Monte Carlo we can get 0)

Details

Convert p values to a color index to color nodes in a graph. The P-values are fit into a range from 1 to max.color.index by applying a scale. Before fitting, P-value are transformed by taking a log10, and a minimal P-value is needed to avoid -Inf results for very small P-values. Scale can either be a number or "auto" in which case color coding is such that all P-values fit into the range.

Value

a list with following elements: col - the color indexes, zlim - the actual scale range (in log10) over the colors

Examples

1
2
# scale the P values into the log10 space of [1e-3,1] represented by max 6 colours
convertPvalueToColorIndex(c(0.01, 0.2, 0.3), scale="auto", max.color.index=6, minimal.p.value=1e-3)

ddgraph documentation built on Nov. 17, 2017, 10:50 a.m.