Generate Characteristic Distributions of Cells
Source:R/cell_distributions.R
GenerateDistributions.Rd
Generate Characteristic Distributions of Cells
Usage
GenerateDistributions(
spatial_data,
positive_mean = 10,
negative_mean = 2,
positive_sd = 2,
negative_sd = 1
)
Arguments
- spatial_data
object of either class
list
ordata.frame
. Can be created fromSpatSimObj
withCreateSpatialList
- positive_mean, negative_mean
number for mean of which to center the distribution of the positive and negative cell types. Can be single number of vector with length matching number of Cells.
- positive_sd, negative_sd
number for the standard deviation around the positive cell type mean. Can be single value or same length as number of Cells.
Value
object with a class that is the same as input spatial_data
with new columns containing distributions for positive/negative assigned cells
Examples
#create simulation object
spatial_data = CreateSimulationObject(sims = 1, cell_types = 1) %>%
#produce the point pattern
GenerateSpatialPattern() %>%
#make tissues
GenerateTissue(density_heatmap = FALSE, step_size = 0.1, cores = 1) %>%
#create positive and negative cells
GenerateCellPositivity(k = 4, sdmin = 3, sdmax = 5,
density_heatmap = FALSE, step_size = 1, cores = 1, probs = c(0.0, 0.1), shift = 0) %>%
#convert to a list of spatial data frames
CreateSpatialList(single_df = FALSE)
#> No `window` specified - defaulting to x (0, 10); y (0, 10)
#> Computing tissue probability
#>
| | 0%, ETA NA
|=======================================================| 100%, Elapsed 00:02
#> Computing probability for Cell 1
#>
| | 0%, ETA NA
|=======================================================| 100%, Elapsed 00:01
#>
| | 0%, ETA NA
|=======================================================| 100%, Elapsed 00:00
spat_data_distribution = GenerateDistributions(spatial_data)
#>
| | 0%, ETA NA
|=======================================================| 100%, Elapsed 00:00