simulate_expression_pattern_sas | R Documentation |
Simulates expression patterns by modelling expression dependent on the distance to a spatial annotation.
simulate_expression_pattern_sas(
object,
ids,
simulations,
core,
distance = "dte",
resolution = recSgsRes(object),
angle_span = c(0, 360),
noise_levels = seq(0, 100, length.out = 21),
noise_types = c("ed", "ep", "fp", "cb"),
range_sim = c(0, 1),
range_random = base::range(range_sim),
model_add = NULL,
model_remove = NULL,
seed = 123,
npref = "SE",
nsep = ".",
verbose = TRUE
)
simulate_expression_pattern_sts(
object,
id,
simulations,
width,
resolution = recSgsRes(object),
noise_levels = seq(0, 100, length.out = 21),
noise_types = c("ed", "ep", "fp", "cb"),
range_sim = c(0, 1),
range_random = base::range(range_sim),
model_add = NULL,
seed = 123,
npref = "SE",
nsep = ".",
verbose = TRUE
)
simulate_random_expression(
object,
n_total,
range_sim = c(0, 1),
seed = 123,
naming = "SE.RANDOM.{i}",
verbose = TRUE
)
object |
An object of class |
ids |
Character vector. Specifies the IDs of the spatial annotations of interest. |
simulations |
A list of simulation lists. A simulations list is a list that contains at least three slots that provide instructions for a set of simulations:
A simulation list can have an additional slot called noise_levels which,
if present, overwrites the input for |
distance |
|
resolution |
Distance measure. The resolution
with which the expression gradient is inferred. Defaults are platform specific.
See more in detail section of |
angle_span |
Numeric vector of length 2. Confines the area screened by an angle span relative to the center of its closest spatial annotation. |
noise_levels |
A vector of integers between 0-100 (inclusive). Indicate the respective levels of noise to be added to each simulation in percent. 0 indicates no noise. 100 indicates only noise. |
range_sim |
The range of the output simulation values. |
range_random |
The range of the values randomly assigned to areas outside of the area of interest. |
model_add |
Named list. Every slot in the list must be either a formula
containing a function that takes a numeric vector as input and returns a numeric
vector with the same length as its input vector. Or a numeric vector with the
same length as the input vector. Test models with |
model_remove |
Character value. Used as a regex to remove models are not supposed to be included. |
seed |
Numeric value, given to |
npref |
Prefix for the simulations. Defaults to SG (simulated gene.) |
nsep |
Character value with which to separate the aspects that build the name of each simulation. |
verbose |
Logical. If (Warning messages will always be printed.) |
Simulation names are created according to the function call
stringr::str_c(npref, nsep, "NP", nl, nsep, sim_id, nsep, n, sep = "")
.
Where nl
is the noise level of the simulation, sim_id
corresponds to
the slot id of the simulation list and n
is the index of the simulation
in case slot n of the simulation instruction is bigger than one.
Matrix with rownames corresponding to the simulation names and colnames corresponding to the barcodes of the object.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.