Skip to contents

Function to set a spatial network

Usage

setSpatialNetwork(
  gobject,
  x,
  spat_unit = NULL,
  name = NULL,
  provenance = NULL,
  verbose = TRUE,
  initialize = TRUE,
  ...
)

Arguments

gobject

giotto object

x

spatialNetworkObj or list of spatialNetworkObj to set. Passing NULL removes a specified set of spatial network information from the gobject.

spat_unit

spatial unit (e.g. "cell")

name

name of spatial network

provenance

provenance name

verbose

be verbose

initialize

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

...

additional params to pass

Value

giotto object

See also

Examples

g <- GiottoData::loadGiottoMini("visium")
#> 1. read Giotto object
#> 2. read Giotto feature information
#> 3. read Giotto spatial information
#> 3.1 read Giotto spatial shape information
#> 3.2 read Giotto spatial centroid information
#> 3.3 read Giotto spatial overlap information
#> 4. read Giotto image information
#> python already initialized in this session
#>  active environment : 'giotto_env'
#>  python version : 3.10
#> checking default envname 'giotto_env'
#> a system default python environment was found
#> Using python path:
#>  "/usr/share/miniconda/envs/giotto_env/bin/python"
spatnet <- getSpatialNetwork(g)

setSpatialNetwork(gobject = g, x = spatnet)
#> > " Delaunay_network " already exists and will be replaced with new spatial
#>  network
#> Setting spatial network [cell] Delaunay_network
#> An object of class giotto 
#> >Active spat_unit:  cell 
#> >Active feat_type:  rna 
#> dimensions    : 634, 624 (features, cells)
#> [SUBCELLULAR INFO]
#> polygons      : cell 
#> [AGGREGATE INFO]
#> expression -----------------------
#>   [cell][rna] raw normalized scaled
#> spatial locations ----------------
#>   [cell] raw
#> spatial networks -----------------
#>   [cell] Delaunay_network spatial_network
#> spatial enrichments --------------
#>   [cell][rna] cluster_metagene DWLS
#> dim reduction --------------------
#>   [cell][rna] pca custom_pca umap custom_umap tsne
#> nearest neighbor networks --------
#>   [cell][rna] sNN.pca custom_NN
#> attached images ------------------
#> images      : alignment image 
#> 
#> 
#> Use objHistory() to see steps and params used