Skip to contents

Utility function to prepare data for CutSpatialNetwork. The exported JSON file should be exported to the same directory as the H&E image tiles generated with TileImage

Usage

export_graph(object, sampleID = 1L, outdir, verbose = TRUE)

Arguments

object

A Seurat object created with semla

sampleID

An integer specifying a sample ID to export spatial network for

outdir

Name of a directory to export JSON file to

verbose

Print messages

Value

No return value, writes data to an output directory

See also

CutSpatialNetwork

Examples


library(semla)

se_mbrain <- readRDS(system.file("extdata/mousebrain", "se_mbrain", package = "semla"))

# Export graph as a JSON file to a temporary directory
export_graph(se_mbrain, sampleID = 1L, outdir = tempdir())
#> ℹ Creating spatial network for sample 1
#> ℹ Creating adjacency matrix from spatial network
#> ℹ Rearranging 2559x2559 adjacency matrix
#> ℹ Removing duplicated edges
#> ℹ Creating tidy graph object
#> ℹ Adding node attributes
#> ℹ Adding edge attributes
#> ℹ Exporting spatial network to /var/folders/z8/nrcst881607gn95xh3_4qvb00000gp/T//RtmpYIqyij/network_Visium_1.json
#> ✔ Finished!