Creates a `grid` plot where numeric data, mapped to structures, fill the segmentation shapes in a colour scale and a heatmap is displayed at the bottom, showing the whole range of values across an experimental variable.

seg_feature_complex_plot(
  segmentation,
  feature,
  assay,
  projection = NULL,
  plane = "sagittal",
  by = NULL,
  aggr_fun = mean,
  scale = FALSE,
  smooth = TRUE,
  smoothness = 3,
  minsize = 10,
  color_pal = NULL,
  show_labels = TRUE,
  labelsize = 2
)

Arguments

segmentation

a segmentation class object.

feature

character, feature to be plotted from the assay slot.

assay

character, the name of the assay slot in the segmentation.

projection

character, name of the maximum projection slot to be used? Default is NULL, which uses the same name as selected in assay.

plane

character, the plane for the maximum projection. Default is "sagittal".

by

character with two elements, [1] the name of the column in the sampledata of the assay to be used for subsetting and aggregating and [2] the value to which the column in [1] should be equal to

aggr_fun

function, the function to be used to aggregate samples across rows when using by

scale

logical, should the values in the heatmap be scaled? Default is FALSE.

smooth

logical, should shapes be smoothed? Default is TRUE.

smoothness

numeric, the smoothing to be used. Default is 3.

minsize

numeric, minimum number of vertices to draw a polygon. Default is 10.

color_pal

character, the color palette to be used. The default is the `Sunset` palette from colorspace

show_labels

logical, should segmentation labels be shown? Default is TRUE

labelsize

numeric, the size of the labels. Default is 2.

Value

a `grid` plot in which structures are coloured according to a numeric value in a segmentation projection and in a heatmap