Skip to contents

CS graph representation

Usage

.coord2graph(x)

Arguments

x

SpatialData object

Examples

x <- file.path("extdata", "blobs.zarr")
x <- system.file(x, package="SpatialData")
x <- readSpatialData(x, tables=FALSE)
g <- SpatialData:::.coord2graph(x)
# visualize element-coordinate system relations as graph
graph::plot(g)
#> 
#> Attaching package: ‘Rgraphviz’
#> The following objects are masked from ‘package:IRanges’:
#> 
#>     from, to
#> The following objects are masked from ‘package:S4Vectors’:
#> 
#>     from, to
#> The following object is masked from ‘package:SpatialData’:
#> 
#>     shape

# retrieve transformation from element to target space
graph::edgeData(g, "blobs_labels", "translation", "data")
#> $`blobs_labels|translation`
#> [1] -50  10
#>