Robust Methods for Epistasis Detection

Functions to perform robust epistasis detection in genome-wide association studies, as described in Slim et al. (2018) . The implemented methods identify pairwise interactions between a particular target variant and the rest of the genotype, using a propensity score approach. The propensity score models the linkage disequilibrium between the target and the rest of the genotype. All methods are penalized regression approaches, which differently incorporate the propensity score to only recover the synergistic effects between the target and the genotype.

This package implements a number of methods for detecting pure epistatic interactions with a predetermined target variant. The common denominator lies in the use of propensity scores to filter out the main effects of the rest of genotype. The methods incorporate propensity scores in two different ways: either in the sample weights (outcome weighted learning) or in the response (modified outcome).


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


The latest development version is directly available from GitHub:


Usage Examples

The example below illustrates how to use our methods on a synthetic dataset:

n_samples <- 300
p <- 450
# Genotypes matrix with {0, 1, 2} SNP values
genotypes <- matrix(
  (runif(n_samples * p, min = 0, max = 1) <
     runif(n_samples * p, min = 0, max = 1)) +
    (runif(n_samples * p, min = 0, max = 1) <
       runif(n_samples * p, min = 0, max = 1)),
  ncol = p, nrow = n_samples, dimnames = list(NULL, paste0("SNP_", seq_len(p)))
# Phenotype simulation
target <- "SNP_56"
syner <- paste0("SNP_",, 10))
size_effects <- rnorm(10) 
binarized <- genotypes[, target] > 1
risk <-   (2 * binarized - 1) * (genotypes[, syner] %*% size_effects)
risk <- risk - mean(risk) # Centering to balance cases and controls
phenotype <- runif(n_samples) < 1/(1+exp(-risk)) # Logistic model

The propensity scores can be estimated using the fastPHASE hidden Markov model. Make sure to download the fastPHASE executable before running the fast_HMM function.

hmm <- fast_HMM(genotypes, fp_path = "/path/to/fastPHASE",
  n_state = 4, n_iter = 10)
propensity <- cond_prob(genotypes, target, hmm, binary = FALSE)
propensity <- propensity[cbind(seq(dim(genotypes)[1]), binarized + 1)]

All the pieces are now in place to apply our epistasis detection methods via the epiGWAS function.

stability_scores <- epiGWAS(binarized, genotypes[, colnames(genotypes) != target], phenotype,
                            propensity, methods = c("OWL", "modified_outcome", "shifted_outcome",
                                        "normalized_outcome", "robust_outcome"), parallel = FALSE)


Slim, L., Chatelain, C., Azencott, C.-A., & Vert, J.-P. (2018). Novel Methods for Epistasis Detection in Genome-Wide Association Studies. BioRxiv. Retrieved from


epiGWAS 1.0.0

Initial release of the epiGWAS package

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


1.0.2 by Lotfi Slim, a year ago

Browse source code at

Authors: Lotfi Slim [aut, cre] , Clément Chatelain [ctb] , Chloé-Agathe Azencott [ctb] , Jean-Philippe Vert [ctb]

Documentation:   PDF Manual  

GPL (>= 2) license

Imports matrixStats, DescTools, glmnet, SNPknock, parallel

Suggests foreach, iterators, precrec, doParallel, bigmemory, biglasso, testthat, knitr, rmarkdown, kableExtra

See at CRAN