GenerateCellPositivity {scSpatialSIM}R Documentation

Generate Cell Positivity

Description

Generate the probability of a cell being positive given a set of simulation parameters for each file in a SpatSimObj.

Usage

GenerateCellPositivity(
  sim_object,
  k = NA,
  xmin = NA,
  xmax = NA,
  ymin = NA,
  ymax = NA,
  sdmin = 1/2,
  sdmax = 2,
  probs = c(0, 1),
  Force = FALSE,
  density_heatmap = FALSE,
  step_size = 1,
  cores = 1,
  shift = 0,
  random = FALSE,
  overwrite = FALSE,
  use_window = FALSE,
  no_kernel = FALSE
)

Arguments

sim_object

A SpatSimObj object containing the simulated data.

k

An integer specifying the number of clusters for each simulated patterns

xmin

A numeric value specifying the minimum x value for the kernel.

xmax

A numeric value specifying the maximum x value for the kernel.

ymin

A numeric value specifying the minimum y value for the kernel.

ymax

A numeric value specifying the maximum y value for the kernel.

sdmin

A numeric value specifying the minimum standard deviation for the kernel.

sdmax

A numeric value specifying the maximum standard deviation for the kernel.

probs

Either a vector of c(low probability, high probability) for all cell types or data frame where each row is the low and high probabilities for the cell type. If data frame, number of rows must equal number of cells

Force

A logical value indicating whether to force simulation parameters to be within the simulation window limits.

density_heatmap

A logical value indicating whether to compute a density heatmap for each cell.

step_size

A numeric value specifying the step size for the grid of points within the window.

cores

An integer value specifying the number of cores to use for parallel computation.

shift

A value between 0 and 1 for how related a second or more cell type is to the first

random

whether or not to randomly generate kernels for cells 2 or more, uf TRUE, shift is not used

overwrite

boolean whether to overwrite existing cell kernels and assignments if present

use_window

boolean whether to use the simulation window to set x and y limits

no_kernel

boolean whether to create kernels or to randomly assign points positive based on probs

Details

The function generates the probability of a cell being positive given a set of simulation parameters f or each file in a scSpatialSIM object. It creates a kernel parameter list for k clusters in each simulated pattern and computes the probability of each point in the grid of points within the window for each cell. The function also computes a density heatmap for each cell if density_heatmap is set to TRUE.

Value

Returns the original scSpatialSIM object with additional generated data added to each cell object.


[Package scSpatialSIM version 0.1.3.3 Index]