Create a simulated spatial pattern for one selected gnee

simulateOneGenePatternGiottoObject(
  gobject,
  pattern_name = "pattern",
  pattern_cell_ids = NULL,
  gene_name = NULL,
  spatial_prob = 0.95,
  gradient_direction = NULL,
  show_pattern = TRUE,
  pattern_colors = c(`in` = "green", out = "red"),
  normalization_params = list()
)

Arguments

gobject

giotto object

pattern_name

name of spatial pattern

pattern_cell_ids

cell ids that make up the spatial pattern

gene_name

selected gene

spatial_prob

probability for a high expressing gene value to be part of the spatial pattern

gradient_direction

direction of gradient

show_pattern

show the discrete spatial pattern

pattern_colors

2 color vector for the spatial pattern

normalization_params

additional parameters for (re-)normalizing

Value

Reprocessed Giotto object for which one gene has a forced spatial pattern

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

simulateOneGenePatternGiottoObject(
    gobject = g,
    pattern_cell_ids = c(
        "AAAGGGATGTAGCAAG-1", "TCAAACAACCGCGTCG-1",
        "ACGATCATACATAGAG-1", "TATGCTCCCTACTTAC-1"
    ),
    gene_name = "Gna12"
)

#> > raw already exists and will be replaced with new values
#> Setting expression [cell][rna] raw
#> first scale feats and then cells
#> > normalized already exists and will be replaced with new values
#> Setting expression [cell][rna] normalized
#> > scaled already exists and will be replaced with new values
#> Setting expression [cell][rna] scaled
#> feat statistics has already been applied once; overwriting
#> cells statistics has already been applied once; overwriting
#> An object of class giotto 
#> >Active spat_unit:  cell 
#> >Active feat_type:  rna 
#> dimensions    : 634, 624 (features, cells)
#> [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