Import GeoMX DSP data into a spatial experiment object from DGEList object

readGeoMxFromDGE(dge_object, spatialCoord = NULL)

Arguments

dge_object

a DGEList object (created using edgeR::DGEList).

spatialCoord

a matrix with coordinates of samples, rowname must be cosistent with the colnames of dge_object.

Value

A SpatialExperiment object.

Examples

# making a simple DGEList object
ng <- 1000
ns <- 10
Counts <- matrix(rnbinom(ng * ns, mu = 5, size = 2), ng, ns)
rownames(Counts) <- seq(ng)
y <- edgeR::DGEList(counts = Counts, group = rep(seq(2), each = 5))

# transfer into spatial experiment object
coords <- matrix(rnorm(2 * ns), 10, 2)
spe <- readGeoMxFromDGE(dge_object = y, spatialCoord = coords)
spe
#> class: SpatialExperiment 
#> dim: 1000 10 
#> metadata(0):
#> assays(2): counts logcounts
#> rownames(1000): 1 2 ... 999 1000
#> rowData names(0):
#> colnames(10): Sample1 Sample2 ... Sample9 Sample10
#> colData names(4): group lib.size norm.factors sample_id
#> reducedDimNames(0):
#> mainExpName: NULL
#> altExpNames(0):
#> spatialCoords names(0) :
#> imgData names(0):