Skip to contents

The function iSCMEB is used to fit a iSC.MEB model for a iSCMEBObj object.

Usage

iSCMEB(iSCMEBObj, K = NULL)

Arguments

iSCMEBObj

A iSCMEBObj object.

K

An optional integer or integer vector, specify the candidates of number of clusters. if K=NULL, it will be set to 5~12.

Value

Returns a revised iSCMEBObj object.

Details

The model results are saved in the slot of resList.

Examples

data(iSCMEBObj_toy)
#> Warning: data set 'iSCMEBObj_toy' not found
library(Seurat)
iSCMEBObj_toy <- runPCA(iSCMEBObj_toy)
iSCMEBObj_toy <- CreateNeighbors(iSCMEBObj_toy, platform = "Visium")
#> Neighbors were identified for 4222 out of 4222 spots.
#> Neighbors were identified for 4378 out of 4381 spots.
iSCMEBObj_toy <- SetModelParameters(iSCMEBObj_toy, maxIter=10)
iSCMEBObj_toy <- iSCMEB(iSCMEBObj_toy, K = 7)
#> Evaluate initial values...
#> fitting ...
#> 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |======================================================================| 100%
#> Fit SC-MEB2...
#> Finish variable initialization 
#> K = 7, iter = 2, loglik= -148583.924112, dloglik=0.999931 
#> K = 7, iter = 3, loglik= -142378.593319, dloglik=0.041763 
#> K = 7, iter = 4, loglik= -138932.559873, dloglik=0.024203 
#> K = 7, iter = 5, loglik= -135452.994625, dloglik=0.025045 
#> K = 7, iter = 6, loglik= -133626.290687, dloglik=0.013486 
#> K = 7, iter = 7, loglik= -132565.279798, dloglik=0.007940 
#> K = 7, iter = 8, loglik= -131780.626891, dloglik=0.005919 
#> K = 7, iter = 9, loglik= -131009.202464, dloglik=0.005854 
#> K = 7, iter = 10, loglik= -130602.705279, dloglik=0.003103