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/91/twz8ld_x3f98sr9yc2hq9xpn47blx2/T//Rtmp4vm41m/network_Visium_1.json
#>  Finished!