HTRX: Haplotype Trend Regression with eXtra Flexibility (HTRX)

Yaoling Yang, Daniel J. LawsonOpenalex Unknown 2022 · OpenAlex

Abstract

Detection of haplotype patterns that include single nucleotide polymorphisms (SNPs) and non-contiguous haplotypes that are associated with a phenotype. Methods for implementing HTRX are described in Yang Y, Lawson DJ (2023) doi:10.1093/bioadv/vbad038 and Barrie W, Yang Y, Irving-Pease E.K, et al (2024) doi:10.1038/s41586-023-06618-z.

Introduction

In genetic association studies, researchers typically search for correlations between single nucleotide polymorphisms (SNPs) and specific traits or phenotypes. However, many complex diseases are driven not by individual SNPs, but by haplotypes—specific combinations of alleles inherited together. Traditional Haplotype Trend Regression (HTR) faces two significant challenges: it often assumes SNPs must be contiguous to interact, and it suffers from the "curse of dimensionality." For a region with $k$ SNPs, there are $3^k - 1$ possible haplotype patterns when allowing for "wildcards," making the search space computationally prohibitive as $k$ increases.

HTRX (Haplotype Trend Regression with eXtra Flexibility) is an R package designed to overcome these hurdles. It identifies both contiguous and non-contiguous haplotype patterns using a flexible "wildcard" template and a novel multi-stage selection procedure, enabling the analysis of long-range genetic interactions that were previously inaccessible.

Methodology

The core innovation of HTRX lies in its flexible template and its strategic approach to model selection.

1. Flexible Templates and the Power of 'X'

HTRX represents haplotypes using three values: '0' (reference allele), '1' (alternative allele), and 'X' (wildcard). The 'X' allows the model to ignore specific SNPs in a sequence, effectively enabling the detection of interactions between non-adjacent genetic markers. For example, a risk factor might only manifest when SNP 1 is '0' and SNP 5 is '1', regardless of the alleles present at SNPs 2, 3, and 4.

2. Two-Step Model Selection

To prevent overfitting in high-dimensional spaces, HTRX implements a robust two-step procedure via the do_cv function:

  • Step 1: Candidate models are selected from random subsets of the data using criteria such as AIC, BIC, or Lasso.
  • Step 2: These candidates are evaluated using 10-fold cross-validation to identify the best-performing model.

3. Cumulative HTRX

For longer haplotypes (typically 7 or more SNPs), the package employs a "cumulative" approach (do_cumulative_htrx). Rather than searching all combinations simultaneously, it starts with a smaller subset of SNPs and iteratively adds more, maintaining only the top $M$ best-performing haplotypes at each stage. This greedy-like strategy makes it feasible to analyze genomic regions that would otherwise exceed computational limits.

Arguments for the cumulative HTRX function, showing parameters for feature capping, simulation times, and model selection criteria.

Datasets and Validation

The package includes built-in datasets for benchmarking, such as example_hap1 and example_hap2 (diploid genotype data for 8 SNPs across 5,000 individuals) and example_data_nosnp (simulated phenotype data with sex, age, and 18 principal components as fixed covariates). These methods were originally validated on real-world data exploring genetic risks for Multiple Sclerosis across ancient and modern populations.

Key Results and Evaluation

HTRX is model-agnostic, supporting both linear regression for continuous traits and logistic regression for binary outcomes (e.g., disease presence). It utilizes the fastglm library for high-performance computing.

Model performance is evaluated based on variance explained:

  • Linear Models: Measured by conventional $R^2$.
  • Logistic Models: Measured by McFadden’s $R^2$, a standard pseudo-$R^2$ for categorical outcomes.

As shown in the documentation for evaluation functions like computeR2, the tool is designed to isolate the additional variance explained by genetic features over and above standard covariates like age and sex.

The evaluation function documentation, highlighting parameters for model type selection (usebinary) and outcome vectors.

Limitations and Future Directions

While HTRX significantly advances haplotype analysis, it involves computational trade-offs. The success of the cumulative approach depends on user-tuned parameters like the initial number of SNPs ($L$) and the maximum number of independent features (featurecap). While it handles 7+ SNPs efficiently, extremely large genomic regions still require pre-filtering or "windowing" strategies to remain computationally viable. Future work may focus on further automating these parameter selections to improve ease of use for broader genomic applications.

Summary updated

BibTeX
@inproceedings{yang2022htrx,
  author = {Yaoling Yang and Daniel J. Lawson and Daniel John Lawson},
  title = {{HTRX: Haplotype Trend Regression with eXtra Flexibility (HTRX)}},
  booktitle = {Openalex Unknown},
  year = {2022},
  doi = {10.32614/cran.package.htrx},
}
Figure