Simulate Allele Counts for Single Individual - Simple Approach
Source:R/sim.ind.simple.R
sim.ind.simple.RdThis function is used to simulate coverage of each allele at biallelic heterozygous sites assuming a binomial distribution.
Arguments
- mvec
Vector of means.
- cover
Coverage of sites.
- s.size
Number of biallelic sites to generate. Defaults to 50000. Warning, the number of sites generated will not be the number of sites returned due to filtering steps.
- sampled
Default as TRUE. Will randomly sample allele A or allele B, then return a data frame with total coverage and coverage of a randomly sampled allele will be returned.
Value
If sampled = FALSE, a data frame with total coverage, coverage of allele A, and coverage of allele B will be returned. If sampled = TRUE, a data frame with total coverage and coverage of a randomly sampled allele will be returned.
Examples
xm <- sim.ind.simple(mvec = c(0.5), s.size = 100)