Skip to contents

A convenience function that coerces a GiottoDB object to an in-memory giotto object. Expression matrices are converted to in-memory matrices using dbverse coercions:

  • dbSparseMatrix/dbMatrix -> dgCMatrix

  • dbDenseMatrix -> base matrix

Spatial data stored as dbSpatial are converted to terra::SpatVector.

Usage

as_giotto(x, verbose = TRUE)

Arguments

x

A GiottoDB object

verbose

Whether to print progress messages

Value

A GiottoClass::giotto object

Examples

if (FALSE) { # \dontrun{
library(GiottoDB)
library(GiottoData)
library(duckdb)
library(DBI)

g <- GiottoData::loadGiottoMini("visium")
con <- DBI::dbConnect(duckdb::duckdb(), dbdir = ":memory:")
gdb <- as_giottodb(g, con = con)

g_inmem <- as_giotto(gdb)
DBI::dbDisconnect(con, shutdown = TRUE)
} # }