Chapter 4 Simulating Phenotypes

4.1 Phenotypic data simulation of high and low heritability traits

In this section, phenotypes are simulated since this allows us to explain conceptually how different trait heritabilities affect power to detect signals in GWAS. The simplePhenotypes R package is used to simulate phenotypic data.

More information about simplePhenotypes can be found here along with a short vignette here.

The R packages used in this section are simplePHENOTYPES (Fernandes and Lipka 2020), data.table (Dowle and Srinivasan 2020), and tidyverse (Wickham 2019).

Load packages

Set working directory to where subset hapmap file is in workshop materials

Simulate QTL for high and low heritability trait

The code below simulates two phenotypes, each controlled by the same 4 QTL. Effect sizes range from 0.3 to 1.1. Traits simulated are a high heritability trait (0.75) and a low heritability trait (0.25) assuming an additive only model without epistasis or dominance.

Read in simulated data

Write the dataframe of simulated data

Take a look at the simulated QTL

Here are the same simulated QTL in a table format and some additional information

References

Dowle, Matt, and Arun Srinivasan. 2020. Data.table: Extension of ‘Data.frame‘. https://CRAN.R-project.org/package=data.table.

Fernandes, Samuel, and Alexander Lipka. 2020. SimplePHENOTYPES: Simulation of Pleiotropic, Linked and Epistatic Phenotypes. https://github.com/samuelbfernandes/simplePHENOTYPES.

Wickham, Hadley. 2019. Tidyverse: Easily Install and Load the Tidyverse. https://CRAN.R-project.org/package=tidyverse.