Previously: calculate_spatial_genes_python. This method
computes a silhouette score per gene based on the
spatial distribution of two partitions of cells
(expressed L1, and non-expressed L0).
Here, rather than L2 Euclidean norm, it uses a rank-transformed,
exponentially weighted
function to represent the local physical distance between two cells.
New multi aggregator implementation can be found at
silhouetteRankTest
silhouetteRank(
gobject,
expression_values = c("normalized", "scaled", "custom"),
metric = "euclidean",
subset_genes = NULL,
rbp_p = 0.95,
examine_top = 0.3,
python_path = NULL
)
data.table with spatial scores
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"
silhouetteRank(g)
#> Error in py_run_file_impl(file, local, convert): ModuleNotFoundError: No module named 'scipy'
#> Run `reticulate::py_last_error()` for details.