Skip to contents

Function to get expression values from giotto object

Usage

getExpression(
  gobject,
  values = NULL,
  spat_unit = NULL,
  feat_type = NULL,
  output = c("exprObj", "matrix"),
  set_defaults = TRUE
)

Arguments

gobject

giotto object

values

expression values to extract (e.g. "raw", "normalized", "scaled")

spat_unit

spatial unit (e.g. "cell")

feat_type

feature type (e.g. "rna", "dna", "protein")

output

what object type to retrieve the expression as. Currently either matrix' for the matrix object contained in the exprObj or 'exprObj' (default) for the exprObj itself are allowed.

set_defaults

set default spat_unit and feat_type. Change to FALSE only when expression and spat_info are not expected to exist.

Value

exprObj or matrix depending on output param

See also

Examples

g <- GiottoData::loadGiottoMini("visium")
#> 1. read Giotto object
#> 2. read Giotto feature information
#> 3. read Giotto spatial information
#> 3.1 read Giotto spatial shape information
#> 3.2 read Giotto spatial centroid information
#> 3.3 read Giotto spatial overlap information
#> 4. read Giotto image information
#> python already initialized in this session
#>  active environment : 'giotto_env'
#>  python version : 3.10

getExpression(g)
#> Error in UseMethod("getExpression"): no applicable method for 'getExpression' applied to an object of class "giotto"