View source: R/simulate_mixing.R
| simulate_mixing | R Documentation |
Based on an existing background image, simulate mixed cell types with specified cell types and proportions. The default values for the arguments give an example of mixed cell type simulation which enable an automatic simulation of mixed cell types without the specification of any argument.
simulate_mixing(
bg_sample = bg1,
idents = c("Tumour", "Immune", "Others"),
props = c(0.2, 0.4, 0.4),
plot_image = TRUE,
plot_colours = NULL
)
bg_sample |
(OPTIONAL) A data frame or |
idents |
String Vector of the mixed cell types. |
props |
Numeric Vector of the proportions of the mixed cell types. |
plot_image |
Boolean. Whether the simulated image is plotted. |
plot_colours |
String Vector specifying the order of the colours that
correspond to the |
A data.frame of the simulated image
simulate_background_cells for all cell simulation,
simulate_clusters for cluster simulation,
simulate_immune_rings/simulate_double_rings for
immune ring simulation, and simulate_stripes for vessel
simulation.
Other simulate pattern functions:
simulate_background_cells(),
simulate_clusters(),
simulate_double_rings(),
simulate_immune_rings(),
simulate_stripes()
set.seed(610)
mix_background <- simulate_mixing(bg_sample=bg1,
idents=c("Tumour","Immune", "Others"), props=c(0.2, 0.4, 0.4),
plot_image=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.