Learn R Programming

PhenotypeSimulator

PhenotypeSimulator allows for the flexible simulation of phenotypes from different genetic and non-genetic (noise) components.

In quantitative genetics, genotype to phenotype mapping is commonly realised by fitting a linear model to the genotype as the explanatory variable and the phenotype as the response variable. Other explanatory variable such as additional sample measures (e.g. age, height, weight) or batch effects can also be included. For linear mixed models, in addition to the fixed effects of the genotype and the covariates, different random effect components can be included, accounting for population structure in the study cohort or environmental effects. The application of linear and linear mixed models in quantitative genetics ranges from genetic studies in model organism such as yeast and Arabidopsis thaliana to human molecular, morphological or imaging derived traits. Developing new methods for increasing numbers of sample cohorts, phenotypic measurements or complexity of phenotypes to analyse, often requires the simulation of datasets with a specific underlying phenotype structure.

PhenotypeSimulator allows for the simulation of complex phenotypes under different models, including genetic variant effects and infinitesimal genetic effects (reflecting population structure) as well as correlated, non-genetic covariates and observational noise effects. Different phenotypic effects can be combined into a final phenotype while controlling for the proportion of variance explained by each of the components. For each component, the number of variables, their distribution and the design of their effect across traits can be customised.

Installation

Full documentation of PhenotypeSimulator is available at https://HannahVMeyer.github.io/PhenotypeSimulator/.

The current github version of PhenotypeSimulator is 0.3.4 and can be installed via

# install.packages("devtools")
devtools::install_github("HannahVMeyer/PhenotypeSimulator")

The current CRAN version of PhenotypeSimulator is 0.3.3 and can be installed via:

install.packages("PhenotypeSimulator")

A log of version changes can be found here.

Citation

Meyer, HV & Birney E (2018) PhenotypeSimulator: A comprehensive framework for simulating multi-trait, multi-locus genotype to phenotype relationships, Bioinformatics, 34(17):2951–2956

Copy Link

Version

Install

install.packages('PhenotypeSimulator')

Monthly Downloads

365

Version

0.3.4

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Hannah Meyer

Last Published

July 16th, 2021

Functions in PhenotypeSimulator (0.3.4)

correlatedBgEffects

Simulate correlated background effects.
geneticBgEffects

Simulate infinitesimal genetic effects (reflecting sample kinship).
read_lines

Scan file for specific line numbers
commaList2vector

Comma-separated string to numeric vector.
standardiseGenotypes

Standardise genotypes.
probGen2expGen

Compute expected genotypes from genotype probabilities.
simulatePhenotypes

Command line execution for PhenotypeSimulator.
rescaleVariance

Scale phenotype component.
simulateGenotypes

Simulate bi-allelic genotypes.
noiseBgEffects

Simulate observational noise effects.
addNonNulls

Add all non-NULL elements of list.
PhenotypeSimulator

PhenotypeSimulator: A package for simulating phenotypes from different genetic and noise components
readStandardGenotypes

Read genotypes from file.
testNumerics

Test lists for different properties of numerics.
simulateDist

Data simulation for different distributions.
setModel

Set simulation model.
writeStandardOutput

Write simulated data into formats used by standard GWAS software.
getCausalSNPs

Draw random SNPs from genotypes.
getKinship

Get genetic kinship.
runSimulation

Run phenotype simulation.
savePheno

Save final phenotype and phenotype components.
transformNonlinear

Phenotype transformation.
vmessage

Print userinfo.
expGen2probGen

Rewrite expected genotypes into genotype probabilities.
geneticFixedEffects

Simulate genetic variant effects.
getAlleleFrequencies

Compute allele frequencies from genotype data.
noiseFixedEffects

Simulate noise fixed effects.