Generate dataset for vignettes and simulation studies

simulate_data(
  n_markers = 5,
  n_true = 1,
  n_samples = 8,
  paired = TRUE,
  n_cells = 100,
  pi = 0.05,
  beta_treatment = log(20),
  beta_control = log(5),
  rho_b = 0.5,
  rho_u = 0.5
)

Arguments

n_markers

number of markers

n_true

number of differential markers

n_samples

donors per group

paired

paired experimental design

n_cells

per sample

pi

zero inflation probability

beta_treatment

log of mean in treatment

beta_control

log of mean in control

rho_b

cell level correlation

rho_u

donor level correlation

Value

tibble data frame

Examples

set.seed(1)
df = simulate_data(n_cells = 10)
str(df)
#> tibble [80 × 7] (S3: tbl_df/tbl/data.frame)
#>  $ donor    : chr [1:80] "pid01" "pid01" "pid01" "pid01" ...
#>  $ condition: Factor w/ 2 levels "control","treatment": 2 2 2 2 2 2 2 2 2 2 ...
#>  $ m01      : num [1:80] 80 6 6 3 17 20 14 90 79 46 ...
#>  $ m02      : num [1:80] 21 3 4 1 1 9 40 17 24 0 ...
#>  $ m03      : num [1:80] 6 2 12 49 3 8 14 6 0 4 ...
#>  $ m04      : num [1:80] 4 0 11 10 0 2 22 8 14 13 ...
#>  $ m05      : num [1:80] 12 0 3 0 0 1 1 4 1 1 ...
df
#> # A tibble: 80 × 7
#>    donor condition   m01   m02   m03   m04   m05
#>    <chr> <fct>     <dbl> <dbl> <dbl> <dbl> <dbl>
#>  1 pid01 treatment    80    21     6     4    12
#>  2 pid01 treatment     6     3     2     0     0
#>  3 pid01 treatment     6     4    12    11     3
#>  4 pid01 treatment     3     1    49    10     0
#>  5 pid01 treatment    17     1     3     0     0
#>  6 pid01 treatment    20     9     8     2     1
#>  7 pid01 treatment    14    40    14    22     1
#>  8 pid01 treatment    90    17     6     8     4
#>  9 pid01 treatment    79    24     0    14     1
#> 10 pid01 treatment    46     0     4    13     1
#> # … with 70 more rows