Creates a `ggplot` plot where numeric data, mapped to structures, fill the segmentation shapes in a colour scale

seg_feature_plot(
  segmentation,
  feature,
  assay,
  projection = NULL,
  plane = "sagittal",
  by = NULL,
  aggr_fun = NULL,
  rng = NULL,
  smooth = TRUE,
  smoothness = 3,
  minsize = 10,
  color_pal = NULL,
  show_side = "both",
  show_labels = TRUE,
  labelsize = 2,
  remove_axes = TRUE
)

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

rng

numeric with two elements with lower and upper bound for the color scale. Default is NULL

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_side

character, the side of the projection to be plotted. one of "first" ,"second", or "both". Default is "both".

show_labels

logical, should segmentation labels be shown? Default is TRUE

labelsize

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

remove_axes

logical, should axes be shown? Default is FALSE

Value

a `ggplot` plot in which structures are coloured according to a numeric value