Run initialzation for HMRF model
initHMRF_V2(
gobject,
expression_values = c("scaled", "normalized", "custom"),
spatial_network_name = "Delaunay_network",
use_spatial_genes = c("binSpect", "silhouetteRank"),
gene_samples = 500,
gene_sampling_rate = 2,
gene_sampling_seed = 10,
gene_sampling_from_top = 2500,
filter_method = c("none", "elbow"),
user_gene_list = NULL,
use_score = FALSE,
hmrf_seed = 100,
k = 10,
tolerance = 1e-05,
zscore = c("none", "rowcol", "colrow"),
nstart = 1000,
factor_step = 1.05
)
giotto object
expression values to use
name of spatial network to use for HMRF
which of Giotto's spatial genes to use
number of spatial gene subset to use for HMRF
parameter (1-50) controlling proportion of gene samples from different module when sampling, 1 corresponding to equal gene samples between different modules; 50 corresponding to gene samples proportional to module size.
random number seed to sample spatial genes
total spatial genes before sampling
filter genes by top or by elbow method, prior to sampling
user-specified genes (optional)
use score as gene selection criterion (applies when use_spatial_genes=silhouetteRank)
random number seed to generate initial mean vector of HMRF model
number of HMRF domains
error tolerance threshold
number of Kmeans initializations from which to select the best initialization
dampened factor step
A list (see details)
There are two steps to running HMRF. This is the first step, the initialization. First, user specify which of Giotto's spatial genes to run, through use_spatial_genes. Spatial genes have been stored in the gene metadata table. A first pass of genes will filter genes that are not significantly spatial, as determined by filter_method. If filter_method is none, then top 2500 (gene_sampling_from_top) genes ranked by pvalue are considered spatial. If filter_method is elbow, then the exact cutoff is determined by the elbow in the -log10Pvalue vs. gene rank plot. Second, the filtered gene set is subject to sampling to select 500 (controlled by gene_samples) genes for running HMRF. Third, once spatial genes are finalized, we are ready to initialize HMRF. This consists of running a K-means algorithm to determine initial centroids (nstart, hmrf_seed) of HMRF. The initialization is then finished. This function returns a list containing y (expression), nei (neighborhood structure), numnei (number of neighbors), blocks (graph colors), damp (dampened factor), mu (mean), sigma (covariance), k, genes, edgelist. This information is needed for the second step, doHMRF.