vignettes/tut8_giotto_grid_network.Rmd
tut8_giotto_grid_network.Rmd
\(~\)
mini_giotto_single_cell <- createSpatialGrid(gobject = mini_giotto_single_cell,
sdimx_stepsize = 250,
sdimy_stepsize = 250,
minimum_padding = 50)
# visualize grid
spatPlot(gobject = mini_giotto_single_cell, show_grid = T, point_size = 1.5)
# create another larger grid
mini_giotto_single_cell <- createSpatialGrid(gobject = mini_giotto_single_cell,
sdimx_stepsize = 350,
sdimy_stepsize = 350,
minimum_padding = 50,
name = 'large_grid')
# show available grids
showGrids(mini_giotto_single_cell)
# visualize other grid
spatPlot2D(gobject = mini_giotto_single_cell, point_size = 1.5,
show_grid = T, spatial_grid_name = 'large_grid')
\(~\)
# get information about the Delaunay network
plotStatDelaunayNetwork(gobject = mini_giotto_single_cell, maximum_distance = 400)
# create a spatial network, the Delaunay network is the default network
# default name = 'Delaunay_network'
mini_giotto_single_cell = createSpatialNetwork(gobject = mini_giotto_single_cell, minimum_k = 2,
maximum_distance_delaunay = 400)
# create a kNN network with 4 spatial neighbors
# default name = 'kNN_network'
mini_giotto_single_cell = createSpatialNetwork(gobject = mini_giotto_single_cell, minimum_k = 2,
method = 'kNN', k = 4)
# show available networks
showNetworks(mini_giotto_single_cell)
# visualize the two different spatial networks
spatPlot(gobject = mini_giotto_single_cell, show_network = T,
network_color = 'blue', spatial_network_name = 'Delaunay_network',
point_size = 2.5, cell_color = 'cell_types')
spatPlot(gobject = mini_giotto_single_cell, show_network = T,
network_color = 'blue', spatial_network_name = 'kNN_network',
point_size = 2.5, cell_color = 'cell_types')