simulate_sites.Rd 1.44 KB
 Eric Coissac committed Oct 19, 2018 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 % Generated by roxygen2: do not edit by hand % Please edit documentation in R/simulate.R \name{simulate_sites} \alias{simulate_sites} \title{Simulate the shotgun sequencing of a diploid loci.} \usage{ simulate_sites(haplotype.1, haplotype.2, coverage, error) } \arguments{ \item{haplotype.1}{character; the first haplotype A, C, G or T of the locus.} \item{haplotype.2}{character; the second haplotype A, C, G or T of the locus.} \item{coverage}{numeric; the average sequencing depth of the sequencing.} \item{error}{numeric 4 x 4 matrix; the error matrix as produced by the \code{\link{error_jc}} function} } \value{ a tibble with seven columns. \code{haplotype.1} and \code{haplotype.2} are both the true happlotypes at the given locus. \code{haplotype.1} is by convention always lexicographically smaller than \code{haplotype.2}. \code{coverage} the actual sequencing depth at that locus. It a random number drawn from a Poisson distribution of mean \code{coverage}. \code{A}, \code{C}, \code{G}, \code{T} the simulated observation of each nucleotide after the sequencing. } \description{ Build a contengency table of observed nucleotide for a given site after its sequencing. } \examples{ simulate_sites(c("A","C","T"), c("A","G","G"), coverage=10, error = error_jc(0.1)) } \seealso{ \code{\link{error_jc}} } \author{ Eric Coissac }