This repository houses code for the waveome package - an easy to use and powerful Python library that analyzes longitudinal data using Gaussian processes. It is particularly well-suited to characterize the temporal dynamics of omics measurements and associated variables of interest. This is done by using the Gaussian process as a prior to allow for flexible, nonparametric estimation of the potential relationships between varibles of interest. Futhermore, we allow for automated variable selection through a variety of methods. The software is open source and is built on top of GPflow (and TensorFlow).
- General Purpose: Focus for longitudinal data analysis, but also useful for cross-sectional hypotheses
- Flexible Modeling: Variety of kernels (including for categorical variables) and non-Gaussian likelihoods available
- Variable Selection: Search-based as well as global penalization with Horshoe priors to automatically identify relevant covariates and kernel structure
- Metrics & Visualizations: Generalized deviance explained and Bayes factors available as well as a variety of plotting features
- Parallelization: Independent model hyperparameter optimization occurs in parallel through Ray allowing scalability from local machine to clusters
We recommend a fresh conda environment (Python 3.9–3.11):
conda create -n waveome_env python=3.11
conda activate waveome_env
pip install waveomeRecommended for Jupyter notebooks:
conda install jupyter ipykernel
python -m ipykernel install --user --name=waveome_envFor platform-specific tips, see docs/INSTALL.md (optional).
import seaborn as sns
from waveome.model_search import GPSearch
# Load example dataset
iris = sns.load_dataset("iris")
# Load waveome object
# Assume outcomes are sepal_length and sepal_width
gps = GPSearch(
X=iris[["petal_length", "petal_width", "species"]],
Y=iris[["sepal_length", "sepal_width"]],
categorical_vars=["species"]
)
# Optimize GP models via penalization
gps.penalized_optimization()
# Visualize results
gps.plot_heatmap(var_cutoff=0, cluster=False)See the tutorial notebook waveome_overview.ipynb for longitudinal synthetic data generation and more visualization options post-fitting.
Path: examples/simulations/
Summary: We evaluated our methods on simulated data both for holdout distributional fit as well as our automated variable selection strategies. These were performed on the GW HPC, but individuals might be interested in understanding more of the modeling components and methods in waveome which can be found in the notebook simple_regression_different_models.ipynb.
Path: examples/iHMP/
Summary: We used metabolomics data from iHMP (Inflammatory Bowel Disease) project Lloyd-Price et al. (2017) for this application. Our goal was to characterize temporal dynamics of metabolites associated with severity of IBD while controlling for other patient/sample characteristics. The notebook ihmp_waveome.ipynb shows the analysis.
Path: examples/Marine_microbiome/
Summary: We analyzed 28 observations of repeated microbiome samples taken in a marine environment pre and post treatment shock times. Our analysis focused on evaluating the relationship between the abundance of sequence variants and the treatment administered, while controlling for other environmental factors. The preliminary results can be seen in 16S_environment_microbiome_antibiotic_treatments.ipynb.
Path: examples/Breastmilk/
Summary: GWDBB is a reference data library for clinical trials and omics
data. One study contains the longitudinal gut microbiome and metabolomics data of infants and mothers breast milk RNA collected at multiple time points. Two longitudinal analyses have been performed and can be found in breastmilk_infant_metabolites_Poisson.ipynb and Breastmilk_infant_Microbiome.ipynb notebook files.
Path: examples/CD4/
Summary: The bivariate responses of HIV-1 RNA (count/ml) in seminal and blood of patients in HIV-RNA AIDS studies from Seattle, Swiss and UNCCH cohorts are considered in this example. The data were
collected out of N = 149 subjects divided into two groups of patients who were receiving a therapy (106 patients) and those with no therapy or unknown therapy method (43 patients). The covariates are scaled time, baseline age, baseline CD4 and two factors consists of group and cohort. Data are also
available through Wang (2013). The analysis using waveome is provided in CD4.ipynb.
If you use waveome, please cite:
Allen Ross, Ali Reza Taheriouyn, Jason Llyod-Price, Ali Rahnavard (2024). waveome: characterizing temporal dynamics of metabolites in longitudinal studies, https://github.com/omicsEye/waveome/.