View source: R/generate_data.R
generate_snps | R Documentation |
This function generates SNPs under Hardy-Weinberg equilibrium with specific block correlation structure and minor allele frequencies.
generate_snps(
n,
p,
cor_type = NULL,
vec_rho = NULL,
vec_maf = NULL,
n_cpus = 1,
user_seed = NULL
)
n |
Number of observations. |
p |
Number of SNPs. |
cor_type |
String describing the type of dependence structure. The SNPs
can |
vec_rho |
Vector of correlation coefficients. Its length determines the
number of blocks of correlated SNPs. Must be smaller than p. Set to
|
vec_maf |
Vector of length p containing the reference minor allele
frequencies used to generate the SNPs. If |
n_cpus |
Number of CPUs used when simulating correlated SNP blocks. Ignored if independent SNPs. Set to 1 for serial execution. |
user_seed |
Seed set for reproducibility. Default is |
An object of class "sim_snps
".
snps |
Matrix containing the generated SNP data. |
vec_maf |
Vector containing the SNP sample minor allele frequencies. |
convert_snps
, replicate_real_snps
,
convert_phenos
, generate_phenos
,
replicate_real_phenos
, generate_dependence
user_seed <- 123; set.seed(user_seed)
n <- 500; p <- 10000
cor_type <- "autocorrelated"; vec_rho <- runif(100, min = 0.25, max = 0.95)
list_snps <- generate_snps(n, p, cor_type, vec_rho, n_cpus = 1,
user_seed = user_seed)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.