- tissue
(Required). A data frame or a list of data frames. One for each image.
Each row represent a cell with its image ID, X, Y coordinates on the image, celltype,
with column names (image, X, Y, type), respectively. You may add another column
Y2 for 3D tissue image.
- ntopics
(Required). Number of topics. Topics will be obtained as distributions
of cell types.
- sigma
Default is 50. The lengthscale of the Nearest-neighbor Exponential Kernel.
Sigma controls the strength of decay of correlation with distance in the kernel function.
Please check the paper for more information.
Need to be adjusted based on the image resolution
- region_radius
Default is 400. The radius for each grid square when
sampling region centers for each image.
Need to be adjusted based on the image resolution and pattern complexity.
- kneigh
Default is 5. Only consider the top 5 closest region centers for each cell.
- npoints_selected
Default is 1. Number of points sampled for each grid square
when sampling region centers for each image. Used with region_radius
.
- ini_LDA
Default is TRUE. Use warm start strategy for initialization and choose the best one
to continue. If 0, it simply uses the first initialization.
- ninit
Default is 10. Number of initialization.
Only retain the initialization with the highest log likelihood (perplexity).
- niter_init
Default is 100. Warm start with 100 iterations in the Gibbs sampling
during initialization.
- beta
Default is 0.05. A hyperparameter to control the sparsity of topic content
(topic-celltype) matrix Beta
. A smaller value introduces more sparse in Beta
.
- alpha
Default is 0.01. A hyperparameter to control the sparsity of document (region) content
(region-topic) matrix Theta
. For our application, we keep it
very small for the sparsity in Theta
.
- trace
Default is FALSE. Compute and save log likelihood, Ndk
, Nwk
for every posterior samples. Useful when you want to use DIC to select number of
topics, but it is time consuming to compute the likelihood for every posterior samples.
- seed
Default is 123. Random seed.
- thin
Default is 20. Key parameter in Gibbs sampling.
Collect a posterior sample for every thin=20 iterations.
- burnin
Default is 1000. Key parameter in Gibbs sampling.
Start to collect posterior samples after 1000 iterations. You may increase
the number of iterations for burn-in for highly complex tissue images.
- niter
Default is 200. Key parameter in Gibbs sampling.
Number of posterior samples collected for model inference.
- display_progress
Default is TRUE. Display the progress bar.
- do.parallel
Default is FALSE. Use parallel computing through R package foreach
.
- n.cores
Default is 1. Number of cores used in parallel computing.
- axis
Default is "2D". You may switch to "3D" for 3D tissue images.
However, the model inference for 3D tissue is still under test.