Run HMRF
doHMRF(
gobject,
spat_unit = NULL,
feat_type = NULL,
expression_values = c("normalized", "scaled", "custom"),
spatial_network_name = "Delaunay_network",
spat_loc_name = "raw",
spatial_genes = NULL,
spatial_dimensions = c("sdimx", "sdimy", "sdimz"),
dim_reduction_to_use = NULL,
dim_reduction_name = "pca",
dimensions_to_use = 1:10,
seed = 100,
name = "test",
k = 10,
betas = c(0, 2, 50),
tolerance = 1e-10,
zscore = c("none", "rowcol", "colrow"),
numinit = 100,
python_path = NULL,
output_folder = NULL,
overwrite_output = TRUE
)
giotto object
spatial unit
feature type
expression values to use
name of spatial network to use for HMRF
name of spatial locations
spatial genes to use for HMRF
select spatial dimensions to use, default is all possible dimensions
use another dimension reduction set as input
name of dimension reduction set to use
number of dimensions to use as input
seed to fix random number generator (for creating initialization of HMRF) (-1 if no fixing)
name of HMRF run
number of HMRF domains
betas to test for. three numbers: start_beta, beta_increment, num_betas e.g. c(0, 2.0, 50)
tolerance
zscore
number of initializations
python path to use
output folder to save results
overwrite output folder
Creates a directory with results that can be viewed with viewHMRFresults
Description of HMRF parameters ...
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"
spat_genes <- binSpect(g)
#>
#> This is the single parameter version of binSpect
#>
#> 1. matrix binarization complete
#>
#> 2. spatial enrichment test completed
#>
#> 3. (optional) average expression of high
#> expressing cells calculated
#>
#> 4. (optional) number of high expressing cells
#> calculated
doHMRF(g,
spatial_genes = spat_genes[seq_len(10)]$feats,
output_folder = tempdir()
)
#> Error: package 'smfishHmrf' is not yet installed
#>
#> To install:
#> ## active python env: '/usr/bin/python3'
#> ## python version: 3.10
#> ## restart session then use GiottoClass::set_giotto_python_path() if this is incorrect
#> reticulate::conda_install(envname = '/usr/bin/python3', packages = c('smfishHmrf'), pip = TRUE)