adds cells statistics to the giotto object

addCellStatistics(
  gobject,
  feat_type = NULL,
  spat_unit = NULL,
  expression_values = c("normalized", "scaled", "custom"),
  detection_threshold = 0,
  return_gobject = TRUE,
  verbose = TRUE
)

Arguments

gobject

giotto object

feat_type

feature type

spat_unit

spatial unit

expression_values

expression values to use

detection_threshold

detection threshold to consider a gene detected

return_gobject

boolean: return giotto object (default = TRUE)

verbose

be verbose

Value

giotto object if return_gobject = TRUE

Details

This function will add the following statistics to cell metadata:

  • nr_feats: Denotes in how many features are detected per cell

  • perc_feats: Denotes what percentage of features is detected per cell

  • total_expr: Shows the total sum of feature expression per cell

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
#> 
#> checking default envname 'giotto_env'
#> a system default python environment was found
#> Using python path:
#>  "/usr/bin/python3"

addCellStatistics(g)
#> cells statistics has already been applied once; overwriting
#> An object of class giotto 
#> >Active spat_unit:  cell 
#> >Active feat_type:  rna 
#> [SUBCELLULAR INFO]
#> polygons      : cell 
#> [AGGREGATE INFO]
#> expression -----------------------
#>   [cell][rna] raw normalized scaled
#> spatial locations ----------------
#>   [cell] raw
#> spatial networks -----------------
#>   [cell] Delaunay_network spatial_network
#> spatial enrichments --------------
#>   [cell][rna] cluster_metagene DWLS
#> dim reduction --------------------
#>   [cell][rna] pca custom_pca umap custom_umap tsne
#> nearest neighbor networks --------
#>   [cell][rna] sNN.pca custom_NN
#> attached images ------------------
#> images      : alignment image 
#> 
#> 
#> Use objHistory() to see steps and params used