{"id":13481229,"url":"https://github.com/masashitsubaki/CPI_prediction","last_synced_at":"2025-03-27T11:32:04.107Z","repository":{"id":162889961,"uuid":"155478786","full_name":"masashitsubaki/CPI_prediction","owner":"masashitsubaki","description":"This is a code for compound-protein interaction (CPI) prediction based on a graph neural network (GNN) for compounds and a convolutional neural network (CNN) for proteins.","archived":false,"fork":false,"pushed_at":"2020-11-28T02:05:14.000Z","size":9880,"stargazers_count":159,"open_issues_count":14,"forks_count":36,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-30T14:43:40.787Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/masashitsubaki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-10-31T01:17:01.000Z","updated_at":"2024-10-21T16:13:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"3041760e-7065-4412-9c56-dc50a49acee9","html_url":"https://github.com/masashitsubaki/CPI_prediction","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masashitsubaki%2FCPI_prediction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masashitsubaki%2FCPI_prediction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masashitsubaki%2FCPI_prediction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masashitsubaki%2FCPI_prediction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/masashitsubaki","download_url":"https://codeload.github.com/masashitsubaki/CPI_prediction/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245836293,"owners_count":20680348,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T17:00:49.901Z","updated_at":"2025-03-27T11:32:03.013Z","avatar_url":"https://github.com/masashitsubaki.png","language":"Python","funding_links":[],"categories":["Deep Learning"],"sub_categories":[],"readme":"# Compound-protein interaction (CPI) prediction using a GNN for compounds and a CNN for proteins\n\n\n### _**Important: this repository will not be further developed and maintained because we have shown and believe that graph neural networks or graph convolutional networks are incorrect and useless for modeling molecules (see our paper in [NeurIPS 2020](https://proceedings.neurips.cc/paper/2020/hash/1534b76d325a8f591b52d302e7181331-Abstract.html)). Please consider switching to our new and simple machine learning model called [quantum deep field](https://github.com/masashitsubaki/QuantumDeepField_molecule).**_\n\n\nThis code is an implementation of our paper\n\"[Compound-protein Interaction Prediction with End-to-end Learning of Neural Networks for Graphs and Sequences (Bioinformatics, 2018)](https://academic.oup.com/bioinformatics/advance-article-abstract/doi/10.1093/bioinformatics/bty535/5050020?redirectedFrom=PDF)\" in PyTorch.\nIn this repository, we provide two CPI datasets: human and *C. elegans* created by\n\"[Improving compound–protein interaction prediction by building up highly credible negative samples (Bioinformatics, 2015).](https://academic.oup.com/bioinformatics/article/31/12/i221/216307)\"\nNote that the ratio of positive and negative samples is 1:1.\n\nIn our problem setting of CPI prediction,\nan input is the pair of a SMILES format of compound and an amino acid sequence of protein;\nan output is a binary label (interact or not).\nThe SMILES is converted with RDKit and\nwe obtain a 2D graph-structured data of the compound (i.e., atom types and their adjacency matrix).\nThe overview of our **CPI prediction by GNN-CNN** is as follows:\n\n\u003cdiv align=\"center\"\u003e\n\u003cp\u003e\u003cimg src=\"model.jpeg\" width=\"600\" /\u003e\u003c/p\u003e\n\u003c/div\u003e\n\nThe details of the GNN and CNN are described in our paper.\nNote that this implementation is a simpler than the model proposed in our original paper\n(e.g., without edge vectors and their updates described in Eqs (5) and (6)).\n\nIn addition, the above CPI prediction uses our proposed GNN,\nwhich is based on learning representations of r-radius subgraphs (i.e., fingerprints) in molecules.\nWe also provide an implementation of the GNN for predicting various molecular properties\nsuch as drug efficacy and photovoltaic efficiency in https://github.com/masashitsubaki/GNN_molecules.\n\n\n## Characteristics\n\n- This code is easy to use. After setting the environment (e.g., PyTorch),\npreprocessing data and learning a model can be done by only two commands (see \"Usage\").\n- If you prepare a CPI dataset with the same format as provided in the dataset directory,\nyou can learn our GNN-CNN with your dataset by the two commands\n(see \"Training of our GNN-CNN using your CPI dataset\").\n\n\n## Requirements\n\n- PyTorch\n- scikit-learn\n- RDKit\n\n\n## Usage\n\nWe provide two major scripts:\n\n- code/preprocess_data.py creates the input tensor data of CPIs\nfor processing with PyTorch from the original data\n(see dataset/human or celegans/original/data.txt).\n- code/run_training.py trains the model using the above preprocessed data\n(see dataset/human or celegans/input).\n\n(i) Create the tensor data of CPIs with the following command:\n```\ncd code\nbash preprocess_data.sh\n```\n\nThe preprocessed data are saved in the dataset/input directory.\n\n(ii) Using the preprocessed data, train the model with the following command:\n```\nbash run_training.sh\n```\n\nThe training and test results and the model are saved in the output directory\n(after training, see output/result and output/model).\n\n(iii) You can change the hyperparameters in preprocess_data.sh and run_training.sh.\nTry to learn various models.\n\n\n## Result\n\nLearning curves (x-axis is epoch and y-axis is AUC)\non the test datasets of human and *C. elegans* are as follows:\n\n\u003cdiv align=\"center\"\u003e\n\u003cp\u003e\u003cimg src=\"learning_curves.jpeg\" width=\"800\" /\u003e\u003c/p\u003e\n\u003c/div\u003e\n\nThese results can be reproduce by the above two commands (i) and (ii).\n\n\n## Training of our GNN-CNN using your CPI dataset\nIn the directory of dataset/human or celegans/original,\nwe now have the original data \"data.txt\" as follows:\n\n```\nCC[C@@]...OC)O MSPLNQ...KAS 0\nC1C...O1 MSTSSL...FLL 1\nCCCC(=O)...CC=C1 MAGAGP...QET 0\n...\n...\n...\nCC...C MKGNST...FVS 0\nC(C...O)N MSPSPT...LCS 1\n```\n\nEach line has \"SMILES sequence interaction.\"\nNote that, the interaction 1 means that \"the pair of SMILES and sequence has interaction\" and\n0 means that \"the pair does not have interaction.\"\nIf you prepare a dataset with the same format as \"data.txt\" in a new directory\n(e.g., dataset/yourdata/original),\nyou can train our GNN-CNN using your dataset by the above two commands (i) and (ii).\n\n\n## TODO\n\n- Preprocess data contains \".\" in the SMILES format (i.e., a molecule contains multi-graphs).\n- Provide some pre-trained model and the demo scripts.\n- Implement an efficient batch processing of the attention mechanism\nbridging two different architectures (GNN and CNN).\n\n\n## How to cite\n\n```\n@article{tsubaki2018compound,\n  title={Compound-protein Interaction Prediction with End-to-end Learning of Neural Networks for Graphs and Sequences},\n  author={Tsubaki, Masashi and Tomii, Kentaro and Sese, Jun},\n  journal={Bioinformatics},\n  year={2018}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasashitsubaki%2FCPI_prediction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmasashitsubaki%2FCPI_prediction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasashitsubaki%2FCPI_prediction/lists"}