项目作者: NYXFLOWER

项目描述 :
APRILE: Adverse Polypharmacy Reaction Intelligent Learner and Explainer
高级语言: Python
项目地址: git://github.com/NYXFLOWER/APRILE.git
创建时间: 2021-07-01T16:28:00Z
项目社区:https://github.com/NYXFLOWER/APRILE

开源协议:MIT License

下载


APRILE

PyPI version
Downloads
Downloads
Documentation Status
License
Last-Commit

Getting Started |
Documentation
|
Package
|
Paper

Adverse Polypharmacy Reaction Intelligent Learner and Explainer (APRILE) is an explainable framework to reveal the mechanisms underlying adverse drug reactions (ADRs) caused by polypharmacy therapy. After learning from massive biomedical data, APRILE generate a small pharmacogenomic knowledge graph (i.e. drug targets and protein interactions) as mechanistic explanation for a drug-drug interaction (DDI) which associated an ADR and a set of such interactions.

APRILE is able to answer the following example questions:

  • Why the combination use of a pair of drugs (nicotine, ondansetron) causes anxiety?
  • When taking fexofenadine, hydroxyzineand and loratadine simultaneously, what side effects may occur, and why?
  • Which genes are associated with the infection diseases?
  • What are the common mechanisms among peptic ulcers (such as duodenal ulcer, gastric ulcer and esophageal ulcer)?

We have demonstrated the viability of discovering polypharmacy side effect mechanisms by learning from an AI model trained on massive biomedical data (see [paper])

Features

  • APRILE predicts side effects for drug combinations and gives the prediction reasons
  • APRILE delineates non-intuitive mechanistic associations between {genes, proteins, biological processes} and {symptoms, diseases, mental disorders ∈ ADRs)
  • Using our pre-trained model, molecular mechanisms for 843,318 (learned) + 93,966 (novel) side effect–drug pair events, spanning 861 side effects (472 diseases, 485 symptoms and 9 mental disorders) and 20 disease categories, have been suggested.

Installation

Prerequisites:
Before installing aprile, PyTorch and PyTorch Geometric are required to be installed matching your hardware.

We recommend using torch 1.4.0 (python3.7+cuda10.1), torch-cluster 1.5.4, torch-scatter 2.0.4, torch-sparse 0.6.1, torch-spline-cov 1.2.0 and torch-geometric 1.4.2

Install the environment dependencies of APRILE using pip:

  1. pip install aprile

Usage

Firstly, download the data file kgdata.pkl using this link, and put it into your working directory.

Secondly, load data and APRILE model.

  1. from aprile.model import *
  2. gdata = AprileQuery.load_from_pkl('kgdata.pkl')
  3. aprile = Aprile(gdata, device='cuda') # device='cpu' if using CPUs

\ If you prefer to use torch > 1.8 and torch-geometric > 2.0, see #2 when you prepare data for aprile models.*

Next, let us familiar with the data gdata. It’s data type is torch_geometric.data.data.Data) and its attribute list can be obtained by using var(gdata).keys(). It mainly contains four parts:
1) a pharmacogenomic knowledge graph: gdata.pp_index and gdata.pd_index
2) the ADRs caused by polypharmacy: gdata.dd_edge_index
3) the data for training and testing APRILE-Pred: gdata.train_idx, gdata.train_et, gdata.test_idx and gdata.test_et
4) the index mappings for drugs, genes, proteins and ADRs:

  1. - `gdata.side_side_effect_idx_to_name`: mapping from side effect aprile index to side effect name
  2. - `gdata.drug_idx_to_id`: mapping from drug aprile index to CID
  3. - `gdata.prot_idx_to_id`: mapping from protein aprile index to GeneID
  4. - `gdata.geneid2symbol`: mapping from GeneID to gene symbol

Finally, use APRILE to predict ADRs caused by polypharmacy and generate explanations (e.g. molecular mechanisms of the ADRs). Here is an example,

  1. # a list of DDIs in the formate of (D1, D2, SE)
  2. d1, d2, se = [19, 37, 192], [37, 192, 19], [452]*3
  3. # get predictions
  4. query = aprile.predict(d1, d2, se)
  5. # get prediction result table
  6. pred_df = query.get_pred_table()
  7. # get explain --> proteins and GOs
  8. query = aprile.explain_query(query, regularization=2, if_auto_tuning=True)
  9. # save query to file
  10. query.to_pickle('tmp.pkl')
  11. # load query from file
  12. query = PoseQuery.load_from_pkl('tmp.pkl')
  13. # print query summary
  14. print(query)
  15. # get detailed prediction and explaination results
  16. prediction_df = query.get_pred_table()
  17. go_df = query.get_GOEnrich_table()
  18. # visualize explained query and save
  19. subgraph_fig = query.get_subgraph(if_show=True, save_path='test.pdf')

Cite Us

If you found this work useful, please cite us:

  1. @article{aprile,
  2. title={APRILE: Exploring the Molecular Mechanisms of Drug Side Effects with Explainable Graph Neural Networks},
  3. author={Hao Xu and Shengqi Sang and Herbert Yao and Alexandra I. Herghelegiu and Haiping Lu and Laurence Yang},
  4. journal={bioRxiv preprint},
  5. year={2021}
  6. }

Contributors ✨

Thanks goes to these wonderful people (emoji key):






laurenceyang33

📖 ⚠️

This project follows the all-contributors specification. Contributions of any kind welcome!