metabFigure {bubbleHeatmap}R Documentation

Create Nightingale Figure From Template

Description

Produce a single gTree object representing plots arranged according to the provided Nightingale metabolomics figure template.

Usage

metabFigure(
  data,
  colorValue = "estimate",
  sizeValue = "negLog10P",
  legendHeight = 8,
  context = gpar(cex = 0.8),
  unitBase = unit(0.5, "cm"),
  colorLim = c(NA, NA),
  sizeLim = c(NA, NA)
)

Arguments

data

Nightingale results data merged with the ntngale225 or ntngale249 template.

colorValue

String naming the variable of data containing the values to be plotted on the color scale.

sizeValue

String naming the variable of data containing the values to scale bubble sizes.

legendHeight

Numeric, preferred height of legends in multiples of 0.5cm. This will be supplied to pretty function.

context

gpar object to provide drawing context. Will be applied to the parent viewport in the childrenvp slot of the gTree.

unitBase

unit object indicating the size of one plot grid box.

colorLim, sizeLim

Numeric vectors indicating limits (min/max) outside which the values of color/size matrices should be truncated. NOTE! These data ranges are separate from the scale ranges, which are taken from the min/max values of colorBreaks and sizeBreaks.

Details

Quick function to produce a final Nightingale figure from results data merged with one of the supplied template datasets. This function wraps the functions formatData, multiPlotInput, bubbleHeatmapList and metabFigurePlot applying default settings.

Value

Produces a complete metabolomics figure consisting of 14 bubbleHeatmap blocks in a pre-set layout. Output is not drawn but returned as a gTree object which can be edited or drawn using the grid.draw function. NOTE: A cairo output device with gradient support is necessary to correctly render the color legend.

Examples

myData <- merge_template(cetp, "ckb_id")
metabTree <- metabFigure(myData)
grid.draw(metabTree)


[Package bubbleHeatmap version 0.1.1 Index]