TransHDM

High-Dimensional Mediation Analysis via Transfer Learning

TransHDM is an R package that provides a framework for high-dimensional mediation analysis using transfer learning. The package integrates large-scale source datasets to enhance the detection power of potential mediators in small-sample target studies.

The proposed method addresses data heterogeneity across studies through transfer regularization and debiased estimation, while maintaining control of the false discovery rate.

The methodology implemented in TransHDM is based on the framework proposed in Pan et al. (2025) doi:10.1093/bib/bbaf460.


Installation

Our package has been on CRAN.

install.packages("TransHDM")

You can also install the development version of TransHDM from GitHub using the devtools package.

install.packages("devtools")
# devtools::install_github("Gaohuer/TransHDM")
install.packages("TransHDM", repos = c('https://gaohuer.r-universe.dev', 'https://cloud.r-project.org'))

or using remotes for current version:

install.packages("remotes")
# remotes::install_github("Gaohuer/TransHDM")
install.packages("TransHDM", repos = c('https://gaohuer.r-universe.dev', 'https://cloud.r-project.org'))

Functions

Main Function

The main function of the package performs transfer learning–based high-dimensional mediation analysis by integrating information from source datasets to improve mediator detection in the target dataset.

Data Generation

Diagnostics

Baseline Methods

Variable Screening

Examples

Detailed usage examples, including simulation studies and analysis workflows, are provided in the package vignettes.

After installing the package, you can access them using:

browseVignettes("TransHDM")

Citation

If you use TransHDM in your research, please cite the associated article:

Pan L, Liu Y, Huang C, Lin R, Yu Y, Qin G. Transfer learning reveals the mediating mechanisms of cross-ethnic lipid metabolic pathways in the association between APOE gene and Alzheimer's disease. Brief Bioinform. 2025;26(5):bbaf460. doi:10.1093/bib/bbaf460

You can also obtain the citation information directly from R:

citation("TransHDM")

License

This package is released under the GPL-3 License.