12 September 2024 in Nature Medicine
With progressive digitalization of healthcare systems worldwide, large-scale collection of electronic health records (EHRs) has become commonplace. However, an extensible framework for comprehensive exploratory analysis that accounts for data heterogeneity is missing. Here we introduce ehrapy, a modular open-source Python framework designed for exploratory analysis of heterogeneous epidemiology and EHR data. ehrapy incorporates a series of analytical steps, from data extraction and quality control to the generation of low-dimensional representations. Complemented by rich statistical modules, ehrapy facilitates associating patients with disease states, differential comparison between patient clusters, survival analysis, trajectory inference, causal inference and more. Leveraging ontologies, ehrapy further enables data sharing and training EHR deep learning models, paving the way for foundational models in biomedical research. We demonstrate ehrapy’s features in six distinct examples. We applied ehrapy to stratify patients affected by unspecified pneumonia into finer-grained phenotypes. Furthermore, we reveal biomarkers for significant differences in survival among these groups. Additionally, we quantify medication-class effects of pneumonia medications on length of stay. We further leveraged ehrapy to analyze cardiovascular risks across different data modalities. We reconstructed disease state trajectories in patients with severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) based on imaging data. Finally, we conducted a case study to demonstrate how ehrapy can detect and mitigate biases in EHR data. ehrapy, thus, provides a framework that we envision will standardize analysis pipelines on EHR data and serve as a cornerstone for the community.
12 August 2024 in bioRxiv
Biological systems can be interrogated by perturbing individual components and observing the consequences across molecular, cellular, and phenotypic levels. The vast combinatorial space of possible perturbations and responses makes exhaustive experimentation infeasible. Recent advances in machine learning have shown that training on diverse datasets enables transfer learning across tasks, capturing patterns that generalize and improving performance on previously unseen problems. Inspired by this principle, we present Prophet, a transformer-based model pretrained on a vast, heterogeneous collection of perturbation experiments. This pretraining allows Prophet to predict the outcomes of untested genetic or chemical perturbations in novel cellular contexts, spanning phenotypes such as gene expression, viability, and morphology. By leveraging shared structure across apparently disconnected assays, Prophet provides a scalable framework for large-scale virtual screening and prioritization of informative experiments. Prophet consistently outperforms baseline models, including those trained on single phenotypes, showing that transfer learning between phenotypes not only is possible but improves predictive accuracy. Its capabilities extends to in vivo developmental systems, where it recapitulates known lineage biology and proposes new candidates. In a large-scale in silico screen for melanoma, Prophet identified and experimentally validated compounds with selective activity that mirrored clinically approved therapies, demonstrating its ability to transform perturbation biology into a predictive and scalable engine for therapeutic discovery.