Skip to contents

aggregate expression matrices from different z-stacks

Usage

aggregateStacks(
  gobject,
  spat_units,
  feat_type,
  values,
  summarize_expression = "sum",
  summarize_locations = "mean",
  for_loop = FALSE,
  for_loop_group_size = 100,
  new_spat_unit = "aggregate",
  verbose = TRUE
)

Arguments

gobject

giotto object

spat_units

spatial units to aggregate

feat_type

feature type

values

values to use

summarize_expression

method to summarize expression information

summarize_locations

method to summarize spatial location information

for_loop

aggregate polygons in for loop (default = FALSE)

for_loop_group_size

size of polygon groups to aggregate in each loop

new_spat_unit

new name for aggregated spatial unit

verbose

verbosity

Value

giotto object

Examples

g <- GiottoData::loadGiottoMini("vizgen")
#> 1. read Giotto object
#> 2. read Giotto feature information
#> 3. read Giotto spatial information
#> 4. read Giotto image information
#> python already initialized in this session
#>  active environment : '/usr/bin/python3'
#>  python version : 3.12

aggregateStacks(g,
    spat_units = c("z0", "z1"), feat_type = "rna",
    values = "raw"
)
#> 1. Start aggregating expression data
#> > raw already exists and will be replaced with new values
#> > Cell metadata for spat_unit " aggregate " and feat_type " rna " already
#>  exists and will be replaced with new metadata.
#> Setting cell metadata [aggregate][rna]
#> > Feat metadata for spat_unit " aggregate " and feat_type " rna " already
#>  exists and will be replaced with new metadata.
#> Setting feature metadata [aggregate][rna]
#> 1. Aggregating expression data completed
#> 2. Start aggregating Polygon data
#> 2. Aggregating polygon data completed
#> 3. Start aggregating centroid location data
#> Start centroid calculation for polygon information
#>  layer: aggregate
#> > spatial locations for polygon information layer " aggregate " and name " raw
#>  " already exists and will be replaced
#> 3. Aggregating centroid location data completed
#> 4. Start aggregating polygon overlap data
#> Error in rbind2(...): argument "x" is missing, with no default