smfishHmrf.hmrfem.multi {smfishHmrf}R Documentation

Performs HMRF for multivariate normal distribution. Accepts R data structures as inputs. Accepts a single beta.

Description

This function performs HMRF (Zhu et al. 2018-Dec-01) on multivariate normal distributions. Different from other variations, this function accepts R data structures directly as inputs, and only accepts a single value of beta.

This function exists for legacy and compatibility reason. User should use smfishHmrf.hmrfem.multi.it.min function.

Usage

smfishHmrf.hmrfem.multi(
  y,
  neighbors,
  numnei,
  blocks,
  beta = 0.5,
  mu,
  sigma,
  err = 1e-07,
  maxit = 50,
  verbose,
  dampFactor = NULL,
  forceDetectDamp = FALSE,
  tolerance = 1e-60
)

Arguments

y

gene expression matrix

neighbors

adjacency matrix between cells

numnei

a vector containing number of neighbors per cell

blocks

a list of cell colors for deciding the order of cell update

beta

the beta to try (smoothness parameter)

mu

a 2D matrix (i,j) of cluster mean (initialization)

sigma

a 3D matrix (i,j,k) where (i,j) is the covariance of cluster k (initialization)

err

the error that is allowed between successive iterations

maxit

maximum number of iterations

verbose

TRUE or FALSE

dampFactor

the dampening factor

forceDetectDamp

will auto detect a dampening factor instead of using the specified one

tolerance

applicable when forceDetectDamp is set to TRUE

Value

A list of prob, new mu, new sigma, unnormalized prob after iterations finish

More information

Arguments mu and sigma refer to the cluster centroids from running kmeans algorithm. They serve as initialization of HMRF. Users should refer to smfishHmrf.hmrfem.multi.it.min for more information about function parameters and the requirements.

References

Zhu Q, Shah S, Dries R, Cai L, Yuan G (2018-Dec-01). “Identification of spatially associated subpopulations by combining scRNAseq and sequential fluorescence in situ hybridization data.” Nature Biotechnology, 36, 1183–1190. doi: 10.1038/nbt.4260.

Examples

    data(seqfishplus)
    s <- seqfishplus
    res<-smfishHmrf.hmrfem.multi(s$y, s$nei, s$numnei, s$blocks, beta=28, 
    mu=s$mu, sigma=s$sigma, err=1e-7, maxit=50, verbose=TRUE, dampFactor=s$damp, 
    tolerance=1e-5)

[Package smfishHmrf version 0.1 Index]