Skip to contents

Function to get a spatial network

Usage

getSpatialNetwork(
  gobject,
  spat_unit = NULL,
  name = NULL,
  output = c("spatialNetworkObj", "networkDT", "networkDT_before_filter", "outputObj"),
  set_defaults = TRUE,
  copy_obj = TRUE,
  verbose = TRUE,
  simplify = TRUE
)

Arguments

gobject

giotto object

spat_unit

spatial unit (e.g. "cell")

name

name of spatial network

output

object type to return as. Options: 'spatialNetworkObj' (default), 'networkDT' and 'networkDT_before_filter' for data.table outputs.

set_defaults

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

copy_obj

whether to copy/duplicate when getting the object (default = TRUE)

verbose

be verbose

simplify

logical. Whether or not to take object out of a list when there is a length of 1.

Value

spatialNetworkObj of data.table

See also

Other spatial network data accessor functions: setSpatialNetwork()

Other functions to get data from giotto object: getCellMetadata(), getDimReduction(), getExpression(), getFeatureInfo(), getFeatureMetadata(), getGiottoImage(), getMultiomics(), getNearestNetwork(), getPolygonInfo(), getSpatialEnrichment(), getSpatialGrid(), getSpatialLocations(), get_multiomics()

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"

getSpatialNetwork(g)
#> An object of class spatialNetworkObj : "Delaunay_network"
#> Contains spatial network generated with: deldir 
#> spat_unit : "cell"
#> provenance: cell 
#>    1770 connections (filtered)
#>    1814 connections (before filter)
#>