florets: Draw coxcomb plots as points in a graphics window

Description Usage Arguments Value Examples

View source: R/florets.R

Description

Draws a scatterplot where each point is a circular barplot, intended to show decon results

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
florets(
  x,
  y,
  b,
  col = NULL,
  legendwindow = FALSE,
  rescale.by.sqrt = TRUE,
  border = NA,
  add = FALSE,
  cex = 1,
  bty = "n",
  xaxt = "n",
  yaxt = "n",
  xlab = "",
  ylab = "",
  ...
)

Arguments

x

Vector of x coordinates

y

Vector of y coordinates

b

matrix or cell abundances, with columns aligned with the elements of x and y

col

vector of colors, aligned to the rows of b.

legendwindow

Logical. If TRUE, the function draws a color legend in a new window

rescale.by.sqrt

Logical, for whether to rescale b by its square root to make value proportional to shape area, not shape length.

border

Color of pie segment border, defauls to NA/none

add

Logical. If TRUE, the function draws florets atop an existing graphics device (TRUE) or call a new device (FALSE).

cex

Floret size. Florets are scaled relative to the range of x and y; this further scales up or down.

bty

bty argument passed to plot()

xaxt

xaxt argument passed to plot()

yaxt

yaxt argument passed to plot()

xlab

xlab, defaults to ""

ylab

ylab, defaults to ""

...

additional arguments passed to plot()

Value

Draws a coxcomb plot, returns no data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
data(mini_geomx_dataset)
data(safeTME)
# estimate background:
mini_geomx_dataset$bg <- derive_GeoMx_background(
  norm = mini_geomx_dataset$normalized,
  probepool = rep(1, nrow(mini_geomx_dataset$normalized)),
  negnames = "NegProbe"
)
# run basic decon:
res0 <- spatialdecon(
  norm = mini_geomx_dataset$normalized,
  bg = mini_geomx_dataset$bg,
  X = safeTME
)
# draw florets:
florets(
  x = mini_geomx_dataset$annot$x,
  y = mini_geomx_dataset$annot$y,
  b = res0$beta, cex = 2
)

SpatialDecon documentation built on Nov. 8, 2020, 6 p.m.