This is the repo for the paper `SumGNN: Multi-typed Drug Interaction Prediction via Efficient Knowledge Graph Summarization'. (published in Bioinformatics'21)

Overview

SumGNN: Multi-typed Drug Interaction Prediction via Efficient Knowledge Graph Summarization

This is the code for our paper ``SumGNN: Multi-typed Drug Interaction Prediction via Efficient Knowledge Graph Summarization'' (published in Bioinformatics'21) [link].

Install

git clone [email protected]:yueyu1030/SumGNN.git
cd SumGNN
pip install -r requirements.txt

Example

python train.py 
    -d drugbank         # task
    -e ddi_hop3         # the name for the log for experiments
    --gpu=0             # ID of GPU
    --hop=3             # size of the hops for subgraph
    --batch=256         # batch size for samples
    --emb_dim=32        # size of embedding for GNN layers
    -b=10               # size of basis for relation kernel

You can also change the d to BioSNAP. Please change the e accordingly. The trained model and the logs are stored in experiments folder. Note that to ensure a fair comparison, we test all models on the same negative triplets.

Dataset

We provide the dataset in the data folder.

Data Source Description
Drugbank This link A drug-drug interaction network betweeen 1,709 drugs with 136,351 interactions.
TWOSIDES This link A drug-drug interaction network betweeen 645 drugs with 46221 interactions.
Hetionet This link The knowledge graph containing 33,765 nodes out of 11 types (e.g., gene, disease, pathway,molecular function and etc.) with 1,690,693 edges from 23 relation types after preprocessing (To ensure no information leakage, we remove all the overlapping edges between HetioNet and the dataset).

Knowledge Graph Embedding

We train the knowledge graph embedding based on the framework in OpenKE.

To obtain the embedding on your own, you need to first feed the triples in train.txt (edges in dataset) and relations_2hop.txt (edges in KG) as edges into their toolkit and obtain the embeddings for each node. Then, you can incorporate this embedding into our framework by modifying the line 44-45 in model/dgl/rgcn_model.py.

Cite Us

Please kindly cite this paper if you find it useful for your research. Thanks!

@article{yu2021sumgnn,
  title={Sumgnn: Multi-typed drug interaction prediction via efficient knowledge graph summarization},
  author={Yu, Yue and Huang, Kexin and Zhang, Chao and Glass, Lucas M and Sun, Jimeng and Xiao, Cao},
  journal={Bioinformatics},
  year={2021}
}

Acknowledgement

The code framework is based on GraIL.

Comments
  • Some bug appear in the model

    Some bug appear in the model

    "Traceback (most recent call last): File "train.py", line 230, in main(params) File "train.py", line 31, in main train = SubgraphDataset(params.db_path, 'train_pos', 'train_neg', params.file_paths, File "/home/aita/4444/chenwenqi/model/SUMGNN/SumGNN-master/subgraph_extraction/datasets.py", line 71, in init self.db_neg = self.main_env.open_db(db_name_neg.encode()) lmdb.ReadonlyError: mdb_dbi_open: Permission denied" When i tried to run the model,it told me the above error. But yesterday when i first time run the model it is smoothly successful,the second time i run i meet the bug. I have set up the running environment in accordance with the requirement.txt.

    opened by demainchen 1
  • questions about the codes

    questions about the codes

    1. The TWOSIDES source link maybe wrong? Probably this one. http://snap.stanford.edu/biodata/datasets/10017/10017-ChChSe-Decagon.html
    2. In the BioSNAP dataset you have processed,including train.txt, test.txt, dev.txt and relations2hop.txt, I only found the biomedical entities(drug, protein,gene) number given in digital form.What's the correspondence between these biomedical entities numbers and real entities? You only give the correspondence about drugbank dataset.
    opened by yzf-code 1
  • 关于知识图谱的问题

    关于知识图谱的问题

        您好,您这篇Sum GNN太棒了,我复现了您的代码,您在论文中指出使用的是HetioNet,如果没理解错的话处理后得到的应该是那个relation_2hop.txt文件吧?
        我想问一下您是怎么处理得到这个文件的呢?因为我也想尝试一下去利用外部知识图谱,但是我不会处理.还有个问题,既然是同一个知识图谱里得到的,为什么BioSNAP和DRUGBANK的relation_2hop.txt文件是不一样的呢?
        刚刚入门学习,对这些知识都不了解,又没有解决问题的好办法,所以只能冒昧打扰,十分期待您的回复,万分感谢!
    
    opened by chengbaitai 0
  • try except in subgraph_extraction datasets.py line 166 to 179

    try except in subgraph_extraction datasets.py line 166 to 179

    Excuse me, I would like to ask what is the meaning of the paragraph described in the title. When I run the code, an error is reported in the valid SubgraphDataset stage, Information is 'no edge from 0 to one'.Thank you very much if someone can help me.

    opened by chengbaitai 0
  • Values error when using BioSNAP dataset

    Values error when using BioSNAP dataset

    When I want to run the model on BioSNAP dataset, it threw out the value error: Using a target size (torch.Size([178, 178])) that is different to the input size (torch.Size([178, batch_size])) is deprecated. Please ensure they have the same size, where 178 is the number of samples in last batch.

    opened by Layne-Huang 0
  • Incomplete requirements.txt

    Incomplete requirements.txt

    Your requirements.txt is incomplete. When I tried to install the requirements and run the train.py, several errors were thrown. The packages I had to install manually were the following:

    • torch (since 1.2.0 is not up to date anymore)
    • scipy
    • dglteam dgl (since the installation of dgl works differently now)
    • requests
    • tqdm
    • sklearn

    Please consider adding them (with the appropriate versions) to the requirements.txt to help other future users and prevent further trouble installing the package.

    opened by sophiakrix 1
Cancer Drug Response Prediction via a Hybrid Graph Convolutional Network

DeepCDR Cancer Drug Response Prediction via a Hybrid Graph Convolutional Network This work has been accepted to ECCB2020 and was also published in the

Qiao Liu 50 Dec 18, 2022
The code for SAG-DTA: Prediction of Drug–Target Affinity Using Self-Attention Graph Network.

SAG-DTA The code is the implementation for the paper 'SAG-DTA: Prediction of Drug–Target Affinity Using Self-Attention Graph Network'. Requirements py

Shugang Zhang 7 Aug 2, 2022
Codes and models for the paper "Learning Unknown from Correlations: Graph Neural Network for Inter-novel-protein Interaction Prediction".

GNN_PPI Codes and models for the paper "Learning Unknown from Correlations: Graph Neural Network for Inter-novel-protein Interaction Prediction". Lear

Ursa Zrimsek 2 Dec 14, 2022
null 190 Jan 3, 2023
Code for KDD'20 "An Efficient Neighborhood-based Interaction Model for Recommendation on Heterogeneous Graph"

Heterogeneous INteract and aggreGatE (GraphHINGE) This is a pytorch implementation of GraphHINGE model. This is the experiment code in the following w

Jinjiarui 69 Nov 24, 2022
Repo for CVPR2021 paper "QPIC: Query-Based Pairwise Human-Object Interaction Detection with Image-Wide Contextual Information"

QPIC: Query-Based Pairwise Human-Object Interaction Detection with Image-Wide Contextual Information by Masato Tamura, Hiroki Ohashi, and Tomoaki Yosh

null 105 Dec 23, 2022
Repository for "Improving evidential deep learning via multi-task learning," published in AAAI2022

Improving evidential deep learning via multi task learning It is a repository of AAAI2022 paper, “Improving evidential deep learning via multi-task le

deargen 11 Nov 19, 2022
Code for NAACL 2021 full paper "Efficient Attentions for Long Document Summarization"

LongDocSum Code for NAACL 2021 paper "Efficient Attentions for Long Document Summarization" This repository contains data and models needed to reprodu

null 56 Jan 2, 2023
Code for paper PairRE: Knowledge Graph Embeddings via Paired Relation Vectors.

PairRE Code for paper PairRE: Knowledge Graph Embeddings via Paired Relation Vectors. This implementation of PairRE for Open Graph Benchmak datasets (

Alipay 65 Dec 19, 2022
Does Pretraining for Summarization Reuqire Knowledge Transfer?

Pretraining summarization models using a corpus of nonsense

Approximately Correct Machine Intelligence (ACMI) Lab 12 Dec 19, 2022
Codes for our IJCAI21 paper: Dialogue Discourse-Aware Graph Model and Data Augmentation for Meeting Summarization

DDAMS This is the pytorch code for our IJCAI 2021 paper Dialogue Discourse-Aware Graph Model and Data Augmentation for Meeting Summarization [Arxiv Pr

xcfeng 55 Dec 27, 2022
Code for the SIGIR 2022 paper "Hybrid Transformer with Multi-level Fusion for Multimodal Knowledge Graph Completion"

MKGFormer Code for the SIGIR 2022 paper "Hybrid Transformer with Multi-level Fusion for Multimodal Knowledge Graph Completion" Model Architecture Illu

ZJUNLP 68 Dec 28, 2022
Code for the paper Relation Prediction as an Auxiliary Training Objective for Improving Multi-Relational Graph Representations (AKBC 2021).

Relation Prediction as an Auxiliary Training Objective for Knowledge Base Completion This repo provides the code for the paper Relation Prediction as

Facebook Research 85 Jan 2, 2023
Paddle implementation for "Highly Efficient Knowledge Graph Embedding Learning with Closed-Form Orthogonal Procrustes Analysis" (NAACL 2021)

ProcrustEs-KGE Paddle implementation for Highly Efficient Knowledge Graph Embedding Learning with Orthogonal Procrustes Analysis ?? A more detailed re

Lincedo Lab 4 Jun 9, 2021
Graph Self-Attention Network for Learning Spatial-Temporal Interaction Representation in Autonomous Driving

GSAN Introduction Code for paper GSAN: Graph Self-Attention Network for Learning Spatial-Temporal Interaction Representation in Autonomous Driving, wh

YE Luyao 6 Oct 27, 2022
The official repo for CVPR2021——ViPNAS: Efficient Video Pose Estimation via Neural Architecture Search.

ViPNAS: Efficient Video Pose Estimation via Neural Architecture Search [paper] Introduction This is the official implementation of ViPNAS: Efficient V

Lumin 42 Sep 26, 2022
[IJCAI-2021] A benchmark of data-free knowledge distillation from paper "Contrastive Model Inversion for Data-Free Knowledge Distillation"

DataFree A benchmark of data-free knowledge distillation from paper "Contrastive Model Inversion for Data-Free Knowledge Distillation" Authors: Gongfa

ZJU-VIPA 47 Jan 9, 2023
TF2 implementation of knowledge distillation using the "function matching" hypothesis from the paper Knowledge distillation: A good teacher is patient and consistent by Beyer et al.

FunMatch-Distillation TF2 implementation of knowledge distillation using the "function matching" hypothesis from the paper Knowledge distillation: A g

Sayak Paul 67 Dec 20, 2022
Source Code for our paper: Understand me, if you refer to Aspect Knowledge: Knowledge-aware Gated Recurrent Memory Network

KaGRMN-DSG_ABSA This repository contains the PyTorch source Code for our paper: Understand me, if you refer to Aspect Knowledge: Knowledge-aware Gated

XingBowen 4 May 20, 2022