Introduction to the Elja package

library(Elja)

Environment-Wide Association Studies (EWAS) are the study of the association between a health event and several exposures one after the other. With this package, it is possible to carry out an EWAS analysis in the simplest way and to display easily interpretable results in the output.

To do this, you must first define several points:

  • Make your dataset prepared

  • Determine which health event you want to study

  • Launch the program

The Elja package works step by step to perform an EWAS analysis:

  • It structures the dataset you have provided

  • It runs multiple models on all the exposures according to the type of model chosen for the type of outcome (continuous, binary categorical etc.)

  • It results in a data frame including for each tested exposure (and all associated modalities): the value of the estimator (odd ratio or coefficients) as well as its 95% confidence interval and the associated p-value and the number of values taken into account in the model and the AIC of the model.

  • It can also display two types of Manhattan plot both with visual indicator of the alpha threshold at 0.05 and of the alpha threshold corrected according to the Bonferroni method and the False Discovery Rate (FDR) of Benjamini-Hochberg. The first one, representing all the variables of the EWAS analysis. The second one, only for the significant values.

This document introduces the basic use of this package in an EWAS analysis.

Data: SynthDiabetes

In order to show in a simple way the use of the Elja package, we will use a synthetic diabetes dataset mimicking the original PIMA data. This dataset is present in the package mlbench (https://CRAN.R-project.org/package=mlbench).

library(mlbench)
data(SynthDiabetes)
head(SynthDiabetes)
#>   pregnant glucose pressure triceps insulin mass pedigree age diabetes
#> 1        0     194       50      45       0 28.5    0.240  28      neg
#> 2        8     129       84       0       0 27.6    0.828  44      pos
#> 3        2     132       72      42       0 38.2    0.696  26      neg
#> 4        6     184       62       0       0 24.7    0.192  39      neg
#> 5        4     108       58      32       0 31.6    0.178  22      neg
#> 6       10     117       80      13       0 30.1    0.383  58      pos

This dataset containing a health event (diabetes) will allow us to to illustrate the functioning of the Elja package.

Preparation of the data set

Before performing the function, we have to make sure that the dataset is well structured.

To do so, we have to check 2 elements:

  • The health event (outcome) must be in the same dataframe as all the exposures: this will avoid making a model where we will include other outcomes.

  • The variables must be classified in the right way: for this, use β€˜str()’.


str(SynthDiabetes)
#> 'data.frame':    768 obs. of  9 variables:
#>  $ pregnant: num  0 8 2 6 4 10 3 1 4 7 ...
#>  $ glucose : num  194 129 132 184 108 117 100 88 73 126 ...
#>  $ pressure: num  50 84 72 62 58 80 80 75 82 92 ...
#>  $ triceps : num  45 0 42 0 32 13 41 30 38 0 ...
#>  $ insulin : num  0 0 0 0 0 0 65 49 0 0 ...
#>  $ mass    : num  28.5 27.6 38.2 24.7 31.6 30.1 46.3 32.4 44.2 37.3 ...
#>  $ pedigree: num  0.24 0.828 0.696 0.192 0.178 0.383 2.42 0.447 0.56 0.66 ...
#>  $ age     : num  28 44 26 39 22 58 33 22 33 46 ...
#>  $ diabetes: Factor w/ 2 levels "neg","pos": 1 2 1 1 1 2 2 1 1 2 ...

Diabetes, which is our target health event, stands alone with exposures. In addition, the variables all have the correct class associated.

Determine the type of model you want to use

According to the class of the outcome, one model will be preferred to another. It is therefore necessary to choose the right model for the type of variable chosen as the health event.

We have seen previously that our health event is binary categorical: Diabetes (Yes/No).

str(SynthDiabetes$diabetes)
#>  Factor w/ 2 levels "neg","pos": 1 2 1 1 1 2 2 1 1 2 ...

We can therefore use a logistic regression model.

Use of the ELJAlogistic function

The approach for the logistic regression is similar for the models linear models with ELJAlinear function and for Generalized Linear Models with ELJAglm function.

The dataset being prepared and the type of model chosen, we can proceed to the analysis.

To do so, the following information are needed:

  • var: Outcome / health event; it must be categorical for a logistic regression model

  • data: Dataframe that contains the outcome and all the exposures to be tested

Other information can be added to the output of the function:

  • manplot: Indicates if it is desired to display a Manhattan plot of the results in the output of the function

  • nbvalmanplot: Indicates the number of values to display in the Manhattan plot (in order not to overload the graphs)

  • Bonferroni: Indicates if we want to display the Bonferroni threshold on the Manhattan plot

  • FDR : Indicates if you want to display the False Discovery Rate threshold according to the Benjamini-Hochberg method on the Manhattan plot

  • manplotsign : Indicates if you want to display a Manhattan plot containing only significant only the significant values with a p-value > 0.05.


ELJAlogistic(var = 'diabetes',data = SynthDiabetes,manplot = TRUE,
             Bonferroni = TRUE,FDR = TRUE, nbvalmanplot = 30, manplotsign = FALSE)

results
#>                      level odd_ratio    ci_low  ci_high      p_value   n
#> pregnant_pregnant pregnant  1.111290 1.0698148 1.155038 6.560785e-08 768
#> glucose_glucose    glucose  1.036122 1.0301686 1.042435 5.887245e-32 768
#> pressure_pressure pressure  1.005326 0.9975526 1.013514 1.880931e-01 768
#> triceps_triceps    triceps  1.002934 0.9937929 1.012174 5.305944e-01 768
#> insulin_insulin    insulin  1.002320 1.0010665 1.003610 3.287524e-04 768
#> mass_mass             mass  1.052565 1.0319202 1.074548 6.836699e-07 768
#> pedigree_pedigree pedigree  1.962055 1.3043658 2.981537 1.342156e-03 768
#> age_age                age  1.037159 1.0243860 1.050386 1.100871e-08 768
#>                         AIC
#> pregnant_pregnant  981.7257
#> glucose_glucose    828.7484
#> pressure_pressure 1009.8510
#> triceps_triceps   1011.2376
#> insulin_insulin    998.3846
#> mass_mass          984.4242
#> pedigree_pedigree 1001.1303
#> age_age            977.6466

We observe a Manhattan plot showing the results of the EWAS analysis and a dataframe showing the more detailed results.

References

  • Dunn OJ. Multiple Comparisons Among Means. Journal of the American Statistical Association. 1961;56(293):52‑64.
  • Benjamini Y, Hochberg Y. Controlling the False Discovery Rate: A Practical and Powerful Approach to Multiple Testing. Journal of the Royal Statistical Society: Series B (Methodological). 1995;57(1):289‑300.
  • Leisch F, Dimitriadou E. mlbench: Machine Learning Benchmark Problems. R package version 2.1-11; 2025. Available from: https://CRAN.R-project.org/package=mlbench