plot_binned_aggregates: plot_binned_aggregates

plot_binned_aggregatesR Documentation

plot_binned_aggregates

Description

plot_binned_aggregates

Usage

plot_binned_aggregates(
  agg_dt,
  xbins = 50,
  ybins = xbins,
  xrng = NULL,
  yrng = NULL,
  val = "y",
  bxval = "tx",
  byval = "ty",
  facet_ = "wide_var",
  extra_vars = character(),
  bin_met = mean,
  min_size = 1,
  return_data = FALSE
)

Arguments

agg_dt

data.table as returned by chiptsne:::aggregate_signals

xbins

Number of bins (pixel) in the x direction

ybins

Number of bins (pixel) in the y direction. Default reuses xbins.

xrng

numeric vector of length 2 defining range of x-axis. Default is full range of agg_dt.

yrng

numeric vector of length 2 defining range of y-axis. Default is full range of agg_dt.

val

The value mapped to fill in final plot.

bxval

The variable defining individual points x position in agg_dt.

byval

The variable defining individual points y position in agg_dt.

facet_

Variable in agg_dt to facet plot upon.

bin_met

Function applied to all points in bin on the value of val

min_size

Bins must contain at least this many points to appear in final plot.

return_data

If TRUE, return data.table, not ggplot.

Value

A ggplot object where TSNE space is summarized by a xbins*ybins raster image colored according to val.

Examples

agg_dt = aggregate_signals(profile_dt)
agg_dt = merge(agg_dt, tsne_dt, by = c("id", "tall_var"))
#control resolution in x and y separately
plot_raster_summary(agg_dt, facet_ = c("tall_var", "wide_var"),
    xbins = 2, ybins = 3)
#filter out sparse regions
plot_raster_summary(agg_dt, facet_ = c("tall_var", "wide_var"),
    xbins = 12, min_size = 0, xrng =  c(-.5, .5))

jrboyd/seqtsne documentation built on Nov. 5, 2022, 6:37 a.m.