simulate_generator: Create datasets from generators

simulate_generatorR Documentation

Create datasets from generators

Description

Simulate the DTMC associated to the generator to create a dataset that reflects the genotypes of 'times' cells, sampled after 'time_ticks' passages.

Usage

simulate_generator(
  generator,
  time_ticks,
  times,
  starting_label = "Clonal",
  by = "labels",
  mode = "full"
)

Arguments

generator

a generator

time_ticks

number of steps (updates) of the DTMC associated to the generato

times

number of sumlated cells

starting_label

node from which to start the simulation

by

"labels" or "samples" to use gene labels or sample labels as references to identify the ‘starting_label'’s node

mode

"full" to generate a matrix with 'times' genotypes, "compacted" to *efficiently* create an already compacted dataset (a dataset showing the genotypes and their respective frequencies)

Value

the simulated dataset

Examples

require(dplyr)

example_dataset() %>%
  make_generator_stub() %>% 
  set_generator_edges(
    list(
      "D", "A, D", 1 , 
      "A", "A, D", 1 , 
      "A, D", "A, C, D", 1 , 
      "A, D", "A, B, D", 1 , 
      "Clonal", "D", 1 , 
      "Clonal", "A", 1 , 
      "D", "D", 1 , 
      "A", "A", 1 , 
      "A, D", "A, D", 1 , 
      "A, C, D", "A, C, D", 1 , 
      "A, B, D", "A, B, D", 1 , 
      "Clonal", "Clonal", 1 
  )) %>% 
  finalize_generator %>% 
  simulate_generator(3, 10)


redsnic/CIMICE documentation built on March 30, 2022, 2:46 a.m.