% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils_quantgen.R
\name{simulGenosDoseStruct}
\alias{simulGenosDoseStruct}
\title{Simulate SNP genotypes}
\usage{
simulGenosDoseStruct(
  nb_genos = c(100, 120, 80),
  nb_snps = 1000,
  div_pops = diag(3) * 0.5 + 0.5,
  geno_IDs = NULL,
  snp_IDs = NULL
)
}
\arguments{
\item{nb_genos}{number of genotypes (i.e. individuals) per population}

\item{nb_snps}{number of SNPs}

\item{div_pops}{matrix of divergence among populations, with a diagonal of 1's; the closer off-diagonal values are from 1; the weaker the divergence; the further, the stronger}

\item{geno_IDs}{vector of genotype identifiers (if NULL, will be "geno001", etc)}

\item{snp_IDs}{vector of SNP identifiers (if NULL, will be "snp001", etc)}
}
\value{
matrix with genotypes in rows and SNPs in columns
}
\description{
Simulates SNP genotypes as allele dose additively encoded, i.e. 0,1,2, using correlated allele frequencies to mimick genetic structure.
}
\examples{
## weak divergences among populations:
weak_div_pops <- diag(3)
weak_div_pops[upper.tri(weak_div_pops)] <- 0.9
weak_div_pops[lower.tri(weak_div_pops)] <- weak_div_pops[upper.tri(weak_div_pops)]
weak_div_pops

## strong divergences among populations:
strong_div_pops <- diag(3)
strong_div_pops[upper.tri(strong_div_pops)] <- 0.5
strong_div_pops[lower.tri(strong_div_pops)] <- strong_div_pops[upper.tri(strong_div_pops)]
strong_div_pops

M <- simulGenosDoseStruct(div_pops=weak_div_pops)
A <- estimGRM(M)
imageMat(A, "Weak divergence")

M <- simulGenosDoseStruct(div_pops=strong_div_pops)
A <- estimGRM(M)
imageMat(A, "Strong divergence")
}
\seealso{
\code{\link{estimGRM}}
}
\author{
Timothee Flutre thanks to code from Andres Legarra
}
