Learn R Programming

dyngen (version 0.4.0)

generate_experiment: Sample cells from the simulations

Description

generate_experiment() runs samples cells along the different simulations. experiment_snapshot() assumes that cells are sampled from a heterogeneous pool of cells. Cells will thus be sampled uniformily from the trajectory. experiment_synchronised() assumes that all the cells are synchronised and are sampled at different timepoints.

Usage

generate_experiment(model)

list_experiment_samplers()

experiment_snapshot( realcount = NULL, sample_capture_rate = function(n) rnorm(n, 1, 0.05) %>% pmax(0), weight_bw = 0.1 )

experiment_synchronised( realcount = NULL, sample_capture_rate = function(n) rnorm(n, 1, 0.05) %>% pmax(0), num_timepoints = 8, pct_between = 0.75 )

Arguments

model

A dyngen intermediary model for which the simulations have been run with generate_cells().

realcount

The name of a dataset in realcounts. If NULL, a random dataset will be sampled from realcounts.

sample_capture_rate

A function that samples values for the simulated capture rates of genes.

weight_bw

[snapshot] A bandwidth parameter for determining the distribution of cells along each edge in order to perform weighted sampling.

num_timepoints

[synchronised] The number of time points used in the experiment.

pct_between

[synchronised] The percentage of 'unused' simulation time.

Value

A dyngen model.

Examples

Run this code
# NOT RUN {
names(list_experiment_samplers())

model <- 
  initialise_model(
    backbone = backbone_bifurcating(),
    experiment = experiment_synchronised()
  )

# }
# NOT RUN {
model <- 
  model %>%
  generate_tf_network() %>%
  generate_feature_network() %>%
  generate_kinetics() %>%
  generate_gold_standard() %>%
  generate_cells() %>%
  generate_experiment() 
  
dataset <- wrap_dataset(model)
# }

Run the code above in your browser using DataLab