simu_pheno: Simulate phenotypes based on genotypes.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/simulate_pheno.R

Description

This function samples causal variants from a reference set of variants, and simulates phenotypes based on genotypes, enviromnental variables, and confounding factors.

Usage

1
2
simu_pheno(genotype, confounder, environment = NULL, ref.set, ncausal,
  effect.size, gxe)

Arguments

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 create_factor.

environment

an environmental vector created get_climate.

ref.set

a set of weakly linked reference SNPs created with create_refset.

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.

Value

A subset of 'ncausal' causal variants and a vector of phenotypes.

causal.set subset of 'ncausal' causal variants.

phenotype vector of phenotypes.

Author(s)

Olivier François

See Also

create_refset create_factor get_climate

Examples

 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)

bcm-uga/NaturalGWAS documentation built on Dec. 18, 2019, 12:36 a.m.