Extracts a data.frame of inferred gradients of numeric variables as a fucntion of distance to image annotations.

getIasDf(
  object,
  id,
  distance = NA_integer_,
  n_bins_circle = NA_integer_,
  binwidth = getCCD(object),
  angle_span = c(0, 360),
  n_bins_angle = 1,
  variables = NULL,
  method_gs = NULL,
  summarize_by = c("bins_angle", "bins_circle"),
  summarize_with = "mean",
  normalize_by = "sample",
  normalize = FALSE,
  remove_circle_bins = FALSE,
  remove_angle_bins = FALSE,
  rename_angle_bins = FALSE,
  bcsp_exclude = NULL,
  verbose = FALSE,
  ...
)

getImageAnnotationScreeningDf(...)

Arguments

object

An object of class spata2.

id

Character value. The ID of the image annotation of interest.

distance

Distance value. Specifies the distance from the border of the image annotation to the horizon in the periphery up to which the screening is conducted. (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.)

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.

angle_span

Numeric vector of length 2. Confines the area screened by an angle span relative to the center of the image annotation. (See details fore more.)

n_bins_angle

Numeric value. Number of bins that are created by angle. (See details for more.)

variables

Character vector. All numeric variables (meaning genes, gene-sets and numeric features) that are supposed to be included in the screening process.

method_gs

Character value. The method according to which gene sets will be handled specified as a character of length one. This can be either 'mean or one of 'gsva', 'ssgsea', 'zscore', or 'plage'. The latter four will be given to gsva::GSVA().

summarize_with

Character value. Either 'mean' or 'median'. Specifies the function with which the bins are summarized.

normalize

Logical. If set to TRUE values will be scaled to 0-1.

Hint: Variables that are uniformly expressed can not be scaled and are discarded.

bcsp_exclude

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

verbose

Logical. If set to TRUE informative messages regarding the computational progress will be printed.

(Warning messages will always be printed.)

...

Used to absorb deprecated arguments or functions.

Value

Data.frame.

Examples


library(SPATA2)
library(SPATAData)

data("image_annotations")

necrotic_img_ann <- image_annotations[["313_T"]][["necrotic_center"]]

object <- downloadSpataObject(sample_name = "313_T")

object <- setImageAnnotation(object = object, img_ann = necrotic_img_ann)

plotSurfaceIAS(
 object = object,
 id = "necrotic_center",
 distance = 200
 )

plotSurfaceIAS(
 object = object,
 id = "necrotic_center",
 distance = 200,
 binwidth = getCCD(object)*4, # lower resolution by increasing binwidth for visualization
 n_bins_angle = 12,
 display_angle = TRUE
 )

getIasDf(
  object = object,
  id = "necrotic_center",
  distance = 200,
  variables = "VEGFA"
  )

getIasDf(
  object = object,
   id = "necrotic_center",
   distance = 200,
   variables = "VEGFA"
   )

getIasDf(
  object = object,
   id = "necrotic_center",
   distance = 200,
   variables = "VEGFA",
   n_bins_angle = 12
   )