Skip to contents

This function generates input data for simulation based on the coefficients provided in the list_var argument.

Usage

getInput2simulation(
  list_var,
  n_genes = 1,
  normal_distr = "univariate",
  input2mvrnorm = NULL
)

Arguments

list_var

A list of variables (already initialized)

n_genes

Number of genes to simulate (default: 1)

normal_distr

Specifies the distribution type for generating effects. Choose between 'univariate' (default) or 'multivariate' .

  • 'univariate': Effects are drawn independently from univariate normal distributions.

  • 'multivariate': Effects are drawn jointly from a multivariate normal distribution. (not recommended)

input2mvrnorm

Input to the mvrnorm function for simulating data from multivariate normal distribution (default: NULL)

Value

A data frame with input coefficients for simulation

Examples

# Example usage
list_var <- init_variable()
#> Variable name should not contain digits, spaces, or special characters.
#> If any of these are present, they will be removed from the variable name.
getInput2simulation(list_var, n_genes = 10)
#>    geneID label_myVariable  myVariable
#> 1   gene1      myVariable1 -0.03552641
#> 2   gene1      myVariable2  0.40487235
#> 3   gene2      myVariable1  0.12688374
#> 4   gene2      myVariable2  0.23169745
#> 5   gene3      myVariable1  0.25810720
#> 6   gene3      myVariable2 -0.02889902
#> 7   gene4      myVariable1 -0.05034306
#> 8   gene4      myVariable2  0.24963461
#> 9   gene5      myVariable1  0.02861493
#> 10  gene5      myVariable2 -0.27706597
#> 11  gene6      myVariable1  0.16892178
#> 12  gene6      myVariable2  0.03055448
#> 13  gene7      myVariable1  0.01286513
#> 14  gene7      myVariable2  0.17225275
#> 15  gene8      myVariable1 -0.05466025
#> 16  gene8      myVariable2  0.11212587
#> 17  gene9      myVariable1  0.25815370
#> 18  gene9      myVariable2  0.30484315
#> 19 gene10      myVariable1 -0.12407260
#> 20 gene10      myVariable2  0.10107714