Drug interaction prediction method and device based on medical knowledge graph
By combining drug interaction datasets and medical knowledge graphs, and utilizing graph structure learning and graph neural networks to extract interpretable paths for drug interactions, the problem of unexplainable drug interactions in existing technologies is solved, achieving more efficient and accurate prediction of drug interaction reactions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TSINGHUA UNIVERSITY
- Filing Date
- 2022-03-18
- Publication Date
- 2026-06-02
AI Technical Summary
Existing methods for predicting drug interactions cannot explain the interactions between drugs.
By acquiring drug interaction datasets and pre-defined medical knowledge graphs, we modify directional subgraphs using graph structure learning and graph neural networks to extract interpretable paths and obtain the interaction types between drug pairs.
It improves the accuracy and efficiency of drug interaction prediction and can dynamically explain the reasons for drug interactions.
Smart Images

Figure CN114724622B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of knowledge graphs, and in particular to a method and apparatus for predicting drug interactions based on a pharmaceutical knowledge graph. Background Technology
[0002] Relation prediction in knowledge graphs is a common technique used to predict new knowledge by effectively utilizing the existing content of the knowledge graph.
[0003] In pharmaceutical knowledge graphs, the labeling of drug interaction relationships can effectively help deduce new drug interaction relationships. However, most existing drug interaction prediction methods can only predict the specific types of interactions between drugs, but cannot explain the interactions between drugs. Summary of the Invention
[0004] This invention provides a method and apparatus for predicting drug interactions based on pharmaceutical knowledge graphs, which addresses the shortcomings of existing technologies that cannot explain drug interactions when predicting drug interactions based on pharmaceutical knowledge graphs.
[0005] This invention provides a drug interaction prediction method based on a pharmaceutical knowledge graph, comprising: acquiring a drug interaction dataset of drug pairs to be tested; wherein the drug interaction dataset is used to represent the relationship between different drugs; acquiring a directional subgraph corresponding to the drug pairs to be tested based on the drug interaction dataset and a preset pharmaceutical knowledge graph; modifying the directional subgraph through graph structure learning to obtain a first subgraph corresponding to the drug pairs to be tested; and acquiring interpretable paths between the drug pairs to be tested based on the first subgraph.
[0006] According to the present invention, a method for predicting drug interactions based on a pharmaceutical knowledge graph includes obtaining a directional subgraph corresponding to the drug pair to be detected based on the drug interaction dataset and a preset pharmaceutical knowledge graph. The method comprises: merging the drug interaction dataset and the preset pharmaceutical knowledge graph to obtain a second subgraph; performing graph embedding learning on the second subgraph using a first graph neural network to obtain the embedding representation of each node in the second subgraph; extracting the 2-hop subgraphs corresponding to the first drug and the second drug in the drug pair to be detected from the second subgraph after graph embedding learning; extracting the intersection graph of the 2-hop subgraphs corresponding to the first and second drugs to obtain a third subgraph; and obtaining the directional subgraph corresponding to the drug pair to be detected based on the third subgraph.
[0007] According to the present invention, a method for predicting drug interactions based on a pharmaceutical knowledge graph includes obtaining a directional subgraph corresponding to the drug pair to be detected based on the drug interaction dataset and a preset pharmaceutical knowledge graph. The method comprises: merging the drug interaction dataset and the preset pharmaceutical knowledge graph to obtain a second subgraph; extracting a 2-hop subgraph corresponding to the first drug and the second drug in the drug pair to be detected from the second subgraph; extracting the intersection of the 2-hop subgraphs corresponding to the first and second drugs to obtain a third subgraph; and obtaining the directional subgraph corresponding to the drug pair to be detected based on the third subgraph.
[0008] According to the present invention, a method for predicting drug interactions based on a pharmaceutical knowledge graph, after obtaining the directional subgraph corresponding to the drug pair to be detected, further includes: using a first graph neural network to perform graph embedding learning on the directional subgraph to obtain the embedding representation of each node in the directional subgraph.
[0009] According to the present invention, a method for predicting drug interactions based on a pharmaceutical knowledge graph is provided, wherein modifying the directional subgraph through graph structure learning to obtain a first subgraph corresponding to the drug pair to be detected includes: modifying the directional subgraph through graph structure learning based on the embedding representation of each node in the directional subgraph to obtain a first subgraph corresponding to the drug pair to be detected.
[0010] According to the present invention, a method for predicting drug interactions based on a pharmaceutical knowledge graph includes modifying the directional subgraph based on the embedding representation of each node in the directional subgraph through graph structure learning to obtain a first subgraph corresponding to the drug pair to be detected. The method comprises: adding edges between each node in the directional subgraph and its neighboring nodes; calculating the weights of edges between different nodes in the directional subgraph using a preset edge weight calculation function based on the embedding representation of each node in the directional subgraph; and modifying the structure of the directional subgraph based on the weights of edges between different nodes and a preset threshold to obtain the first subgraph corresponding to the drug pair to be detected.
[0011] According to the present invention, a method for predicting drug interactions based on a pharmaceutical knowledge graph is provided. The step of obtaining an interpretable path between the drug pairs to be detected based on a first subgraph includes: performing graph embedding learning on the first subgraph using a second graph neural network to update the embedding representation of each node in the first subgraph; calculating the average of the embedding representations of all nodes in the first subgraph based on the embedding representation of each node in the first subgraph to obtain the embedding representation of the first subgraph; concatenating the embedding representations of the nodes corresponding to the first drug and the nodes corresponding to the second drug in the first subgraph of the drug pair to obtain a concatenated result; and using a fully connected layer to predict the concatenated result to obtain an interpretable path between the drug pairs to be detected.
[0012] The present invention also provides a drug interaction prediction device based on a pharmaceutical knowledge graph, comprising:
[0013] The data acquisition module is used to acquire a drug interaction dataset of the drug pair to be detected; wherein, the drug interaction dataset is used to represent the relationship between different drugs;
[0014] The subgraph extraction module is used to obtain the directional subgraphs corresponding to the drug pair to be detected based on the drug interaction dataset and the preset medical knowledge graph.
[0015] The subgraph modification module is used to modify the directional subgraph through graph structure learning to obtain the first subgraph corresponding to the drug pair to be detected;
[0016] The path acquisition module is used to acquire interpretable paths between the drug pairs to be detected based on the first subgraph.
[0017] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the drug interaction prediction method based on pharmaceutical knowledge graph as described above.
[0018] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the drug interaction prediction method based on pharmaceutical knowledge graph as described above.
[0019] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the drug interaction prediction method based on pharmaceutical knowledge graph as described above.
[0020] The present invention provides a method and apparatus for predicting drug interactions based on a pharmaceutical knowledge graph. First, it obtains a directional subgraph corresponding to the drug pair to be detected using a drug interaction dataset and a preset pharmaceutical knowledge graph. This process can remove some irrelevant nodes from the pharmaceutical knowledge graph, thereby accelerating the calculation speed and improving the prediction efficiency to a certain extent. Then, it modifies the directional subgraph through graph structure learning to obtain a first subgraph corresponding to the drug pair to be detected. This process can dynamically modify the subgraph structure to obtain a better graph structure, thereby improving the prediction accuracy. Finally, based on the first subgraph, it obtains interpretable paths between the drug pairs to be detected, thus explaining the interactions between the drugs. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0022] Figure 1 This is a flowchart illustrating the drug interaction prediction method based on pharmaceutical knowledge graph provided by the present invention.
[0023] Figure 2 This is one of the flowcharts for obtaining the directional subgraphs corresponding to the drug pair to be detected provided by the present invention;
[0024] Figure 3 This is the second schematic flowchart of obtaining the directional subgraph corresponding to the drug pair to be detected provided in the embodiments of the invention;
[0025] Figure 4 This is a flowchart illustrating the interpretable path between drug pairs to be tested provided by the present invention;
[0026] Figure 5 This is a schematic diagram of the process of the drug interaction method based on pharmaceutical knowledge graph provided by the present invention;
[0027] Figure 6 This is a schematic diagram of the structure of the drug interaction prediction device based on pharmaceutical knowledge graph provided by the present invention;
[0028] Figure 7 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0030] The terms "first," "second," etc., used in the specification and claims of this invention are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0031] It should be understood that the phrase "one embodiment" or "an embodiment" in the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of the invention. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.
[0032] The following is combined with Figures 1-4 This invention describes a drug interaction prediction method based on pharmaceutical knowledge graphs.
[0033] Figure 1 This is a flowchart illustrating the drug interaction prediction method based on pharmaceutical knowledge graphs provided by this invention. Figure 1 As shown, the method includes:
[0034] Step 101: Obtain the drug interaction dataset of the drug pairs to be tested.
[0035] The drug interaction dataset is used to represent the relationships between different drugs.
[0036] It should be noted that the drug pair to be tested includes the first drug and the second drug.
[0037] The drug interaction dataset of the drug pair to be tested provides drug information related to the first drug and the second drug, and can represent the various relationships between the first drug and the second drug to a certain extent. However, the information it provides is incomplete and not comprehensive enough. The drug interaction dataset can be represented by a graph-type data structure. It can be represented as a directed graph. The direction can reflect whether the first drug has an enhancing effect on the second drug or a degrading effect on the second drug.
[0038] In this embodiment of the invention, the ultimate goal is to predict the relationship between the first drug and the second drug, that is, the type of interaction between the drug pairs to be tested, and to obtain the most interpretable path between the drug pairs to be tested.
[0039] It is understandable that electronic devices acquire drug interaction data of the drug pair to be tested.
[0040] Step 102: Based on the drug interaction dataset and the preset pharmaceutical knowledge graph, obtain the directional subgraph corresponding to the drug pair to be detected.
[0041] It's important to note that a knowledge graph is a graph-type data structure where each node represents an entity and each edge represents a relation. Essentially, it's a directed graph composed of nodes and edges. Typically, knowledge graphs are stored as triples, i.e., (h, r, t), where h ∈ ε is the head entity, r ∈ R is the relation, and t ∈ ε is the tail entity.
[0042] The preset pharmaceutical knowledge graph is an existing pharmaceutical knowledge graph with comprehensive drug information coverage and higher authority. Drug information related to the first and second drugs can also be found in this pharmaceutical knowledge graph.
[0043] Generally, a medical knowledge graph includes information on drugs, proteins, diseases, genes, etc.
[0044] It is important to understand that the directional subgraph is a directed graph. In this subgraph, the node corresponding to the first drug can be taken as the head node, and the node corresponding to the second drug can be taken as the tail node. The head node only has output edges and no input edges, that is, the in-degree of the head node is 0, while the tail node only has input edges and no output edges, that is, the out-degree of the tail node is 0.
[0045] It is understandable that electronic devices can obtain the directional subgraph corresponding to the drug pair to be detected through the drug interaction dataset of the drug pair to be detected and the preset medical knowledge graph.
[0046] Step 103: Modify the directional subgraph through graph structure learning to obtain the first subgraph corresponding to the drug pair to be detected.
[0047] It should be noted that Graph Structure Learning (GSL) refers to optimizing and / or refining an original graph structure to obtain a better graph structure.
[0048] In this embodiment of the invention, the graph structure learning model needs to be trained in advance using a training dataset. The parameters of the graph structure learning model are continuously updated using the cross-entropy loss function until training is successful. The input to the graph structure learning model is a directed subgraph obtained based on a drug-pair interaction dataset and a pre-defined medical knowledge graph. The output of the graph structure learning model is a new subgraph, and the structure of the output subgraph is superior to that of the directed subgraph.
[0049] It is important to understand that modifying a directional subgraph through graph structure learning means adding or deleting edges in the directional subgraph.
[0050] The directional subgraph is modified because the drug information in the directional subgraph comes from a pre-defined pharmaceutical knowledge graph and / or drug interaction dataset. However, the pre-defined pharmaceutical knowledge graph often has a very high degree, and many labeled drug interactions are irrelevant to predicting the relationship between drug pairs to be tested. Irrelevant edges also exist in the directional subgraph. Therefore, the directional subgraph may not be able to explain how different drugs react. Graph structure learning can delete or add edges in the directional subgraph, and the modified directional subgraph can better explain the reasons for the reactions between different drugs.
[0051] It is understandable that the first subgraph is obtained by adding or deleting some edges based on the directional subgraph.
[0052] It is understandable that the electronic device inputs the directional subgraph corresponding to the drug pair to be detected into the graph structure learning model, and after graph structure learning, obtains the first subgraph corresponding to the drug pair to be detected.
[0053] Step 104: Based on the first subgraph, obtain the interpretable paths between the drug pairs to be detected.
[0054] Understandably, by understanding the interpretable pathways between the drug pairs being tested, we can learn why the first drug and the second drug react, for example, whether it is due to proteins, genes, diseases, or other reasons.
[0055] It is understandable that the electronic device obtains an interpretable path between the drug pairs to be detected based on the first subgraph.
[0056] In this embodiment of the invention, firstly, a directional subgraph corresponding to the drug pair to be detected is obtained through a drug interaction dataset and a preset medical knowledge graph. This process can remove some irrelevant nodes from the medical knowledge graph, thereby accelerating the calculation speed and improving the prediction efficiency to a certain extent. Then, the directional subgraph is modified through graph structure learning to obtain the first subgraph corresponding to the drug pair to be detected. This process can dynamically modify the subgraph structure to obtain a better graph structure, thereby improving the prediction accuracy. Finally, based on the first subgraph, interpretable paths between the drug pairs to be detected are obtained, providing an explanation for the interactions between the drugs.
[0057] Figure 2 This is one of the flowcharts illustrating the process of obtaining the directional subgraph corresponding to the drug pair to be detected, provided by the present invention. For example... Figure 2 As shown:
[0058] Optionally, step 102, which involves obtaining the directional subgraph corresponding to the drug pair to be detected based on the drug interaction dataset and the preset pharmaceutical knowledge graph, includes steps 1021, 1022, 1023, 1024, and 1025.
[0059] Step 1021: Merge the drug interaction dataset and the preset medical knowledge graph to obtain the second sub-graph;
[0060] Understandably, merging drug interaction datasets and pre-defined pharmaceutical knowledge graphs is intended to obtain more comprehensive drug information related to the first and second drugs.
[0061] It is understandable that, since the drug interaction dataset is a directed graph and the pre-defined medical knowledge graph is also a directed graph, the second subgraph obtained after merging is also a directed graph.
[0062] Step 1022: Use the first graph neural network to perform graph embedding learning on the second subgraph to obtain the embedding representation of each node in the second subgraph;
[0063] It should be noted that the embedding representation of graph nodes, i.e., the graph node representation, is the key to the success of graph node prediction and edge prediction tasks. In the second subgraph, without graph embedding learning, the representation of each node is randomly initialized, and it cannot successfully predict the interaction between drug pairs.
[0064] The first graph neural network can be one of the following: Relational graph convolutional network (RGCN), Graph Convolutional Network (GCN), Graph Attention Network (GAT), or Graph Isomorphism Network (GIN).
[0065] In this embodiment of the invention, the first graph neural network needs to be trained in advance using a training dataset. The parameters of the first graph neural network are continuously updated using the cross-entropy loss function until training is successful. The input of the first graph neural network is a graph obtained by merging the drug interaction dataset and the preset medical knowledge graph, and the output of the first graph neural network is the embedding representation of each node in the merged graph.
[0066] In one embodiment, RGCN is used to learn graph embeddings for the second subgraph, as shown in the formula:
[0067]
[0068] in, This represents the embedding representation of node v at level l. This represents the embedding representation of node u at layer l-1. Let N represent the weight matrix of node v in layer l. Before the first graph neural network is trained, this weight matrix is randomly initialized. As the first graph neural network is continuously trained, this weight matrix is continuously adjusted. v This represents all neighboring nodes of node v in the subgraph, i.e., nodes directly connected to node v by an edge. A hidden representation of the relationship between nodes u and v.
[0069] It is important to understand that after graph embedding learning is performed on the second subgraph, each node in the second subgraph can integrate the information of its neighbors into its own representation, reflecting the connection relationship with its neighbors. However, the embedding representation of each node in the second subgraph is only a preliminary representation of each node. Since there are still irrelevant nodes and edges in the second subgraph, the preliminary representation of the nodes cannot accurately explain the interaction between drug pairs.
[0070] It is understandable that graph embedding learning does not change the structure of the graph, but only changes the representation of the nodes in the graph.
[0071] Step 1023: Extract the 2-hop subgraph corresponding to the first drug in the drug pair to be detected and the 2-hop subgraph corresponding to the second drug in the drug pair to be detected from the second subgraph after the graph embedding learning is completed;
[0072] It should be noted that a K-hop subgraph is also called a K-jump subgraph or a K-neighbor subgraph, where K is a positive integer greater than or equal to 1. The K-neighbor operation refers to finding the set of all vertices whose shortest path to a given vertex is K hops (or K steps).
[0073] Extracting the 2-hop subgraph corresponding to the first drug is equivalent to extracting the 2-neighbor subgraph corresponding to the first drug. Specifically, in the second subgraph after completing graph embedding learning, taking the node corresponding to the first drug as the vertex, first find all nodes directly connected to the vertex by an edge, that is, find all neighbor nodes of the vertex. Then find all nodes directly connected to neighbor nodes by an edge, that is, find all neighbor nodes of neighbor nodes. Extract the vertex, neighbor nodes, neighbor nodes of neighbor nodes, and the edges between them from the second subgraph after completing graph embedding learning to obtain the 2-hop subgraph corresponding to the first drug.
[0074] Similarly, extracting the 2-hop subgraph corresponding to the second drug is equivalent to extracting the 2-neighbor subgraph corresponding to the second drug. Specifically, in the second subgraph after completing graph embedding learning, taking the node corresponding to the second drug as the vertex, first find all nodes directly connected to the vertex by an edge, that is, find all neighbor nodes of the vertex. Then find all nodes directly connected to neighbor nodes by an edge, that is, find all neighbor nodes of neighbor nodes. Extract the vertex, neighbor nodes, neighbor nodes of neighbor nodes, and the edges between them from the second subgraph after completing graph embedding learning to obtain the 2-hop subgraph corresponding to the second drug.
[0075] Step 1024: Extract the intersection graph of the 2-hop subgraph corresponding to the first drug and the 2-hop subgraph corresponding to the second drug to obtain the third subgraph;
[0076] It's important to understand that finding the intersection of two 2-hop graphs means retaining only the nodes and edges that appear in both 2-hop subgraphs. The intersection graph, with the nodes corresponding to the first drug and the nodes corresponding to the second drug, together form a closed subgraph, i.e., the third subgraph.
[0077] Step 1025: Based on the third subgraph, obtain the directional subgraph corresponding to the drug pair to be detected.
[0078] It should be noted that the third subgraph is also a directed graph. Therefore, obtaining the directional subgraph based on the third subgraph involves filtering the third subgraph in terms of direction. Specifically, the node corresponding to the first drug in the third subgraph is taken as the head node and the node corresponding to the second drug is taken as the tail node. All paths from the head node to the tail node with a path length less than a preset length are obtained. The edges contained in these paths are then combined to obtain the directional subgraph. The preset length can be customized according to actual needs.
[0079] The purpose of obtaining the directional subgraph is to explain the information transmission between the node corresponding to the first drug and the node corresponding to the second drug. At the same time, nodes and edges in the second subgraph that are irrelevant to explaining the interaction between the first and second drugs are deleted. This speeds up the calculation to some extent. In general, one-third of the irrelevant nodes can be deleted.
[0080] Understandably, nodes in the directional subgraph still retain their embedded representations.
[0081] In this embodiment of the invention, a second subgraph is first obtained by merging a drug interaction dataset and a preset pharmaceutical knowledge graph, thereby acquiring more comprehensive drug information. Then, a first graph neural network is used to perform graph embedding learning on the second subgraph to obtain the embedding representation of each node in the second subgraph. Next, 2-hop subgraphs corresponding to the first and second drugs are extracted, which can initially remove some irrelevant nodes and edges. Then, the intersection graph of the 2-hop subgraphs corresponding to the first and second drugs is extracted to obtain a third subgraph. During this process, irrelevant nodes and edges can be further removed. Finally, based on the third subgraph, directional filtering is performed on the third subgraph to obtain the directional subgraphs corresponding to the drug pairs to be detected, which can speed up the calculation and improve the prediction efficiency to a certain extent.
[0082] Figure 3 This is the second schematic flowchart of obtaining the directional subgraph corresponding to the drug pair to be detected, provided in an embodiment of the present invention. For example... Figure 3 As shown:
[0083] In another embodiment, step 102, which involves obtaining the directional subgraph corresponding to the drug pair to be detected based on the drug interaction dataset and the preset pharmaceutical knowledge graph, includes steps 1026, 1027, 1028, and 1029.
[0084] Step 1026: Merge the drug interaction dataset and the preset medical knowledge graph to obtain the second subgraph;
[0085] Step 1027: Extract the 2-hop sub-graph corresponding to the first drug in the drug pair to be tested and the 2-hop sub-graph corresponding to the second drug in the drug pair to be tested from the second sub-graph;
[0086] Step 1028: Extract the intersection graph of the 2-hop subgraph corresponding to the first drug and the 2-hop subgraph corresponding to the second drug to obtain the third subgraph;
[0087] Step 1029: Based on the third subgraph, obtain the directional subgraph corresponding to the drug pair to be detected.
[0088] It is important to understand that in the process of extracting the directional subgraph corresponding to the drug pair based on the second subgraph, it is also possible to perform graph embedding learning on the second subgraph without using the first graph neural network.
[0089] In this embodiment of the invention, firstly, the drug interaction dataset and the preset pharmaceutical knowledge graph are merged to obtain a second subgraph, thereby obtaining more comprehensive drug information. Secondly, the 2-hop subgraphs corresponding to the first drug and the second drug are extracted respectively, which can initially delete some irrelevant nodes and edges. Then, the intersection graph of the 2-hop subgraphs corresponding to the first drug and the second drug is extracted to obtain a third subgraph. During this process, irrelevant nodes and edges can be further deleted. Finally, based on the third subgraph, directional filtering is performed on the third subgraph to obtain the directional subgraphs corresponding to the drug pairs to be detected, which can speed up the calculation and improve the prediction efficiency to a certain extent.
[0090] Optionally, after obtaining the orientation sub-graph corresponding to the drug pair to be detected in step 1029, the method further includes:
[0091] The first graph neural network is used to perform graph embedding learning on the directional subgraph to obtain the embedding representation of each node in the directional subgraph.
[0092] It should be noted that if the first graph neural network is not used to perform graph embedding learning on the second subgraph when extracting the directional subgraph corresponding to the drug pair to be detected based on the second subgraph, then the first graph neural network needs to be used to perform graph embedding learning on the directional subgraph to obtain the embedding representation of each node in the directional subgraph.
[0093] It is important to understand that the embedding representation of each node in the directional subgraph is merely an initial representation of each node. Since there are still irrelevant nodes and edges in the directional subgraph, the initial representation of the nodes cannot accurately explain the interaction between drug pairs.
[0094] In this embodiment of the invention, when the first graph neural network is not used to perform graph embedding learning on the second subgraph during the process of extracting the directional subgraph corresponding to the drug pair using the second subgraph, graph embedding learning on the directional subgraph is performed through the first graph neural network to provide data support for subsequent prediction of drug interactions.
[0095] Optionally, the step of modifying the directional subgraph through graph structure learning to obtain the first subgraph corresponding to the drug pair to be detected includes:
[0096] Based on the embedded representation of each node in the directional subgraph, the directional subgraph is modified through graph structure learning to obtain the first subgraph corresponding to the drug pair to be detected.
[0097] It should be noted that modifying a directional subgraph involves adding or deleting certain edges.
[0098] It is understandable that graph structure learning does not change the representation of nodes in the graph, but only changes the structure of the graph.
[0099] In this embodiment of the invention, irrelevant edges are further deleted by modifying the directional subgraph, which speeds up the calculation and results in a better graph structure, thereby improving the accuracy of prediction.
[0100] Optionally, the step of modifying the directional subgraph based on the embedding representation of each node in the directional subgraph through graph structure learning to obtain the first subgraph corresponding to the drug pair to be detected includes:
[0101] Add an edge between each node in the directional subgraph and each of its neighboring nodes;
[0102] It should be understood that the purpose of adding an edge between each node in the directional subgraph and each of its neighboring nodes is to ensure that there are two edges in opposite directions between each node and each of its neighboring nodes. That is, for any node u in the directional subgraph, an edge is added between it and its neighboring node v, so that there is an edge from u to v and an edge from v to u between node u and node v.
[0103] Based on the embedded representation of each node in the directional subgraph, the weights of the edges between different nodes in the directional subgraph are calculated using a preset edge weight calculation function;
[0104] It should be noted that using the preset edge weight calculation function to calculate the weight of the edge between different nodes in the directional subgraph means using the preset edge weight calculation function to calculate the weight between these two edges between each pair of nodes separately.
[0105] The preset edge weight calculation function is as follows:
[0106]
[0107] in, w represents the weight of the edge between nodes u and v. p This is the weight vector. Before the graph structure learning model is trained, this weight vector is randomly initialized. As the graph structure learning model is continuously trained, this weight vector is continuously adjusted. u h v These represent the embedding representations of nodes u and v, respectively.
[0108] or,
[0109] The default edge weight calculation function is:
[0110]
[0111] in, h represents the weight of the edge between nodes u and v. u h v These represent the embedding representations of nodes u and v, respectively.
[0112] Based on the weights of the edges between different nodes and a preset threshold, the structure of the directional subgraph is modified to obtain the first subgraph corresponding to the drug pair to be detected.
[0113] It should be noted that the structure of the directional subgraph has been modified as follows:
[0114]
[0115] in, γ represents the weight of the edge between nodes u and v, and γ represents a preset threshold, which can be customized according to actual needs; when When the value is lower than the preset threshold γ, the Threshold function resets the weight of the edge between nodes u and v to 0, that is, deletes the edge between nodes u and v in the l-th layer; when When the value is higher than the preset threshold γ, the Threshold function resets the weight of the edge between nodes u and v in the l-th layer to 1, that is, it retains the edge between nodes u and v in the l-th layer.
[0116] It is understandable that modifying the structure of the directional subgraph can result in a new graph structure, meaning that the graph structure of the first subgraph is superior to that of the directional subgraph.
[0117] In this embodiment of the invention, irrelevant edges are further deleted by modifying the directional subgraph, which speeds up the calculation and results in a first subgraph with a better graph structure, thereby improving the accuracy of prediction.
[0118] Figure 4This is a flowchart illustrating the interpretable path between drug pairs to be tested provided by the present invention, such as... Figure 4 As shown, step 104, which involves obtaining an interpretable path between the drug pairs to be detected based on the first subgraph, includes steps 1041, 1042, 1043, and 1044.
[0119] Step 1041: Use the second graph neural network to perform graph embedding learning on the first subgraph and update the embedding representation of each node in the first subgraph;
[0120] It should be noted that the second graph neural network can be one of the following: Relational graph convolutional network (RGCN), Graph Convolutional Network (GCN), Graph Attention Network (GAT), or Graph Isomorphism Network (GIN).
[0121] In this embodiment of the invention, the second graph neural network needs to be trained beforehand using a training dataset. The parameters of the second graph neural network are continuously updated using the cross-entropy loss function until training is successful. The input of the second graph neural network is the first subgraph, and the output of the second graph neural network is the embedding representation of each node in the first subgraph.
[0122] In one embodiment, GCN is used to learn graph embeddings for the first subgraph, as shown in the formula:
[0123]
[0124] in, This represents the embedding representation of the l-th node v in the first subgraph; This represents the weight of the edge between nodes u and v in the first subgraph. The value of is 0 or 1; W represents the weight matrix of node v itself. When the second graph neural network is not trained, this weight matrix is randomly initialized and continuously adjusted as the second graph neural network is trained; N v This represents all neighboring nodes of node v in the first subgraph; Embedded representation of node u.
[0125] Step 1042: Based on the embedding representation of each node in the first subgraph, calculate the average value of the embedding representations of all nodes in the first subgraph to obtain the embedding representation of the first subgraph;
[0126] It should be noted that the process of obtaining the embedding representation of the first subgraph is as follows:
[0127]
[0128] Among them, h G L represents the embedding representation of the entire first subgraph; L represents the number of layers in the neural network of the second graph. This represents the embedding representation of node e in the first subgraph after learning by the second graph neural network. This means taking the average of the embedding representations of all nodes in the first subgraph and using this average as the embedding representation of the entire first subgraph.
[0129] Step 1043: The embedding representation of the first drug in the drug pair to be detected in the first subgraph is spliced together with the embedding representation of the second drug in the drug pair to be detected in the first subgraph to obtain the splicing result.
[0130] It should be noted that the calculation process for obtaining the splicing result is as follows:
[0131]
[0132] Where h represents the splicing result, h G This represents the embedding representation of the first subgraph; This represents the embedding representation of the node corresponding to the first drug in the first subgraph; This represents the embedding representation of the node corresponding to the second drug in the first subgraph.
[0133] Step 1044: Use a fully connected layer to predict the splicing result and obtain an interpretable path between the drug pairs to be detected.
[0134] It is understandable that the splicing result is predicted through the fully connected layers of a neural network, where the neural network can be a convolutional neural network (CNN), a recurrent neural network (RNN), or something similar.
[0135] In this embodiment of the invention, the neural network needs to be trained beforehand using a training dataset. The parameters of the neural network are continuously updated using a cross-entropy loss function until training is successful. The input of the neural network is a concatenated graph embedding representation, and the output of the neural network is the interaction type between the first drug and the second drug.
[0136] The prediction result can be expressed as:
[0137]
[0138] Where h represents the first drug, t represents the second drug, and r q Indicates the relationship between the first drug and the second drug, w q This represents the weight vector, which is randomly initialized before the neural network is trained and is continuously adjusted as the neural network is trained.
[0139] The loss function can be expressed as:
[0140]
[0141] in,
[0142] y r =softmaX(f(h,r) q ,t))
[0143] It should be noted that, in addition to obtaining the type of interaction between the first and second drugs, we can also obtain the most explanatory pathway of how the first and second drugs interact. For example, the interaction between the first and second drugs may be caused by certain proteins, genes, etc.
[0144] In this embodiment of the invention, the most interpretable path between the drug pairs to be detected is obtained through the first subgraph obtained by graph structure learning, and the interaction between the drugs is explained.
[0145] Figure 5 This is a schematic diagram illustrating the process of the drug interaction prediction method based on pharmaceutical knowledge graphs provided by this invention. For example... Figure 5 As shown:
[0146] drug1 represents the first drug in the drug pair to be tested, drug2 represents the second drug in the drug pair to be tested, and G... DDI G represents the graph corresponding to the drug interaction dataset of the drug pairs to be tested. KG This represents the graph obtained by merging the dataset of drug interactions to be detected and the pre-defined medical knowledge graph, i.e., the second subgraph, in graph G. KG The elliptical portion in the middle represents the extracted directed subgraph.
[0147] First, the first graph neural network RGCN is used to learn the graph embedding of the directional subgraph to obtain the embedding representation of each node in the directional subgraph;
[0148] Next, based on the embedding representation of each node in the directional subgraph, graph structure learning is performed on the directional subgraph through a graph structure learning model to modify its graph structure and obtain the first subgraph. As shown in the figure, the edges marked with "×" in the directional subgraph are deleted.
[0149] Then, a second graph neural network is used to learn graph embeddings for the first subgraph, updating the embedding representation of each node in the first subgraph. Figure 5 (Not shown in the drawing);
[0150] Then, based on the embedding representation of each node in the first subgraph, the average of the embedding representations of all nodes in the first subgraph is calculated to obtain the embedding representation of the first subgraph, i.e. Figure 5 G in the ring diagram r-di ( Figure 5 (The specific calculation process is not shown in the diagram).
[0151] Finally, the embedding representation h of the node corresponding to the first drug in the first subgraph of the drug pair to be detected is obtained. h The embedding representation h of the node corresponding to the second drug in the first subgraph of the drug pair to be detected. t and the embedding representation G of the first subgraph r-di Concatenate the input to the fully connected layer ( Figure 5 (The specific process is not shown in the figure) The predicted DDI type, i.e., the drug interaction type, is obtained.
[0152] The following describes the drug interaction prediction device based on pharmaceutical knowledge graph provided by the present invention. The drug interaction prediction device based on pharmaceutical knowledge graph described below and the drug interaction prediction method based on pharmaceutical knowledge graph described above can be referred to and correspond to each other.
[0153] Figure 6 This is a schematic diagram of the structure of the drug interaction prediction device based on pharmaceutical knowledge graph provided in an embodiment of the present invention, as shown below. Figure 6 As shown, this embodiment of the invention provides a drug interaction prediction device based on a pharmaceutical knowledge graph, comprising:
[0154] The data acquisition module 601 is used to acquire a drug interaction dataset of the drug pair to be detected; wherein, the drug interaction dataset is used to represent the relationship between different drugs;
[0155] The subgraph extraction module 602 is used to obtain the directional subgraphs corresponding to the drug pair to be detected based on the drug interaction dataset and the preset medical knowledge graph.
[0156] The subgraph modification module 603 is used to modify the directional subgraph through graph structure learning to obtain the first subgraph corresponding to the drug pair to be detected;
[0157] The path acquisition module 604 is used to acquire interpretable paths between the drug pairs to be detected based on the first subgraph.
[0158] The drug interaction prediction device based on a pharmaceutical knowledge graph provided by this invention first obtains the directional subgraph corresponding to the drug pair to be detected through a drug interaction dataset and a preset pharmaceutical knowledge graph. This can remove some irrelevant nodes in the pharmaceutical knowledge graph, thereby speeding up the calculation and improving the prediction efficiency to a certain extent. Then, the directional subgraph is modified through graph structure learning to obtain the first subgraph corresponding to the drug pair to be detected. The subgraph structure can be dynamically modified to obtain a better graph structure, thereby improving the prediction accuracy. Finally, based on the first subgraph, interpretable paths between the drug pairs to be detected are obtained, providing an explanation for the interaction between the drugs.
[0159] Optionally, obtaining the directional subgraph corresponding to the drug pair to be detected based on the drug interaction dataset and the preset pharmaceutical knowledge graph includes:
[0160] The drug interaction dataset and the preset medical knowledge graph are merged to obtain the second sub-graph;
[0161] The first graph neural network is used to perform graph embedding learning on the second subgraph to obtain the embedding representation of each node in the second subgraph;
[0162] Extract the 2-hop subgraph corresponding to the first drug in the drug pair to be detected and the 2-hop subgraph corresponding to the second drug in the drug pair to be detected from the second subgraph after completing graph embedding learning;
[0163] Extract the intersection of the 2-hop subgraph corresponding to the first drug and the 2-hop subgraph corresponding to the second drug to obtain the third subgraph;
[0164] Based on the third subgraph, the directional subgraph corresponding to the drug pair to be detected is obtained.
[0165] Optionally, obtaining the directional subgraph corresponding to the drug pair to be detected based on the drug interaction dataset and the preset pharmaceutical knowledge graph includes:
[0166] The drug interaction dataset and the preset medical knowledge graph are merged to obtain the second sub-graph;
[0167] Extract the 2-hop subgraph corresponding to the first drug in the drug pair to be tested and the 2-hop subgraph corresponding to the second drug in the drug pair to be tested from the second subgraph;
[0168] Extract the intersection of the 2-hop subgraph corresponding to the first drug and the 2-hop subgraph corresponding to the second drug to obtain the third subgraph;
[0169] Based on the third subgraph, the directional subgraph corresponding to the drug pair to be detected is obtained.
[0170] Optionally, after obtaining the orientation sub-map corresponding to the drug pair to be detected, the method further includes:
[0171] The first graph neural network is used to perform graph embedding learning on the directional subgraph to obtain the embedding representation of each node in the directional subgraph.
[0172] Optionally, the step of modifying the directional subgraph through graph structure learning to obtain the first subgraph corresponding to the drug pair to be detected includes:
[0173] Based on the embedded representation of each node in the directional subgraph, the directional subgraph is modified through graph structure learning to obtain the first subgraph corresponding to the drug pair to be detected.
[0174] Optionally, the step of modifying the directional subgraph based on the embedding representation of each node in the directional subgraph through graph structure learning to obtain the first subgraph corresponding to the drug pair to be detected includes:
[0175] Add an edge between each node in the directional subgraph and each of its neighboring nodes;
[0176] Based on the embedded representation of each node in the directional subgraph, the weights of the edges between different nodes in the directional subgraph are calculated using a preset edge weight calculation function;
[0177] Based on the weights of the edges between different nodes and a preset threshold, the structure of the directional subgraph is modified to obtain the first subgraph corresponding to the drug pair to be detected.
[0178] Optionally, obtaining interpretable paths between the drug pairs to be detected based on the first subgraph includes:
[0179] The first subgraph is learned by using a second graph neural network to update the embedding representation of each node in the first subgraph.
[0180] Based on the embedding representation of each node in the first subgraph, the average value of the embedding representations of all nodes in the first subgraph is calculated to obtain the embedding representation of the first subgraph.
[0181] The embedding representation of the first subgraph is obtained by concatenating the embedding representation of the node corresponding to the first drug in the first subgraph of the drug pair to be detected and the embedding representation of the node corresponding to the second drug in the first subgraph of the drug pair to be detected.
[0182] The splicing results are predicted using a fully connected layer to obtain interpretable paths between the drug pairs to be detected.
[0183] It should be noted that the drug interaction prediction device based on pharmaceutical knowledge graph provided in this embodiment of the invention can realize all the method steps implemented in the above-mentioned drug interaction prediction method embodiment based on pharmaceutical knowledge graph, and can achieve the same technical effect. Here, the parts that are the same as those in the method embodiment and the beneficial effects will not be described in detail.
[0184] Figure 7 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 7 As shown, the electronic device may include a processor 710, a communications interface 720, a memory 730, and a communication bus 740, wherein the processor 710, communications interface 720, and memory 730 communicate with each other via the communication bus 740. The processor 710 can call logical instructions in the memory 730 to execute a drug interaction prediction method based on a pharmaceutical knowledge graph. This method includes: acquiring a drug interaction dataset of a drug pair to be detected; wherein the drug interaction dataset represents the relationship between different drugs; acquiring a directional subgraph corresponding to the drug pair to be detected based on the drug interaction dataset and a preset pharmaceutical knowledge graph; modifying the directional subgraph through graph structure learning to obtain a first subgraph corresponding to the drug pair to be detected; and acquiring an interpretable path between the drug pairs to be detected based on the first subgraph.
[0185] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0186] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the drug interaction prediction method based on a pharmaceutical knowledge graph provided by the above methods. The method includes: acquiring a drug interaction dataset of a drug pair to be detected; wherein the drug interaction dataset is used to represent the relationship between different drugs; acquiring a directional subgraph corresponding to the drug pair to be detected based on the drug interaction dataset and a preset pharmaceutical knowledge graph; modifying the directional subgraph through graph structure learning to obtain a first subgraph corresponding to the drug pair to be detected; and acquiring an interpretable path between the drug pairs to be detected based on the first subgraph.
[0187] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the drug interaction prediction method based on a pharmaceutical knowledge graph provided by the above methods. The method includes: acquiring a drug interaction dataset of a drug pair to be detected; wherein the drug interaction dataset represents the relationship between different drugs; acquiring a directional subgraph corresponding to the drug pair to be detected based on the drug interaction dataset and a preset pharmaceutical knowledge graph; modifying the directional subgraph through graph structure learning to obtain a first subgraph corresponding to the drug pair to be detected; and acquiring an interpretable path between the drug pairs to be detected based on the first subgraph.
[0188] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0189] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0190] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for predicting drug interactions based on pharmaceutical knowledge graphs, characterized in that, include: Obtain a drug interaction dataset of the drug pairs to be tested; wherein, the drug interaction dataset is used to represent the relationship between different drugs; Based on the drug interaction dataset and the preset medical knowledge graph, the directional subgraph corresponding to the drug pair to be detected is obtained. The directional subgraph is a directed graph. In the directional subgraph, the node corresponding to the first drug is taken as the head node and the node corresponding to the second drug is taken as the tail node. The in-degree of the head node is 0 and the out-degree of the tail node is 0. The directional subgraph is modified by graph structure learning to obtain the first subgraph corresponding to the drug pair to be detected; Based on the first subgraph, an interpretable path is obtained between the drug pairs to be detected.
2. The drug interaction prediction method based on pharmaceutical knowledge graph according to claim 1, characterized in that, The step of obtaining the directional subgraph corresponding to the drug pair to be detected based on the drug interaction dataset and the preset pharmaceutical knowledge graph includes: The drug interaction dataset and the preset medical knowledge graph are merged to obtain the second sub-graph; The first graph neural network is used to perform graph embedding learning on the second subgraph to obtain the embedding representation of each node in the second subgraph; Extract the 2-hop subgraph corresponding to the first drug in the drug pair to be detected and the 2-hop subgraph corresponding to the second drug in the drug pair to be detected from the second subgraph after completing graph embedding learning; Extract the intersection of the 2-hop subgraph corresponding to the first drug and the 2-hop subgraph corresponding to the second drug to obtain the third subgraph; Based on the third subgraph, the directional subgraph corresponding to the drug pair to be detected is obtained.
3. The drug interaction prediction method based on pharmaceutical knowledge graph according to claim 1, characterized in that, The step of obtaining the directional subgraph corresponding to the drug pair to be detected based on the drug interaction dataset and the preset pharmaceutical knowledge graph includes: The drug interaction dataset and the preset medical knowledge graph are merged to obtain the second sub-graph; Extract the 2-hop subgraph corresponding to the first drug in the drug pair to be tested and the 2-hop subgraph corresponding to the second drug in the drug pair to be tested from the second subgraph; Extract the intersection of the 2-hop subgraph corresponding to the first drug and the 2-hop subgraph corresponding to the second drug to obtain the third subgraph; Based on the third subgraph, the directional subgraph corresponding to the drug pair to be detected is obtained.
4. The drug interaction prediction method based on pharmaceutical knowledge graph according to claim 3, characterized in that, After obtaining the orientation sub-graph corresponding to the drug pair to be detected, the method further includes: The first graph neural network is used to perform graph embedding learning on the directional subgraph to obtain the embedding representation of each node in the directional subgraph.
5. The drug interaction prediction method based on pharmaceutical knowledge graph according to any one of claims 2-4, characterized in that, The modification of the directional subgraph through graph structure learning to obtain the first subgraph corresponding to the drug pair to be detected includes: Based on the embedded representation of each node in the directional subgraph, the directional subgraph is modified through graph structure learning to obtain the first subgraph corresponding to the drug pair to be detected.
6. The drug interaction prediction method based on pharmaceutical knowledge graph according to claim 5, characterized in that, The first subgraph corresponding to the drug pair to be detected is obtained by modifying the directional subgraph through graph structure learning based on the embedded representation of each node in the directional subgraph, including: Add an edge between each node in the directional subgraph and each of its neighboring nodes; Based on the embedded representation of each node in the directional subgraph, the weights of the edges between different nodes in the directional subgraph are calculated using a preset edge weight calculation function; Based on the weights of the edges between different nodes and a preset threshold, the structure of the directional subgraph is modified to obtain the first subgraph corresponding to the drug pair to be detected.
7. The drug interaction prediction method based on pharmaceutical knowledge graph according to claim 1 or 6, characterized in that, The step of obtaining interpretable paths between the drug pairs to be detected based on the first subgraph includes: The first subgraph is learned by using a second graph neural network to update the embedding representation of each node in the first subgraph. Based on the embedding representation of each node in the first subgraph, the average value of the embedding representations of all nodes in the first subgraph is calculated to obtain the embedding representation of the first subgraph. The embedding representation of the first subgraph is obtained by concatenating the embedding representation of the node corresponding to the first drug in the first subgraph of the drug pair to be detected and the embedding representation of the node corresponding to the second drug in the first subgraph of the drug pair to be detected. The splicing results are predicted using a fully connected layer to obtain interpretable paths between the drug pairs to be detected.
8. A drug interaction prediction device based on a pharmaceutical knowledge graph, characterized in that, include: The data acquisition module is used to acquire a drug interaction dataset of the drug pair to be detected; wherein, the drug interaction dataset is used to represent the relationship between different drugs; The subgraph extraction module is used to obtain the directional subgraph corresponding to the drug pair to be detected based on the drug interaction dataset and the preset medical knowledge graph. The directional subgraph is a directed graph. In the directional subgraph, the node corresponding to the first drug is taken as the head node and the node corresponding to the second drug is taken as the tail node. The in-degree of the head node is 0 and the out-degree of the tail node is 0. The subgraph modification module is used to modify the directional subgraph through graph structure learning to obtain the first subgraph corresponding to the drug pair to be detected; The path acquisition module is used to acquire interpretable paths between the drug pairs to be detected based on the first subgraph.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the drug interaction prediction method of the pharmaceutical knowledge graph as described in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the drug interaction prediction method of the pharmaceutical knowledge graph as described in any one of claims 1 to 7.