smoothSpatially: Smooth numeric variables spatially

View source: R/s.R

smoothSpatiallyR Documentation

Smooth numeric variables spatially

Description

Uses a loess-fit model to smooth numeric variables spatially. The variable names denoted in argument variables are overwritten.

Usage

smoothSpatially(
  coords_df,
  variables,
  smooth_span = 0.025,
  normalize = TRUE,
  verbose = TRUE
)

Arguments

coords_df

A data.frame containing information about every barcode-spot. Must contain the variables:

  • barcodes Character. The barcode-sequences (+ the sample belonging) of every barcode spot.

  • sample Character. The sample belonging of every barcode-spot.

  • x Numeric. The x-coordinates of every barcode.

  • y Numeric. The y-coordinates of every barcode.

variables

Character vector. Specifies the numeric variables of the input data.frame that are to be smoothed.

smooth_span

Numeric value. Controls the degree of smoothing. Given to argument span of stats::loess().

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.

verbose

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

(Warning messages will always be printed.)

Value

The input data.frame containing the smoothed variables.


kueckelj/SPATA2 documentation built on March 16, 2024, 10:25 a.m.