MyNixOS website logo
Description

Testing Gene-Environment Interactions Through Genetic Risk Scores.

Statistical testing procedures for detecting GxE (gene-environment) interactions. The main focus lies on GRSxE interaction tests that aim at detecting GxE interactions through GRS (genetic risk scores). Moreover, a novel testing procedure based on bagging and OOB (out-of-bag) predictions is implemented for incorporating all available observations at both GRS construction and GxE testing (Lau et al., 2023, <doi:10.1038/s41598-023-28172-4>).

GRSxE

GRSxE is a software package for detecting GxE (gene-environment) interactions using GRS (genetic risk scores). A GRS is constructed on the data and evaluated for testing an interaction with an environmentalm exposure while adjusting for potential confounders. The GRS is constructed using bagging and evaluated performing OOB (out-of-bag) predictions such that the full data set can be used for both GRS construction and GxE interaction testing.

Installation

You can install the released version of GRSxE from CRAN with:

install.packages("GRSxE")

Example

Here is an example of an epidemiological toy data set consisting of some SNPs, an environmental covariable and a quantitative outcome/phenotype.

library(GRSxE)

Data generation

set.seed(101299)
maf <- 0.25
n.snps <- 50
N <- 2000
X <- matrix(sample(0:2, n.snps * N, replace = TRUE,
                   prob = c((1-maf)^2, 1-(1-maf)^2-maf^2, maf^2)), ncol = n.snps)
colnames(X) <- paste("SNP", 1:n.snps, sep="")
E <- rnorm(N, 20, 10)
E[E < 0] <- 0

For illustration purposes, an outcome involving a GxE interaction and an outcome not containing a GxE interaction are constructed and analyzed.

Generate outcome with a GxE interaction

y.GxE <- -0.75 + log(2) * (X[,"SNP1"] != 0) +
  log(4) * E/20 * (X[,"SNP2"] != 0 & X[,"SNP3"] == 0) +
  rnorm(N, 0, 2)

Generate outcome without a GxE interaction

y.no.GxE <- -0.75 + log(2) * (X[,"SNP1"] != 0) +
  log(4) * E/20 + log(4) * (X[,"SNP2"] != 0 & X[,"SNP3"] == 0) +
  rnorm(N, 0, 2)

Test for GxE interaction

The GxE test can now be performed by applying the GRSxE function. Since a GLM (generalized linear model) is returned, detailed results can be retrieved through summary(...).

Outcome showing a GxE interaction

First, the outcome involving a GxE interaction is tested.

summary(GRSxE(X, y.GxE, E))
#> 
#> Call:
#> glm(formula = as.formula(form), family = glm.family, data = dat)
#> 
#> Deviance Residuals: 
#>     Min       1Q   Median       3Q      Max  
#> -7.3934  -1.2871  -0.0123   1.3691   6.8683  
#> 
#> Coefficients:
#>              Estimate Std. Error t value Pr(>|t|)    
#> (Intercept) -0.513301   0.103061  -4.981 6.88e-07 ***
#> G            0.521352   0.280726   1.857   0.0634 .  
#> E            0.028518   0.004626   6.165 8.52e-10 ***
#> G:E          0.055216   0.012654   4.363 1.35e-05 ***
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> 
#> (Dispersion parameter for gaussian family taken to be 3.871335)
#> 
#>     Null deviance: 8574.0  on 1999  degrees of freedom
#> Residual deviance: 7727.2  on 1996  degrees of freedom
#> AIC: 8388.9
#> 
#> Number of Fisher Scoring iterations: 2

The corresponding p-value (G:E) is very low, indicating there is a GxE interaction.

Outcome not showing a GxE interaction

Next, the outcome not containing a GxE interaction is tested.

summary(GRSxE(X, y.no.GxE, E))
#> 
#> Call:
#> glm(formula = as.formula(form), family = glm.family, data = dat)
#> 
#> Deviance Residuals: 
#>    Min      1Q  Median      3Q     Max  
#> -7.609  -1.439  -0.022   1.446   6.906  
#> 
#> Coefficients:
#>               Estimate Std. Error t value Pr(>|t|)    
#> (Intercept) -1.9775535  0.3784215  -5.226 1.92e-07 ***
#> G            1.5660013  0.2953620   5.302 1.27e-07 ***
#> E            0.0634424  0.0172752   3.672 0.000247 ***
#> G:E          0.0002192  0.0135055   0.016 0.987054    
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> 
#> (Dispersion parameter for gaussian family taken to be 4.453263)
#> 
#>     Null deviance: 10339.6  on 1999  degrees of freedom
#> Residual deviance:  8888.7  on 1996  degrees of freedom
#> AIC: 8669
#> 
#> Number of Fisher Scoring iterations: 2

The corresponding p-value (G:E) is rather high, leaving no evidence that there might be a GxE interaction.

Metadata

Version

1.0.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows