Learn R Programming

epiGWAS

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).

Installation

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

install.packages("epiGWAS")

The latest development version is directly available from GitHub:

install.packages("devtools")
devtools::install_github("EpiSlim/epiGWAS")

Usage Examples

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

require("epiGWAS")

# Genotype simulation
set.seed(542)
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_", sample.int(p, 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)

References

Slim, L., Chatelain, C., Azencott, C.-A., & Vert, J.-P. (2018). Novel Methods for Epistasis Detection in Genome-Wide Association Studies. BioRxiv. Retrieved from http://biorxiv.org/content/early/2018/10/14/442749

Copy Link

Version

Install

install.packages('epiGWAS')

Monthly Downloads

30

Version

1.0.2

License

GPL (>= 2)

Maintainer

Lotfi Slim

Last Published

September 8th, 2019

Functions in epiGWAS (1.0.2)

gen_model

Samples effect sizes for the disease model
forward_sample

Applies the forward algorithm to a single observation
BOOST

Implements BOOST SNP-SNP interaction test
maf

SNP minor allele frequencies
fast_HMM

Fits a HMM to a genotype dataset by calling fastPHASE
OWL

Implements the outcome weighted learning approach
epiGWAS

Runs a selection of epistasis detection methods in a joint manner
cond_prob

Computes the propensity scores
genotypes

Simulated genotypes
forward

Applies the forward algorithm to a genotype dataset
stabilityBIG

Computes the area under the stability path for all covariates
sample_SNP

Samples causal SNPs with different effect types
robust_outcome

Implements the robust modified outcome approach
normalized_outcome

Implements the normalized modified outcome approach
propensity

propensity scores
shifted_outcome

Implements the shifted modified outcome approach
sim_phenotype

Simulates a binary phenotype
subsample

Creates multiple subsamples without replacement
stabilityGLM

Computes the area under the stability path for all covariates
modified_outcome

Implements the modified outcome approach
merge_cluster

Merges a number of clusters around the target