R/simulator.R
simulate_sample_genotype.Rd
Simulate sample genotype
simulate_sample_genotype(sample_cois, locus_allele_dist, internal_relatedness)
Numeric vector indicating the multiplicity of infection for each biological sample
Allele frequencies – simplex parameter of a multinomial distribution
numeric 0-1 indicating the probability for a strain's allele to come from an existing lineage within host
List with one element per sample, each a 1-row integer matrix counting the number of distinct strains carrying each allele.
Simulates sampling the genetics at a single locus given an allele frequency distribution and a vector of sample COIs
simulate_sample_genotype( sample_cois = c(1, 2, 3), locus_allele_dist = c(0.5, 0.3, 0.2), internal_relatedness = c(0, 0, 0.5) ) #> [[1]] #> [,1] [,2] [,3] #> [1,] 0 0 1 #> #> [[2]] #> [,1] [,2] [,3] #> [1,] 0 1 1 #> #> [[3]] #> [,1] [,2] [,3] #> [1,] 1 0 0 #>