Find the spatial neighbors for a selected group of cells within the selected spatial network.

findNetworkNeighbors(
  gobject,
  spat_unit = NULL,
  spatial_network_name = NULL,
  source_cell_ids = NULL,
  name = "nb_cells"
)

Arguments

gobject

Giotto object

spat_unit

spatial unit

spatial_network_name

name of spatial network

source_cell_ids

cell ids for which you want to know the spatial neighbors

name

name of the results

Value

data.table

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
#> 
#> checking default envname 'giotto_env'
#> a system default python environment was found
#> Using python path:
#>  "/usr/bin/python3"

findNetworkNeighbors(
    gobject = g, spatial_network_name = "spatial_network",
    source_cell_ids = c("AACTCGATGGCGCAGT-1", "GGCTGGCTAGCTTAAA-1")
)
#>                 cell_ID nb_cells
#>                  <char>   <char>
#>   1: AACTCGATGGCGCAGT-1     both
#>   2: GGCTGGCTAGCTTAAA-1     both
#>   3: GACGCCTGTTGCAGGG-1 neighbor
#>   4: GAGGGCATCGCGTATC-1 neighbor
#>   5: TCAACACATTGGGTAA-1   others
#>  ---                            
#> 620: GGTAGTGCTCGCACCA-1   others
#> 621: AAGCTCGTGCCAAGTC-1   others
#> 622: TATTCAATTCTAATCC-1   others
#> 623: TTCAAAGTCTCTAGCC-1   others
#> 624: TTGAATATGGACTTTC-1   others