Generate a set of background images with different proportions of mixed cell types all at once. The default values for the arguments give an example of multiple image simulation which enable an automatic multiple image simulation without the specification of any argument.

multiple_background_images(
  bg_sample = bg1,
  idents = c("Tumour", "Immune", "Others"),
  props = list(rep(0.1, 9), seq(0, 0.4, 0.05), seq(0.9, 0.5, -0.05)),
  plot_image = TRUE,
  plot_colours = NULL
)

Arguments

bg_sample

A data frame or SpatialExperiment class object with locations of points representing background cells. Further cell types will be simulated based on this background sample. The data.frame or the spatialCoords() of the SPE object should have colnames including "Cell.X.Positions" and "Cell.Y.Positions". By default use the internal bg1 background image.

idents

String Vector. Names of the cell types to generate.

props

List. Each element is a vector of proportions of the corresponding cell type. The length of the vector is how many images to generate. All vectors should be of the same length, also equal to the number of images.

plot_image

Boolean. Whether plot the simulated images or not. Default is TRUE.

plot_colours

String Vector. If plot_image is TRUE, this param is the corresponding colours for the idents arg. Default is NULL, the predefined colour vector would be used for plotting.

Value

A list of SPE objects

See also

multiple_images_with_clusters for simulating multiple images with clusters, and multiple_images_with_immune_rings for simulating multiple images with immune rings.

Other simulate multiple images functions: multiple_images_with_clusters(), multiple_images_with_immune_rings()

Examples

idents <- c("Tumour","Immune","Others")
prop1 <- rep(0.1,9)
prop2 <- seq(0, 0.4, 0.05)
prop3 <- seq(0.9,0.5,-0.05)
set.seed(610)
bg_image_list <- multiple_background_images(bg_sample = bg1,
idents = idents, props = list(prop1, prop2, prop3), plot_image = FALSE)