Description Usage Arguments Value Author(s) See Also Examples
View source: R/simulate_pheno.R
This function samples causal variants from a reference set of variants, and simulates phenotypes based on genotypes, enviromnental variables, and confounding factors.
1 2 | simu_pheno(genotype, confounder, environment = NULL, ref.set, ncausal,
effect.size, gxe)
|
genotype |
an n by p matrix of SNP genotypes where n is the number of individuals (rows) and p is the number of SNPs (columns). |
confounder |
an object of class "confounder" created with |
environment |
an environmental vector created |
ref.set |
a set of weakly linked reference SNPs created with |
ncausal |
number of causal variants in the simulation. |
effect.size |
effect size for causal variants in the simulation. |
gxe |
intensity of gene by environment interaction in the simulation. |
A subset of 'ncausal' causal variants and a vector of phenotypes.
causal.set subset of 'ncausal' causal variants.
phenotype vector of phenotypes.
Olivier François
create_refset
create_factor
get_climate
1 2 3 4 5 6 7 8 9 10 11 12 13 | library(naturalgwas)
## Load A. thaliana example
data(A.thaliana)
env <- get_climate(A.thaliana$coord)
confounder <- create_factor(A.thaliana$genotype, K = 20)
ref.set <- create_refset(A.thaliana$chrpos, window = 101)
sim.ph <- simu_pheno(A.thaliana$genotype,
confounder,
env, ref.set,
ncausal = 8,
effect.size = 20,
gxe = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.