simulate_droplet_counts: Simulating ddPCR data

Description Usage Arguments Value Examples

View source: R/simulate_data.R

Description

Functions for simulating data from the statistical model underlying the castle package.

Usage

1
2
3
simulate_droplet_counts(l, r, a, b, c, n_drops, n_samples = 1)

simulate_molecule_counts(l, r, a, b, c, n_drops)

Arguments

l

Numeric value. Concentration of wild type DNA (molecules/droplet).

r

Numeric value. Concentration of mutant DNA (molecules/droplet).

a, b, c

Numeric values. Error rate parameters for the statistical model.

n_drops

Integer value. The number of droplets to simulate in each sample.

n_samples

Integer value. The number of samples to simulate.

Value

Simulated droplet/molecule counts as data.frame.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Simulate droplet counts

# Single cancer negative sample (r = 0)
simulate_droplet_counts(1, 0, 0.01, 0.01, 0.01, 14000)

# Multiple cancer positive samples (r = 0.1)
simulate_droplet_counts(1, 0.1, 0.01, 0.01, 0.01, 14000, 10)


# Simulate molecule counts for a cancer positive samples (r = 0.1)
simulate_molecule_counts(1, 0.1, 0.01, 0.01, 0.01, 14000)

simondrue/castle documentation built on Jan. 29, 2022, 3:04 a.m.