multiple_images_with_immune_rings: Simulate multiple images with immune rings

View source: R/multiple_images_with_immune_rings.R

multiple_images_with_immune_ringsR Documentation

Simulate multiple images with immune rings

Description

Generate a set of images with different immune ring properties. 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.

Usage

multiple_images_with_immune_rings(
  bg_sample = bg1,
  cluster_size = 200,
  ring_shape = 1,
  prop_infiltration = 0,
  ring_width = seq(50, 100, 10),
  cluster_loc_x = 0,
  cluster_loc_y = 0,
  prop_ring_infiltration = seq(0, 0.2, 0.05),
  plot_image = TRUE,
  plot_categories = NULL,
  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.

cluster_size

Numeric Vector. The size of the cluster. If numeric, all simulated images have the same cluster size. If vector, images with a range of different cluster sizes will be simulated. The size should not exceed the limit of the image sides.

ring_shape

Number. Choose from one of the following pre-designed shapes (1,2 or 3). The pre-designed shape contains information of the cell names of the cluster, the infiltration cell types, the proportions of infiltration, the cluster size, the ring width, the proportions of infiltrated cells into immune rings and the cluster centre locations. In order to simulate a set of images, use the arguments below to specify the ranges of the properties. The predefined cell types can not be changed, while users can change them manually after the simulation.

prop_infiltration

Numeric Vector. The degree of infiltration. If numeric, all simulated images have the same infiltration degree. If vector, images with a range of different infiltration proportions will be simulated.

ring_width

Numeric Vector. The width of the immune ring. If numeric, all simulated images have the same ring width. If vector, images with a range of different ring widths will be simulated.

cluster_loc_x

Numeric or Vector. The X location of the cluster center offset. If numeric, all simulated images have the same center X location. If vector, images with a range of different center locations will be simulated.

cluster_loc_y

Numeric or Vector of the same length of cluster_loc_x. The Y location of the cluster center offset.

prop_ring_infiltration

Numeric or Vector. The degree of tumour infiltration in the region of immune rings.

plot_image

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

plot_categories

String Vector specifying the order of the cell cateories to be plotted. Default is NULL - the cell categories under the "Cell.Type" column would be used for plotting.

plot_colours

String Vector specifying the order of the colours that correspond to the plot_categories arg. Default is NULL - the predefined colour vector would be used for plotting.

Value

A list of spe objects

See Also

multiple_background_images for simulating multiple mixed background images, and multiple_images_with_clusters for simulating multiple images with clusters.

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

Examples

set.seed(610)
ring_image_list <- multiple_images_with_immune_rings(bg_sample = bg1,
ring_shape = 1, prop_infiltration = 0, ring_width = seq(50,100,10),
cluster_size = 200, cluster_loc_x = 0, cluster_loc_y = 0,
prop_ring_infiltration = seq(0, 0.2,0.05), plot_image = TRUE)

TrigosTeam/spaSim documentation built on May 25, 2023, 4:20 p.m.