function to add HMRF Domain Type to cell meta data

addHMRF_V2(gobject, HMRFoutput, name = "hmrf")

Arguments

gobject

giotto object

HMRFoutput

result object from HMRF model

name

name of HMRF models

Value

giotto object

Details

This function appends HMRF domain clusters to corresponding cell meta data for all the beta values, with the given HMRF model names. For example, if name = ‘hmrf1’ and name of result in HMRFoutput is ‘k=8 b=0.00’, the appended cell meta data column will be named with ‘hmrf1 k=8 b=0.00’

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"
g <- binSpect(g, return_gobject = TRUE)
#> 
#> 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
HMRF_init_obj <- initHMRF_V2(gobject = g, cl.method = "km")
#> 
#> If used in published research, please cite:
#>  Q Zhu, S Shah, R Dries, L Cai, GC Yuan.
#>  'Identification of spatially associated subpopulations by combining
#>  scRNAseq and sequential fluorescence in situ hybridization data'
#>  Nature biotechnology 36 (12), 1183-1190. 2018
#> Error: packages 'smfishHmrf', 'graphcoloring' are not yet installed
#> 
#>  To install:
#> devtools::install_bitbucket("qzhudfci/smfishHmrf-r")
#> devtools::install_bitbucket("qzhudfci/graphcoloring")
HMRFoutput <- doHMRF_V2(HMRF_init_obj = HMRF_init_obj, betas = c(0, 5, 2))
#> 
#>  If used in published research, please cite:
#>     Q Zhu, S Shah, R Dries, L Cai, GC Yuan.
#>     'Identification of spatially associated subpopulations by combining
#>     scRNAseq and sequential fluorescence in situ hybridization data'
#>     Nature biotechnology 36 (12), 1183-1190. 2018
#> 
#>  Please find more explanation and instruction of the HMRF function
#>     on 
#>  https://bitbucket.org/qzhudfci/smfishhmrf-r/src/master/TRANSITION.md
#> Error: object 'HMRF_init_obj' not found

addHMRF_V2(gobject = g, HMRFoutput = HMRFoutput)
#> Error: object 'HMRFoutput' not found