Skip to contents

Simulates the observation process

Usage

simulate_observed_allele(alleles, epsilon_pos, epsilon_neg, missingness)

Arguments

alleles

A numeric vector representing the number of strains contributing each allele

epsilon_pos

expected number of false positives

epsilon_neg

expected number of false negatives

missingness

probability that the data is missing

Value

Binary numeric vector the same length as alleles indicating which alleles were observed. All zeros if the observation is missing.

Details

Takes a numeric value representing the number of strains contributing an allele and returns a binary vector indicating the presence or absence of the allele.

Examples

simulate_observed_allele(
  alleles = c(2, 0, 1),
  epsilon_pos = 0.01, epsilon_neg = 0.1, missingness = 0
)
#> [1] 1 0 1