Skip to contents

Combine multiple mock objects into a single mock object.

Usage

combine_mock(
  list_mock_obj,
  min_replicates,
  max_replicates,
  sequencing_depth = NULL
)

Arguments

list_mock_obj

List of mock objects to combine.

min_replicates

Minimum number of replicates (mandatory when generate_counts = TRUE). If min_replicates is different from max replicates, the number of replicates is randomly selected from a uniform distribution between min and max replicates.

max_replicates

Maximum replicates number (mandotory only if generate_counts = TRUE) If min_replicates is different from max replicates, the number of replicates is randomly selected from a uniform distribution between min and max replicates.

sequencing_depth

Sequencing depth parameter (optional, default NULL).

Value

A combined mock object containing various simulated data.

Examples

input_var_list <- init_variable(name = "varA", sd = 0.2, level = 3) 
#> Variable name should not contain digits, spaces, or special characters.
#> If any of these are present, they will be removed from the variable name.
## -- simulate RNAseq data
mock_data_1 <- mock_rnaseq(input_var_list,
                        n_genes = 10,
                        min_replicates = 4,
                        max_replicates = 4,
                        generate_counts = FALSE)
input_var_list <- init_variable(name = "varA", sd = 0.6, level = 3) 
#> Variable name should not contain digits, spaces, or special characters.
#> If any of these are present, they will be removed from the variable name.
## -- simulate RNAseq data
mock_data_2 <- mock_rnaseq(input_var_list,
                        n_genes = 10,
                        min_replicates = 4,
                        max_replicates = 4,
                        generate_counts = FALSE)                       
list_mock_obj <- list(mock_data_1, mock_data_2)
mock_data_cbine <- combine_mock(list_mock_obj, 4, 4, sequencing_depth = 1e6)
#> INFO: length(list_mock_obj): 2
#> Building mu_ij matrix
#> INFO: The length of the sequencing_depth vector is shorter than the number of samples. Values will be recycled.
#> Scaling count table according to sequencing depth: Done
#> INFO: Scaling counts by sequencing depth may exhibit some randomness due to certain parameter combinations, resulting in erratic behavior. This can be minimized by simulating more genes. We advise verifying the simulated sequencing depth to avoid drawing incorrect conclusions.
#> k_ij ~ Nbinom(mu_ij, dispersion)
#> Counts simulation: Done