Function to set a spatial grid
Usage
setSpatialGrid(
gobject,
spatial_grid,
spat_unit = NULL,
feat_type = NULL,
name = NULL,
verbose = TRUE,
set_defaults = TRUE,
...
)
Arguments
- gobject
giotto object
- spatial_grid
spatial grid object
- spat_unit
spatial unit (e.g. "cell")
- feat_type
feature type (e.g. "rna", "dna", "protein")
- name
name of spatial grid
- 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.
- ...
additional params to pass
See also
Other spatial grid data accessor functions:
getSpatialGrid()
Other functions to set data in giotto object:
setCellMetadata()
,
setDimReduction()
,
setExpression()
,
setFeatureInfo()
,
setFeatureMetadata()
,
setGiotto()
,
setGiottoImage()
,
setMultiomics()
,
setNearestNetwork()
,
setPolygonInfo()
,
setSpatialEnrichment()
,
setSpatialLocations()
,
setSpatialNetwork()
,
set_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"
g <- createSpatialGrid(g, sdimx_stepsize = 5, sdimy_stepsize = 5)
sg <- getSpatialGrid(g, return_grid_Obj = TRUE)
#> The grid name was not specified, default to the first: "spatial_grid"
setSpatialGrid(gobject = g, spatial_grid = sg)
#> > " spatial_grid " already exists and will be replaced with new spatial grid
#> 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