Learn R Programming

LEGIT (version 1.4.1)

Latent Environmental & Genetic InTeraction (LEGIT) Model

Description

Constructs genotype x environment interaction (GxE) models where G is a weighted sum of genetic variants (genetic score) and E is a weighted sum of environments (environmental score) using the alternating optimization algorithm by Jolicoeur-Martineau et al. (2017) . This approach has greatly enhanced predictive power over traditional GxE models which include only a single genetic variant and a single environmental exposure. Although this approach was originally made for GxE modelling, it is flexible and does not require the use of genetic and environmental variables. It can also handle more than 2 latent variables (rather than just G and E) and 3-way interactions or more. The LEGIT model produces highly interpretable results and is very parameter-efficient thus it can even be used with small sample sizes (n < 250). Tools to determine the type of interaction (vantage sensitivity, diathesis-stress or differential susceptibility), with any number of genetic variants or environments, are available . The software can now produce mixed-effects LEGIT models through the lme4 package.

Copy Link

Version

Install

install.packages('LEGIT')

Version

1.4.1

License

GPL-3

Last Published

January 24th, 2024

Functions in LEGIT (1.4.1)

backward_step_IM

Internal function that does the backward step for the stepwise IM function. #@param empty_start_dataset If TRUE, the initial dataset is empty. #@param fit Current best fit. #@param ... Same parameters as in the stepwise function.
best_model.elastic_net_var_select

Best model from elastic net variable selection
best_model

Best model
bootstrap_var_select

Bootstrap variable selection (for IMLEGIT)
elastic_net_var_select

Elastic net for variable selection in IMLEGIT model
example_2way

Simulated example of a 2 way interaction GxE model.
example_2way_lme4

Simulated example of a 3 way interaction GxExZ model
example_3way

Simulated example of a 3 way interaction GxExz model
example_3way_3latent

Simulated example of a 3 way interaction GxExZ model
example_with_crossover

Simulated example of a 2 way interaction GxE model with crossover point.
forward_step

Internal function that does the forward step for the stepwise function. #@param empty_start_dataset If TRUE, the initial dataset is empty. #@param fit Current best fit. #@param ... Same parameters as in the stepwise function.
predict.LEGIT

Predictions of LEGIT fits
nes_var_select

Parallel natural evolutionary variable selection assuming bernouilli distribution (for IMLEGIT)
r1nes_var_select

Parallel natural evolutionary variable selection assuming multivariate normal search distribution with a simple covariance matrix parametrization (for IMLEGIT)
plot.LEGIT

Plot
plot.elastic_net_var_select

Plot function for the output of elastic_net_var_select
predict.IMLEGIT

Predictions of IMLEGIT fits
genetic_var_select

Parallel genetic algorithm variable selection (for IMLEGIT)
rGE

Gene-Environment correlation estimation and testing
stepwise_search

Stepwise search for the best subset of genetic variants or environments with the LEGIT model
rGE.LEGIT

Gene-Environment correlation estimation and testing of LEGIT models
rGE.IMLEGIT

Gene-Environment correlation estimation and testing of IMLEGIT models
summary.LEGIT

Summarizing LEGIT fits
forward_step_IM

Internal function that does the forward step for the stepwise function. #@param empty_start_dataset If TRUE, the initial dataset is empty. #@param fit Current best fit. #@param ... Same parameters as in the stepwise function.
summary.elastic_net_var_select

Summary function for the output of elastic_net_var_select
stepwise_search_IM

Stepwise search for the best subset of elements in the latent variables with the IMLEGIT model
summary.IMLEGIT

Summarizing IMLEGIT fits
longitudinal_folds

Longitudinal folds
GxE_interaction_RoS

Regions of significance using Johnson-Neyman technique
backward_step

Internal function that does the backward step for the stepwise IM function. #@param empty_start_dataset If TRUE, the initial dataset is empty. #@param fit Current best fit. #@param ... Same parameters as in the stepwise function.
LEGIT_to_IMLEGIT

LEGIT to IMLEGIT
IMLEGIT_cv

Cross-validation for the IMLEGIT model
IMLEGIT

Independent Multiple Latent Environmental & Genetic InTeraction (IMLEGIT) model
IMLEGIT_net

Independent Multiple Latent Environmental & Genetic InTeraction (IMLEGIT) model with Elastic Net on the latent variables. Do not use on it's own, use elastic_net_var_select instead.
LEGIT_cv

Cross-validation for the LEGIT model
GxE_interaction_test

Testing of the GxE interaction
LEGIT

Latent Environmental & Genetic InTeraction (LEGIT) model
IMLEGIT_to_LEGIT

IMLEGIT to LEGIT