Package: simulateGP 0.1.3

Gibran Hemani

simulateGP: Functions for Simulating Genotype-Phenotype Relationships

Functions for simulating SNP effects on phenotypes. Functions for simulating disease risk on probability and liability scales. Simulations to quickly obtain estimates of effect sizes for simulated genotype-phenotypes.

Authors:Gibran Hemani [aut, cre], John Ferguson [aut], Rita Rasteiro [aut]

simulateGP_0.1.3.tar.gz
simulateGP_0.1.3.zip(r-4.7-any)simulateGP_0.1.3.zip(r-4.6-any)simulateGP_0.1.3.zip(r-4.5-any)
simulateGP_0.1.3.tgz(r-4.6-any)simulateGP_0.1.3.tgz(r-4.5-any)
simulateGP_0.1.3.tar.gz(r-4.7-any)simulateGP_0.1.3.tar.gz(r-4.6-any)
simulateGP_0.1.3.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION
card.svg |card.png
simulateGP/json (API)

# Install 'simulateGP' in R:
install.packages('simulateGP', repos = c('https://mrcieu.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/explodecomputer/simulategp/issues

Pkgdown/docs site:https://explodecomputer.github.io

Datasets:
  • ldetect - Data frame of independent LD regions

On CRAN:

Conda:

geneticssimulationsstatistics

5.41 score 9 stars 238 scripts 47 exports 88 dependencies

Last updated from:dd16b78fcb (on refs/pull/6/head). Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK160
source / vignettesOK298
linux-releaseOK184
macos-releaseOK130
macos-oldrelOK109
windows-develOK81
windows-releaseOK83
windows-oldrelOK96
wasm-releaseOK155

Exports:%>%add_uallele_frequencyarbitrary_mapascertain_sampleschoose_effectscontingencycorrelated_binomialcreate_systemestimate_system_effectsexpected_mseexpected_seexpected_ssxfast_assocgenerate_gwas_paramsgenerate_gwas_ssgenerate_gwas_ss_1generate_ldobjget_effsget_ldget_population_allele_frequencyget_regions_from_ldobjdirgwasgx_to_gphap_freqsinit_parameterslor_to_rsqmake_genomake_mvdatmake_phenmerge_exp_outrange01read_ldobjdirrecode_datrecode_dat_interceptrecode_dat_simplerisk_cross_plotrisk_simulationsample_betasample_system_effectssimulate_genosimulate_haplotypessimulate_populationsummary_settest_ldobjtest_systemy_to_binary

Dependencies:askpassbase64encbslibcachemclicodetoolscowplotcpp11crosstalkcurldata.tabledigestdplyrevaluatefarverfastmapfontawesomeforeachfsgenericsgenetics.binaRiesggplot2glmnetglueGPArotationgridExtragtablegwasglue2highrhtmltoolshtmlwidgetshttrieugwasrisobanditeratorsjquerylibjsonliteknitrlabelinglaterlatticelazyevallifecyclemagrittrMASSMatrixmemoisemimemnormtMRMixMRPRESSOnlmeopensslotelpbapplypillarpkgconfigplotlypromisespsychpurrrR6RadialMRrappdirsRColorBrewerRcppRcppEigenrlangrmarkdownS7sassscalesshapestringistringrsurvivalsystibbletidyrtidyselecttinytexTwoSampleMRutf8vctrsviridisLitewithrxfunyaml

Data generating process for genetic effects on complex traits with interactions
Genetic effects | Model 1 - simple linear relationship between x and y with large numbers of instruments of small effect | Model 2 - Heterogeneous treatment effect of x on y based on covariate | Model 3 - The interacting variable from (2) is proxied by a large number of proxies | Model 4 - Heterogeneous treatment effect at the instrument level

Last update: 2026-09-30
Started: 2020-04-07

Simulating GWAS summary data
Genetic architecture | Linkage disequilibrium | Sample overlap | Synthesising sample overlap, LD and architecture

Last update: 2024-04-02
Started: 2021-03-06

Comparing SuSIE results with summary level vs individual level simulations
Compare summary level simulations against individual level simulations | Compare two different populations

Last update: 2021-06-28
Started: 2021-04-06

Background notes: Simulating GWAS summary data
Expected standard error | Sampling the effect estimate | Sampling a set of effect estimates | Sensitivitiy to HWE

Last update: 2021-04-06
Started: 2020-03-03

Simulating GWAS summary data with LD

Last update: 2021-04-06
Started: 2020-09-10

Generating LD matrices
Obtain independent LD regions | Generate LD matrix objects | Try it out for generating summary data

Last update: 2021-03-07
Started: 2021-03-06

Sample overlap in GWAS summary datasets

Last update: 2021-03-06
Started: 2020-10-11

Simple two-sample Mendelian randomisation examples
Generating summary data from individual level data | More complex example | Generating summary data directly | No sample overlap case | Sample overlap case

Last update: 2021-03-06
Started: 2021-03-04

Simulating summary data for weak instruments
Weak instrument bias | Winner's curse schematic

Last update: 2021-03-05
Started: 2020-03-12

Directly simulating summary datasets with sample overlap

Last update: 2021-03-05
Started: 2021-03-05

Simple Mendelian randomisation examples

Last update: 2021-03-05
Started: 2021-03-04

LD matrices

Last update: 2021-03-04
Started: 2021-03-04

Readme and manuals

Help Manual

Help pageTopics
simulateGP: Functions for Simulating Genotype-Phenotype RelationshipssimulateGP-package simulateGP simulategp
Add confounder variables and their instrumentsadd_u
Estimate allele frequency from SNPallele_frequency
Create an arbitrary maparbitrary_map
Ascertain some proportion of cases and controls from binary phenotypeascertain_samples
Get vector of effects that explain some amount of variancechoose_effects
Obtain 2x2 contingency table from marginal parameters and odds ratiocontingency
Simulate two correlated binomial variablescorrelated_binomial
Wrapper for simulation pipelinecreate_system
Estimate the effects of all SNPs on all phenotypesestimate_system_effects
Calculate expected MSEexpected_mse
Expected se given beta, af, n and vyexpected_se
Calculate expected SSXexpected_ssx
Get summary statistics in simple linear regressionfast_assoc
Generate SNP effects given MAF, h2 and selectiongenerate_gwas_params
Modify SNP effects to account for LDgenerate_gwas_ss
Create a GWAS summary datasetgenerate_gwas_ss_1
Generate LD matrix objects from reference panelgenerate_ldobj
Get effs for two traits and make dat formatget_effs
Get LD matrix for a specified region from bfile reference panelget_ld
Estimate the allele frequency in population from case/control summary dataget_population_allele_frequency
Determine regions from LD fileget_regions_from_ldobjdir
Perform association of many SNPs against phenotypegwas
Translate risk from liability to probability scalegx_to_gp
Estimate haplotype frequencies for two locihap_freqs
Choose initial parameters for direct effects on X and Yinit_parameters
Data frame of independent LD regionsldetect
Estimate proportion of variance of liability explained by SNP in general populationlor_to_rsq
Create genotype matrixmake_geno
Take several exposures and one outcome and make the data required for multivariable MRmake_mvdat
Simulate variable based on the influences of other variablesmake_phen
Organise outputs from 'gwas' into harmonised dat formatmerge_exp_out
Scale variable to have range between 0 and 1range01
Read in LD objects into listread_ldobjdir
Recode data to make every effect on x positiverecode_dat
Intercept recoding to have every effect on x positiverecode_dat_intercept
Simple recoding to have every effect on x positiverecode_dat_simple
Plot liability vs probability disease riskrisk_cross_plot
Make simulation to compare disease and liability scalesrisk_simulation
Sample beta values given standard errorssample_beta
Sample the actual effects based on initial parameterssample_system_effects
Simulate genotypes from haplotypessimulate_geno
Simulate haplotypes of two locisimulate_haplotypes
Simulate individual level data from initial parameterssimulate_population
General funcsstuff
Wrapper for generating a summary setsummary_set
Create test LD objecttest_ldobj
Apply MR tests to systemtest_system
Convert continuous trait to binaryy_to_binary