Skip to contents

Function to set a spatial location slot

Usage

set_spatial_locations(
  gobject,
  spatlocs,
  spat_unit = NULL,
  spat_loc_name = "raw",
  provenance = NULL,
  verbose = TRUE,
  set_defaults = TRUE,
  initialize = FALSE
)

Arguments

gobject

giotto object

spatlocs

spatial locations (accepts either data.table or spatLocsObj)

spat_unit

spatial unit (e.g. "cell")

spat_loc_name

name of spatial locations, default "raw"

provenance

provenance information (optional)

verbose

be verbose

set_defaults

set default spat_unit and feat_type. Change to FALSE only when expression and spat_info are not expected to exist.

initialize

(default = FALSE) whether to initialize the gobject before returning

Value

giotto object

Details

If a spatLocsObj is provided to spatlocs param then any attached name and spat_unit info will be used for input to this function's spat_loc_name and spat_unitparams, BUT will be overridden by any alternative specific inputs to those params.
ie: a spatLocsObj with spat_unit slot == 'cell' will be automatically nested by spat_unit 'cell' when using set_spatial_locations as long as param spat_unit = NULL. BUT if param spat_unit = 'nucleus' then the spatLocsObj will be nested by spat_unit 'nucleus' instead and its spat_unit slot will be changed to 'nucleus'