Directly attach a giotto image to giotto object
Details
Use with care! This function directly attaches
giotto image objects to the gobject without further modifications of
spatial positioning values within the image object that are generally
needed in order for them to plot in the correct location relative to the
other modalities of spatial data.
For the more general-purpose method
of attaching image objects, see addGiottoImage
See also
Other image data accessor functions:
getGiottoImage()
Other functions to set data in giotto object:
setCellMetadata()
,
setDimReduction()
,
setExpression()
,
setFeatureInfo()
,
setFeatureMetadata()
,
setGiotto()
,
setMultiomics()
,
setNearestNetwork()
,
setPolygonInfo()
,
setSpatialEnrichment()
,
setSpatialGrid()
,
setSpatialLocations()
,
setSpatialNetwork()
,
set_multiomics()
Examples
g <- GiottoData::loadGiottoMini("vizgen")
#> 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"
gimg <- getGiottoImage(gobject = g)
setGiottoImage(g, NULL, name = objName(gimg))
#> NULL passed to `image` param
#> removing specified image
#> An object of class giotto
#> >Active spat_unit: z0
#> >Active feat_type: rna
#> dimensions : 337, 498 (features, cells)
#> [SUBCELLULAR INFO]
#> polygons : z0 z1 aggregate
#> features : rna
#> [AGGREGATE INFO]
#> expression -----------------------
#> [z0][rna] raw
#> [z1][rna] raw
#> [aggregate][rna] raw normalized scaled pearson
#> spatial locations ----------------
#> [z0] raw
#> [z1] raw
#> [aggregate] raw
#> spatial networks -----------------
#> [aggregate] Delaunay_network kNN_network
#> spatial enrichments --------------
#> [aggregate][rna] cluster_metagene
#> dim reduction --------------------
#> [aggregate][rna] pca umap tsne
#> nearest neighbor networks --------
#> [aggregate][rna] sNN.pca
#> attached images ------------------
#> images : dapi_z1 polyT_z0 polyT_z1
#>
#>
#> Use objHistory() to see steps and params used
setGiottoImage(gobject = g, image = gimg)
#> > image 'dapi_z0' already exists and will be replaced
#> An object of class giotto
#> >Active spat_unit: z0
#> >Active feat_type: rna
#> dimensions : 337, 498 (features, cells)
#> [SUBCELLULAR INFO]
#> polygons : z0 z1 aggregate
#> features : rna
#> [AGGREGATE INFO]
#> expression -----------------------
#> [z0][rna] raw
#> [z1][rna] raw
#> [aggregate][rna] raw normalized scaled pearson
#> spatial locations ----------------
#> [z0] raw
#> [z1] raw
#> [aggregate] raw
#> spatial networks -----------------
#> [aggregate] Delaunay_network kNN_network
#> spatial enrichments --------------
#> [aggregate][rna] cluster_metagene
#> dim reduction --------------------
#> [aggregate][rna] pca umap tsne
#> nearest neighbor networks --------
#> [aggregate][rna] sNN.pca
#> attached images ------------------
#> images : 4 items...
#>
#>
#> Use objHistory() to see steps and params used