Bins barcode-spots by consecutively expanding a polygon.

bin_by_expansion(
  coords_df,
  area_df,
  binwidth,
  n_bins_circle,
  remove = FALSE,
  bcsp_exclude = NULL,
  drop = TRUE,
  arrange = TRUE
)

Arguments

coords_df

The coordinates data.frame whose barcode-spots are supposed to be binned.

area_df

Data.frame with variables x and y describing the vertices of the polygon that encircles the area based on which the barcode-spots are binned. E.g. slot @area of ImageAnnotation-objects.

binwidth

Distance value. The width of the circular bins to which the barcode-spots are assigned. We recommend to set it equal to the center-center distance: binwidth = getCCD(object). (See details for more.) - See details of ?is_dist for more information about distance values.

n_bins_circle

Numeric value or vector of length 2. Specifies how many times the area is buffered with the value denoted in binwidth. (See details for more.)

remove

Character or logical. If character, denotes circle bins that are removed. If TRUE, bins 'Core' and 'Outside' are removed. If FALSE, ignored.

bcsp_exclude

Character value containing name(s) of barcode-spots to be excluded from the analysis.

drop

Logical value. If TRUE, unused levels of the bins_circle variables are dropped.