A drug interaction prediction method and system based on graph attention sampling
By constructing drug molecule structure diagrams and interaction networks, using graph attention networks to calculate drug pair attention weights, sampling important nodes, and performing feature aggregation within a 2-hop range, the problems of limited information and limited feature aggregation range in existing methods are solved, thus improving the accuracy and comprehensiveness of drug interaction prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-24
- Publication Date
- 2026-03-24
AI Technical Summary
Existing drug interaction prediction methods based on graph representation learning cannot take into account both the structural characteristics of drug molecules and the relational information contained in the interaction network. They cannot distinguish the importance of neighboring drugs and can only aggregate the features of directly connected neighboring nodes, failing to collect node features beyond the 2-hop range in a single aggregation process.
A graph attention-based sampling method is adopted. By constructing a drug molecule structure diagram and a drug interaction network, the attention weights of drug pairs are calculated using the graph attention network, drug nodes with greater importance are sampled, the feature vector of the target drug is updated, and feature aggregation is performed within a 2-hop range. The prediction is then performed by combining local and global features.
This method addresses the issues of limited information, noise introduction, and restricted feature aggregation in existing methods, improving the accuracy and comprehensiveness of drug interaction prediction and enabling better learning of drug feature representations.
Smart Images

Figure CN116030902B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of drug interaction prediction, and more particularly relates to a drug interaction prediction method and system based on graph attention sampling. BACKGROUND
[0002] Drug interaction refers to the unexpected reaction in the human body when two or more drugs are taken by a patient at the same time. The interaction between drugs usually changes the effect of the drugs. If the change is negative, it will pose a safety risk to the patient; if the change is positive, it can promote multi-drug combination therapy. Therefore, drug interaction prediction is beneficial to studying the safety and medical value of drugs in the clinical experiment stage of drugs. In recent years, with the development of deep learning technology, computer-aided drug interaction prediction methods based on deep learning have been gradually proposed.
[0003] There are three main categories of existing drug interaction prediction methods, namely, methods based on molecular structure similarity, methods based on tensor decomposition, and methods based on graph representation learning. Among them, the main idea of the method based on graph representation learning is to take the drug-related graph data as input, use the graph neural network algorithm to learn the drug feature vector, and input the learned drug feature vector into the fully connected network for classification to obtain the prediction result. According to different drug-related graph data, the existing methods based on graph representation learning can be divided into two categories. One is the method based on molecular structure graph, which inputs the molecular structure graph and other drug property data into the graph neural network, learns the feature vector for each drug according to the molecular structure of the drug, and then concatenates the feature vectors of the two drugs to input into the fully connected network for prediction. The second is the method based on drug interaction network, which usually inputs the drug interaction network into the graph neural network and randomly initializes the feature vector of the drug. The feature vector of the target drug is learned by aggregating the neighborhood node features, and finally a drug interaction prediction matrix is output as the prediction result.
[0004] However, the existing drug interaction prediction methods based on graph representation learning have some non-negligible shortcomings: first, the drug-related graph data used is single, and only drug molecular graph data or drug interaction network is used when learning drug feature vectors, which cannot take into account the relationship information contained in the drug molecular structure characteristics and interaction network; second, the importance of neighborhood drugs cannot be distinguished, and when learning drug representation using graph neural network, all node features of the target drug neighborhood are used to update the target drug representation in the aggregation process, introducing noise; third, only the neighborhood node features directly connected can be aggregated, and the node features within 2-hop and beyond cannot be collected in one aggregation process. SUMMARY
[0005] In view of the above defects or improvement needs of the prior art, the present application provides a drug interaction prediction method and system based on graph attention sampling, which aims to solve the technical problems that the existing drug interaction prediction method based on graph representation learning cannot consider both the drug molecular structure characteristics and the relationship information contained in the interaction network, cannot distinguish the importance of neighboring drugs, thus leading to the introduction of noise, and cannot collect node features beyond the 2-hop range in one aggregation process due to the limitation of aggregating only the features of directly connected neighboring nodes.
[0006] To achieve the above-mentioned purpose, according to one aspect of the present application, a drug interaction prediction method based on graph attention sampling is provided, comprising the following steps:
[0007] (1) Obtain the drug pair data to be predicted, preprocess the drug pair data to be predicted, obtain the preprocessed drug pair data and drug molecular sequence, convert the preprocessed drug molecular sequence into a molecular structure graph, an atomic vector matrix and a molecule-atom relationship list through a molecular sequence conversion model, and construct an atomic adjacency matrix according to the molecular structure graph.
[0008] (2) Construct a drug interaction network G=(V, E) according to the drug interaction labels in the preprocessed drug pair data to be predicted in step (1), and construct a drug adjacency matrix A according to the drug interaction network, wherein V represents a node set, each node represents a drug in the drug pair data, E represents an edge set, and each edge represents an interaction between two drugs in the drug pair data.
[0009] (3) Input the atomic vector matrix, the atomic adjacency matrix, the molecule-atom relationship list obtained in step (1), and the drug interaction network and the drug adjacency matrix obtained in step (2) into a pre-trained drug interaction prediction model to obtain the final drug interaction prediction result.
[0010] Preferably, step (1) is specifically as follows: first, screen the drug pair data (i.e., retain the drug numbers, drug molecular sequences and interaction labels of the drug pairs), thereby obtaining screened drug pair data, clean the screened drug pair data, and delete data with missing data problems; then, arrange the drug molecular sequences contained in the cleaned drug pair data, convert the drug molecular sequences into a molecular structure graph, an atomic vector matrix and a molecule-atom relationship list using a molecular sequence conversion model, wherein the feature dimension of each atom is 147; finally, construct an atomic adjacency matrix B according to the molecular structure graph, wherein if atom a and atom b in the molecular structure graph are connected, the corresponding elements B ab of the two atoms in the atomic adjacency matrix B are 1, otherwise Bab value is 0, where a, b ∈ [1, C], C represents the number of atoms in the molecule.
[0011] In step (2), the drug adjacency matrix A constructed according to the drug interaction network is an N-row and N-column matrix, where each element A ij represents whether there is an interaction between drug i and drug j, and if there is, A ij = 1, otherwise A ij = 0, where i, j ∈ [1, N], N represents the number of drugs contained in the drug pair data.
[0012] Preferably, the drug interaction network model comprises three parts of a local representation learning network, a global representation learning network and a classifier connected in sequence.
[0013] Preferably, the specific structure of the local representation learning network is as follows:
[0014] The first layer is a feature transformation layer, the input is an atomic vector matrix with a size of (N*M)·d, a weight matrix with a size of d·h is multiplied with the atomic vector matrix, and the output is a feature matrix with a size of (N*M)·h, where d is the initial atomic vector length, h is the hidden layer vector length, and M is the number of atoms in each molecule.
[0015] The second layer is a message passing layer, which inputs the feature matrix with a size of (N*M)·h obtained by the first layer and the atomic adjacency matrix with a size of (N*M)·(N*M), the atomic adjacency values in different molecules are 0, and the messages do not affect each other during message passing, and the output is a feature matrix with a size of (N*M)·h.
[0016] The third layer is a message passing layer, which inputs the feature matrix with a size of (N*M)·h obtained by the second layer and the atomic adjacency matrix with a size of (N*M)·(N*M), and outputs a feature matrix with a size of (N*M)·h.
[0017] The fourth layer is a molecular feature calculation layer, which inputs the feature matrix with a size of (N*M)·h obtained by the third layer and the molecular-atomic relationship list obtained in step (1), sums and averages all atomic features in a molecule to calculate the feature vector of the molecule, and outputs a molecular local feature matrix with a size of N·h.
[0018] The fifth layer is a local prediction layer, which inputs a molecular local feature matrix with a size of N·h, and outputs a local prediction adjacency matrix with a size of N·N.
[0019] Preferably, the global representation learning network comprises two graph attention sampling networks connected in sequence and identical.
[0020] The first layer is an attention calculation layer, which inputs a molecular local feature matrix of size N h output by the local representation learning network and a drug adjacency matrix of size N N, and outputs an attention weight matrix of size N N.
[0021] The second layer is a sampling layer, which inputs the attention weight matrix of size N N, filters according to the weights of the nodes within the 2-hop range of the target drug, retains a specified proportion of nodes and edges to form an importance subgraph, constructs a subgraph adjacency matrix according to the importance subgraph, and outputs the subgraph adjacency matrix.
[0022] The third layer is a subgraph node feature aggregation layer, which inputs the subgraph adjacency matrix obtained by the second layer and the molecular local feature matrix of size N h, updates the target node features by aggregating the node features in the importance subgraph, and outputs a molecular global feature matrix of size N h.
[0023] The specific structure of the classifier comprises two fully connected layers, the first layer is used for dimension conversion of the input matrix, and the second layer is used for prediction according to the molecular global feature matrix and the drug adjacency matrix, and the output is a drug interaction prediction result.
[0024] Preferably, the drug interaction prediction model is obtained by the following steps:
[0025] (3-1) Obtain drug pair data, divide the drug pair data into a training set and a test set according to a ratio of 7:3, preprocess the drug pair data in the training set to obtain preprocessed drug pair data and drug molecular sequences, convert the preprocessed drug molecular sequences into a molecular structure graph, an atomic vector matrix X atom and a molecule-atom relationship list by a molecular sequence conversion model, and construct an atomic adjacency matrix B according to the molecular structure graph. Construct a drug interaction network according to the drug interaction labels in the drug pair data in the training set, and construct a drug adjacency matrix A according to the drug interaction network.
[0026] (3-2) Input the atomic vector matrix X atom obtained in step (3-1) into the feature transformation layer of the local representation learning network to obtain an atomic feature matrix of size (N*M) h. The specific calculation formula is as follows:
[0027]
[0028] Where W1 is the network initial weight parameter matrix of the feature transformation layer, and × represents matrix multiplication.
[0029] (3-3) Input the feature matrix and the atom adjacency matrix B are input into the first message passing layer of the local representation learning network to obtain an updated atom feature matrix of aggregated neighborhood node features
[0030] Specifically, for each atom, the calculation formula of the updated feature is:
[0031]
[0032] wherein represents the vector of the atom v after being updated by the first message passing layer, represents the initial vector before being updated; u represents the adjacent atom of the atom v, N v represents the set of adjacent atoms of the atom v; and α and β are two hyperparameters for indicating the weight of the corresponding feature, MLP 0 (x) represents a perception function.
[0033] (3-4) the updated atom feature matrix obtained in step (3-3) and the atom adjacency matrix B are input into the second message passing layer of the local representation learning network, and the calculation process in step (3-3) is repeated to update the atom vector, and an atom feature matrix
[0034] (3-5) the atom feature matrix obtained in step (3-4) and the molecule-atom relationship list are input into the molecule feature calculation layer of the local representation learning, and the feature vectors of all atoms in each molecule are summed and averaged to obtain the feature vector of the molecule, and the feature vectors of all molecules constitute a molecule local feature matrix H of size N·h loc ;
[0035] (3-6) the molecule local feature matrix H obtained in step (3-5) 1oc is input into the local prediction layer of the local representation learning network, and the network weight matrix corresponding to the layer is of size h·N, and the output is a local prediction adjacency matrix P of size N·N loc ;
[0036] (3-7) the molecule local feature matrix H obtained in step (3-5) 1oc and the drug adjacency matrix A are input into the attention calculation layer of the first graph attention sampling network of the global representation learning network, the molecule local feature vector is taken as the initial representation of the drug node in the drug interaction network, the attention coefficient between each pair of drugs in the drug interaction network is calculated, and an attention weight matrix of size N·N is output.
[0037] (3-8) The attention weight matrix of size N·N obtained in step (3-7) and the drug interaction network obtained in step (3-2) are input into a sampling layer of a first graph attention sampling network of the global representation learning network, and the 2-hop neighborhood nodes of the target drug are sampled according to the attention weight to obtain an importance subgraph corresponding to each drug. A subgraph adjacency matrix is constructed according to the importance subgraph, and the subgraph adjacency matrix is output.
[0038] (3-9) The importance subgraph obtained in step (3-8) and the molecular local feature matrix H of size N·h loc are input into a subgraph node feature aggregation layer of the first graph attention sampling network of the global representation learning network. The node attention coefficients e ij of the nodes in the importance subgraph of each drug are normalized to obtain normalized attention coefficients, and the node features in the importance subgraph are aggregated to update the features of the target drug nodes. Interaction information is added to the learned drug vectors, and the output is a molecular global feature matrix H of size N·h glob .
[0039] (3-10) For the second graph attention sampling network of the global representation learning network, steps (3-7) to (3-9) are repeated, and a molecular global feature matrix H of size N·h glob .
[0040] (3-11) Edge extraction is performed according to the drug adjacency matrix A ij =1 position corresponds to a drug pair of drug i and drug j, which forms an edge [i, j], and a drug pair list of length L is output, where L represents the total number of edges in the drug interaction network obtained in step (3-2).
[0041] (3-12) The molecular global feature matrix H glob obtained in step (3-10) is spliced according to the drug pair list obtained in step (3-11) to obtain an edge feature matrix of size L·2h.
[0042] (3-13) The edge feature matrix obtained in step (3-12) is input into a classifier for classification to obtain an interaction prediction label list of length L, and a global prediction adjacency matrix P glob .
[0043] (3-14) According to the local prediction adjacency matrix P loc obtained in step (3-6) and the global prediction adjacency matrix P globThe loss function is calculated, and the drug interaction prediction model is trained using the loss function until the model converges, obtaining the trained drug interaction prediction model.
[0044] (3-15) The test set obtained in step (3-1) is used to verify the drug interaction prediction model preliminarily trained in step (3-14) until the classification accuracy reliable index reaches the optimal value, and finally the trained drug interaction prediction model is obtained.
[0045] Preferably, the calculation formula in step (3-8) is:
[0046] ei j = leakyReLU(W att · [h i ||h j ])
[0047] Wherein ei j represents the weight coefficient between drug i and drug j, h i is the feature vector of the i-th drug, corresponding to the i-th row vector of the molecular local feature matrix H 1oc ; || is a vector concatenation symbol for concatenating vectors on both sides, W att represents the network weight parameter of the attention calculation layer, and leakyReLU(x) is an activation function, and the specific function formula is as follows:
[0048]
[0049] Wherein a is a fixed constant, and the range is [0, 1].
[0050] Preferably, the attention coefficient normalization calculation formula of step (3-9) is as follows:
[0051]
[0052] Wherein exp(x) represents the exponential function, and the specific function expression is exp(x) = e x , e max represents the maximum value of the attention coefficient corresponding to all nodes in the importance subgraph of the target drug, and N sub represents the set of drug nodes in the importance subgraph.
[0053] The calculation formula for updating the drug vector is as follows:
[0054]
[0055] Wherein represents the local feature vector of drug i, corresponding to the i-th row of the local feature matrix H 1oc .
[0056] Preferably, the loss function calculation formula in step (3-14) is as follows:
[0057] l a =-∑[y ij logp ij +(1-y ij )log(1-p ij )]
[0058] l b =-∑[y ij logr ij +(1-y ij )log(1-r ij )]
[0059] l c =∑KL(p i , r i )
[0060] L = γ(1 a + l b ) + δl c
[0061] where p ij is the interaction prediction result corresponding to drug i and drug j in the local prediction adjacency matrix P loc r ij is the interaction prediction result corresponding to drug i and drug j in the global prediction adjacency matrix P g1ob y ij represents the real drug interaction label, KL(x) is a divergence function for calculating the difference degree of the prediction results according to the global representation and the local representation, and γ and δ represent weight hyperparameters.
[0062] According to another aspect of the present application, a drug interaction prediction system based on graph attention sampling is provided, comprising:
[0063] A first module is configured to obtain drug pair data to be predicted, pre-process the drug pair data to be predicted, obtain pre-processed drug pair data and drug molecular sequences, convert the pre-processed drug molecular sequences into a molecular structure graph, an atomic vector matrix and a molecular-atomic relationship list through a molecular sequence conversion model, and construct an atomic adjacency matrix according to the molecular structure graph.
[0064] The second module is configured to construct a drug interaction network G=(V, E) according to the drug interaction labels in the drug pair data preprocessed by the first module, and construct a drug adjacency matrix A according to the drug interaction network, wherein V represents a node set, each node represents a drug in the drug pair data, E represents an edge set, and each edge represents an interaction between two drugs in the drug pair data.
[0065] The third module is configured to input the atom vector matrix, the atom adjacency matrix, the molecule-atom relationship list obtained by the first module, and the drug interaction network and the drug adjacency matrix obtained by the second module into a pre-trained drug interaction prediction model to obtain a final drug interaction prediction result.
[0066] Overall, compared with the prior art, the above technical solutions conceived by the present application can achieve the following beneficial effects:
[0067] 1. Since the present application adopts steps (1) and (2) when preparing the data set, it obtains two kinds of drug-related graph data, i.e., the molecule structure graph and the drug interaction network, from the drug pair data as dependent data for learning the drug feature vector, thus solving the technical problem that the drug-related graph data used by the prior art is single and cannot take into account the drug molecule structure characteristics and the relationship information contained in the interaction network when learning the drug feature vector.
[0068] 2. Since the present application adopts steps (3-7) to (3-9) when learning the drug feature vector, it calculates the drug pair attention weight through the graph attention network, samples according to the attention weight, obtains drug nodes with greater importance through sampling, and updates the feature vector of the target drug according to these important drug nodes, thus solving the technical problem that the prior art cannot distinguish the importance of the neighborhood drugs and uses the features of all neighborhood drugs to update the feature vector of the target drug node in the aggregation process, introducing noise.
[0069] 3. Since the present application adopts step (3-8) when learning the drug feature vector, it samples the drug nodes within the 2-hop range of the target drug node according to the attention weight, which not only considers the drug nodes directly connected to the target drug, but also considers the drug nodes farther away from the target drug, thus solving the technical problem that the prior art can only aggregate the features of the directly connected neighborhood nodes and cannot collect the features of the nodes within the 2-hop range and beyond in one aggregation process.
[0070] 4. Because the present invention employs steps (3-6), (3-13), and (3-14), drug interaction prediction is performed using the local molecular feature vector and global molecular feature vector of the drug, respectively. The KL divergence value of the two prediction results is calculated when designing the loss function to avoid smoothing phenomenon when learning the global molecular feature vector, which would cause the graph attention sampling network to gradually discard the molecular structure information contained in the local molecular feature vector. Attached Figure Description
[0071] Figure 1 This is a flowchart of the drug interaction prediction method based on graph attention sampling of the present invention;
[0072] Figure 2 This is a network structure diagram of the drug interaction prediction model used in the method of this invention. Detailed Implementation
[0073] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0074] To address the problem of failing to distinguish the importance of information in data in the field of drug interaction prediction, this invention proposes a method based on graph attention sampling to extract multi-hop importance subgraphs and accurately learn drug feature representations. This invention improves the effectiveness of drug representation learning in three main ways: First, it uses a graph attention network to dynamically assign importance weights to neighboring drug nodes of the target drug, considering not only nodes directly connected to the target drug but also nodes within a multi-hop range. Second, it simultaneously utilizes the drug molecular structure graph and the drug interaction network, ensuring that the learned drug representation includes both molecular structure information and relational information from the drug interaction network. Finally, it decouples the local representation learning module from the global representation learning module, treating the molecular structure information as local information and the drug interaction network information as global information, and pre-trains the local representation learning model to improve learning efficiency.
[0075] like Figure 1 As shown, this invention provides a drug interaction prediction method based on graph attention sampling, comprising the following steps:
[0076] (1) Obtain the drug pair data to be predicted, preprocess the drug pair data to be predicted, obtain the preprocessed drug pair data and drug molecular sequence, convert the preprocessed drug molecular sequence into a molecular structure graph, an atomic vector matrix and a molecule-atom relationship list through a molecular sequence conversion model, and construct an atomic adjacency matrix according to the molecular structure graph.
[0077] Specifically, this step first screens the drug pair data (i.e., retains the drug number, drug molecular sequence and interaction label of the drug pair), thereby obtaining screened drug pair data, cleanses the screened drug pair data, and deletes data with missing data problems; then, the drug molecular sequence contained in the cleaned drug pair data is arranged, the drug molecular sequence is converted into a molecular structure graph, an atomic vector matrix and a molecule-atom relationship list using a molecular sequence conversion model, wherein the feature dimension of each atom is 147; an atomic adjacency matrix B is constructed according to the molecular structure graph, if the atom a and the atom b in the molecular structure graph are connected, then the elements B ab of the two atoms in the atomic adjacency matrix B correspond to 1, otherwise 0, if the number of atoms in the molecule is C, then a, b ∈ [1, C].
[0078] (2) Construct a drug interaction network G = (V, E) according to the drug interaction label in the preprocessed drug pair data to be predicted in step (1), and construct a drug adjacency matrix A according to the drug interaction network, wherein V represents a node set, each node represents a drug in the drug pair data, E represents an edge set, and each edge represents an interaction between two drugs in the drug pair data.
[0079] In this step, the drug adjacency matrix A constructed according to the drug interaction network is an N by N matrix, wherein each element A ij represents whether there is an interaction between drug i and drug j, if there is, then A ij = 1, otherwise A ij = 0, N represents the number of drugs contained in the drug pair data, and i, j ∈ [1, N].
[0080] (3) Input the atomic vector matrix, atomic adjacency matrix, molecule-atom relationship list obtained in step (1) and the drug interaction network and drug adjacency matrix obtained in step (2) into the pre-trained drug interaction prediction model to obtain the final drug interaction prediction result.
[0081] As shown in Figure 2 , the drug interaction network model of the application includes three parts of a local representation learning network, a global representation learning network and a classifier connected in sequence.
[0082] The specific structure of the local representation learning network is as follows:
[0083] The first layer is a feature transformation layer, the input is an atomic vector matrix with a size of (N*M)·d, a weight matrix with a size of d·h is multiplied with the atomic vector matrix, and the output is a feature matrix with a size of (N*M)·h, wherein d is the initial atomic vector length (which is equal to 147), h is the hidden layer vector length (which is equal to 300), and M is the number of atoms in each molecule.
[0084] Since the number of atoms in each molecule is mostly different, invalid atoms are added in all molecules according to the maximum number of atoms, and the initial vector value of the added invalid atoms is set to 0, so as to ensure that the invalid atoms do not contain any information.
[0085] The main purpose of this layer is to increase the length of the feature vector, so that when the atomic features are collected to construct the molecular features, the molecular features can contain more information as much as possible.
[0086] The second layer is a message passing layer, the input is the feature matrix with a size of (N*M)·h obtained by the first layer and the atomic adjacency matrix with a size of (N*M)·(N*M), the atomic adjacency values in different molecules are 0, and the messages are not affected by each other during message passing, and the output is a feature matrix with a size of (N*M)·h.
[0087] The purpose of this layer is to aggregate the features of the adjacent atoms of the target atom and update the features of the target atom.
[0088] The third layer is a message passing layer, the input is the feature matrix with a size of (N*M)·h obtained by the second layer and the atomic adjacency matrix with a size of (N*M)·(N*M), and the output is a feature matrix with a size of (N*M)·h.
[0089] The purpose of this layer is to aggregate the features of the atoms not directly connected to the target atom and update the features of the target atom.
[0090] The fourth layer is a molecular feature calculation layer, the input is the feature matrix with a size of (N*M)·h obtained by the third layer and the molecule-atom relationship list obtained in step (1), the features of all atoms in a molecule are summed and averaged, the feature vector of the molecule is calculated, and the output is a molecular local feature matrix with a size of N·h.
[0091] The fifth layer is a local prediction layer, the input is a molecular local feature matrix with a size of N·h, and the output is a local prediction adjacency matrix with a size of N·N.
[0092] The purpose of this layer is to preliminarily predict whether there is an interaction between two drugs according to the similarity of the local features containing the molecular structure information.
[0093] The global representation learning network comprises two sequentially connected and identical graph attention sampling networks;
[0094] The graph attention sampling network has the following specific structure:
[0095] The first layer is an attention calculation layer, which takes as input a molecular local feature matrix of size N h output by the local representation learning network and a drug adjacency matrix of size N N, and outputs an attention weight matrix of size N N.
[0096] The second layer is a sampling layer, which takes as input the attention weight matrix of size N N, filters the nodes and edges within the 2-hop range of the target drug according to the weights of the nodes, retains a specified proportion of nodes and edges to form an importance subgraph, constructs a subgraph adjacency matrix according to the importance subgraph, and outputs the subgraph adjacency matrix.
[0097] The third layer is a subgraph node feature aggregation layer, which takes as input the subgraph adjacency matrix obtained by the second layer and the molecular local feature matrix of size N h, and updates the target node features by aggregating the node features in the importance subgraph, and outputs a molecular global feature matrix of size N h.
[0098] The specific structure of the classifier comprises two fully connected layers, the first layer is used for dimension conversion of the input matrix, and the second layer is used for prediction according to the molecular global feature matrix and the drug adjacency matrix, and the output is the drug interaction prediction result.
[0099] Specifically, the drug interaction prediction model of the present application is trained by the following steps:
[0100] (3-1) Obtain drug pair data, divide the drug pair data into a training set and a test set according to a ratio of 7:3, preprocess the drug pair data in the training set to obtain preprocessed drug pair data and drug molecular sequences, convert the preprocessed drug molecular sequences into molecular structure graphs, atom vector matrices X atom and a molecule-atom relationship list through a molecular sequence conversion model, and construct an atom adjacency matrix B according to the molecular structure graph. Construct a drug interaction network according to the drug interaction labels in the drug pair data in the training set, and construct a drug adjacency matrix A according to the drug interaction network.
[0101] The preprocessing of the drug pair data in this step and the process of generating the atom vector matrix and the atom adjacency matrix are the same as those in the above step (1), and the process of constructing the drug adjacency matrix is the same as that in the above step (2), which will not be repeated here.
[0102] The advantage of this step (3-1) is that two kinds of drug-related graph data are obtained from the drug pair data, one is the molecular structure graph of the drug, which contains the molecular structure information of the drug; the second is the drug interaction network, which contains the interaction information between drugs; these two kinds of graph data provide rich information for learning drug features.
[0103] (3-2) The atomic vector matrix X obtained in step (3-1) is input into the feature transformation layer of the local representation learning network to obtain an atomic feature matrix of size (N*M)·h atom The specific calculation formula is as follows:
[0104]
[0105] Where W1 is the network initial weight parameter matrix of the feature transformation layer, and × represents matrix multiplication.
[0106] (3-3) The feature matrix obtained in step (3-2) and the atomic adjacency matrix B are input into the first message passing layer of the local representation learning network to obtain the updated atomic feature matrix of the aggregated neighborhood node features
[0107] Specifically, for each atom, the calculation formula of its updated feature is:
[0108]
[0109] Where represents the vector of atom v after being updated by the first message passing layer, represents the initial vector before being updated; u represents the adjacent atom of atom v, N v represents the set of adjacent atoms of atom v; α and β are two hyperparameters indicating the weight of the corresponding feature; MLP 0 (x) represents the perception function.
[0110] (3-4) The updated atomic feature matrix obtained in step (3-3) and the atomic adjacency matrix B are input into the second message passing layer of the local representation learning network, and the calculation process in step (3-3) is repeated to update the atomic vector, and the atomic feature matrix
[0111] (3-5) The atomic feature matrix obtained in step (3-4) and the molecule-atom relationship list are input into the molecular feature calculation layer of the local representation learning, and the feature vectors of all atoms in each molecule are summed and averaged to obtain the feature vector of the molecule. The feature vectors of all molecules constitute a molecular local feature matrix H of size N·hloc ;
[0112] (3-6) The molecular local feature matrix H obtained in step (3-5) 1oc The input local representation is the local prediction layer of the learning network, with a network weight matrix of size h·N, and the output local prediction adjacency matrix P of size N·N. loc ;
[0113] The advantage of steps (3-2) to (3-6) above is that the message-passing neural network is used to update the atomic representation in each drug molecule, and the updated atomic features are integrated to calculate the molecular features, ensuring that the learned molecular features contain the chemical structure information of the molecule itself.
[0114] (3-7) The molecular local feature matrix H obtained in step (3-5) loc The drug adjacency matrix A is input into the attention calculation layer of the first graph attention sampling network of the global representation learning network. The local feature vector of the molecule is used as the initial representation of the drug node in the drug interaction network. The attention coefficient between each pair of drugs in the drug interaction network is calculated, and the output is an attention weight matrix of size N·N.
[0115] Specifically, the calculation formula for this step is as follows:
[0116] e ij =leakyReLU(W att ·[h i ||h j ])
[0117] Where ei j h represents the weighting coefficient between drug i and drug j. i The feature vector of the i-th drug corresponds to the local feature matrix H of the molecule. loc The i-th row vector; || is the vector concatenation operator, used to concatenate the vectors on both sides of the symbol, W att The values represent the network weights of the attention calculation layer. `leakyReLU(x)` is the activation function, and its formula is as follows:
[0118]
[0119] Where a is a fixed constant, and its range is [0, 1].
[0120] The advantage of the above steps (3-7) is that by using the local feature vectors of molecules as the initial representation of drug nodes in the drug interaction network, and starting the weight calculation on this basis, the relationship weights between drugs can be calculated better based on molecular structure information.
[0121] (3-8) Input the attention weight matrix of size N·N obtained in step (3-7) and the drug interaction network obtained in step (3-2) into the sampling layer of the first graph attention sampling network of the global representation learning network, sample the 2-hop neighborhood nodes of the target drug according to the attention weight, obtain the importance subgraph corresponding to each drug, construct a subgraph adjacency matrix according to the importance subgraph, and output the subgraph adjacency matrix.
[0122] The above step (3-8) has the advantages that important nodes having greater influence on the properties of the target drug are found according to the attention weight, so that the model can learn more effective information, and noise brought by unimportant node information is reduced.
[0123] (3-9) Input the importance subgraph obtained in step (3-8) and the molecular local feature matrix H of size N·h loc into the subgraph node feature aggregation layer of the first graph attention sampling network of the global representation learning network, normalize the attention coefficient e ij of each node in the importance subgraph of each drug, aggregate the node features in the importance subgraph to update the feature of the target drug node, add interaction information to the learned drug vector, and output the molecular global feature matrix H of size N·h glob .
[0124] Specifically, the normalization calculation formula of the attention coefficient is as follows:
[0125]
[0126] where exp(x) represents an exponential function, and the specific function expression is exp(x) = e x , e max represents the maximum value of the attention coefficients of all nodes in the importance subgraph of the target drug, N sub represents the set of drug nodes in the importance subgraph.
[0127] The calculation formula for updating the drug vector is as follows:
[0128]
[0129] where represents the local feature vector of drug i, corresponding to the ith row of the local feature matrix H 1oc .
[0130] (3-10) For the second graph attention sampling network of the global representation learning network, repeat the above steps (3-7) to (3-9), and output the molecular global feature matrix H glob of size N·h.
[0131] (3-11)Edge extraction according to the drug adjacency matrix A, A ij = 1, the drug i and the drug j corresponding to the position form a drug pair as edge [i, j], and a drug pair list with a length of L is output, L represents the total number of edges in the drug interaction network obtained in step (3-2).
[0132] (3-12)Concatenate the molecular global feature matrix H glob obtained in step (3-10) according to the drug pair list obtained in step (3-11) to obtain an edge feature matrix with a size of L·2h.
[0133] (3-13)Input the edge feature matrix obtained in step (3-12) into the classifier for classification to obtain an interaction prediction label list with a length of L, and then construct a global prediction adjacency matrix P glob according to the interaction prediction label list and the drug pair list.
[0134] (3-14)Calculate the loss function according to the local prediction adjacency matrix P loc obtained in step (3-6) and the global prediction adjacency matrix P g1ob obtained in step (3-13), and train the drug interaction prediction model using the loss function until the model converges to obtain the trained drug interaction prediction model.
[0135] Specifically, the loss function calculation formula of this step is as follows:
[0136] l a = -∑[y ij logp ij +(1-y ij )log(1-p ij )]
[0137] l b = -∑[y ij logr ij +(1-y ij )log(1-r ij )]
[0138] l c =∑KL(p i , r i )
[0139] L = γ(l a +l b )+δl c
[0140] where p ij is the local prediction adjacency matrix P locThe interaction prediction result corresponding to the traditional Chinese medicine i and the drug j, r ij is a global prediction adjacency matrix P g1ob The interaction prediction result corresponding to the traditional Chinese medicine i and the drug j, y ij The real drug interaction label is represented, KL(x) is a divergence function, used to calculate the difference degree of the prediction result according to the global representation and the local representation, and γ and δ represent weight hyperparameters.
[0141] (3-15) The drug interaction prediction model preliminarily trained in step (3-14) is verified using the test set obtained in step (3-1) until the classification accuracy reliable index reaches the optimal value, and finally a trained drug interaction prediction model is obtained.
[0142] Experimental results
[0143] Next, the performance evaluation of the drug pair interaction prediction method and system provided by the application based on graph attention sampling will be described. It should be noted that two mainstream open source drug interaction experimental data sets are used in this part, namely the ChChMiner data set and the DeepDDI data set, and the performance of the system provided by the application is evaluated on these two data sets. The ChChMiner data set contains 977 drug nodes and 42972 interaction data, and after data processing and filtering, 21486 positive sample data and 12183 negative sample data are obtained from the data set. The DeepDDI data set contains 1704 drug nodes and 191878 interaction data, and after data processing and filtering, 191870 positive sample data and 124725 negative sample data are obtained from the data set. The statistical information of the data set is shown in Table 1.
[0144] Table 1: ChChMiner and DeepDDI data set statistics
[0145] ChChMiner dataset DeepDDI dataset Number of drugs 977 1704 Number of drug pairs 42972 191878 Positive samples 21486 191870 Negative samples 12183 124725
[0146] In this embodiment, the potential drug interactions in the ChChMiner dataset and the DeepDDI dataset are predicted by the present application, and the performance of the present application is evaluated according to the prediction results. The experiment adopts accuracy (Accuracy, ACC for short), F1 score (F1-Score, F1 for short, also known as Balanced Score, i.e. balanced F score), receiver operating characteristic curve (receiver operating characteristic curve, ROC for short) and average precision (Average Precision, AP for short) scores as performance evaluation indexes, and is compared with five currently most advanced benchmark models. The benchmark models include Miracle, SSI-DDI, CSGNN, SkipGNN and GAT, the model implementation and execution are performed according to the steps in the open source code of the model, and the experimental code is consistent with the embodiments provided by the present application.
[0147] The model experiment parameters set by the present application are shown in Table 2.
[0148] Table 2: Hyperparameter settings of the model
[0149]
[0150]
[0151] The performance test results of the method of the present application on the ChChMiner dataset are shown in Table 3.
[0152] Table 3: Performance test results of the method of the present application on the ChChMiner dataset
[0153]
[0154] The performance test results of the method of the present application on the DeepDDI dataset are shown in Table 4.
[0155] Table 4: Performance test results of the method of the present application on the DeepDDI dataset
[0156]
[0157] Table 3 and Table 4 show the binary classification performance of different models on ChChMiner and DeepDDI datasets, and we observe that the drug interaction prediction method and system based on graph attention sampling provided by the present application achieves the best results. On the dataset ChChMiner, the present application is superior to other benchmark models with an ideal score. Specifically, its accuracy is as high as 97.555%, the F1 value is as high as 95.653%, and the AP value is as high as 99.285%. Compared with other benchmark models, the present application achieves a relative accuracy improvement of 1.061%, an F1 value improvement of 6.36%, and an AP value improvement of 0.415%. On the DeepDDI, the relative improvement of the present application is more prominent. As shown in Table 4, the accuracy of the present application is improved by 2.481%, the F1 value is improved by 9.43%, and the AP value is improved by 1.125%, which is superior to the best baseline. The Roc value can be understood as the reliability of the model, and the present application scores 96.645% on ChChMiner and 90.454% on DeepDDI, which can well prove its reliability.
[0158] Those skilled in the art will readily understand that the above description is only preferred embodiments of the present application and is not intended to limit the present application. Any modification, equivalent replacement and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A drug interaction prediction method based on graph attention sampling, characterized in that, Includes the following steps: (1) Obtain the drug pair data to be predicted, preprocess the drug pair data to be predicted, and obtain the preprocessed drug pair data and drug molecule sequence. Convert the preprocessed drug molecule sequence into a molecular structure diagram, atom vector matrix and a molecular-atom relationship list through a molecular sequence conversion model, and construct an atom adjacency matrix based on the molecular structure diagram. Specifically, step (1) is as follows: First, the drug pair data is screened, that is, the drug number, drug molecule sequence and drug pair interaction label are retained, so as to obtain the screened drug pair data. The screened drug pair data is cleaned and the data with missing data is deleted. Then, the drug molecule sequence contained in the cleaned drug pair data is sorted out, and the drug molecule sequence is converted into a molecular structure diagram, atom vector matrix and a molecular-atom relationship list using a molecular sequence conversion model, where the feature dimension of each atom is 147. Finally, an atom adjacency matrix is constructed based on the molecular structure diagram. If the atoms in the molecular structure diagram and atoms If they are connected, then these two atoms are in the atomic adjacency matrix. The corresponding element The value is 1, otherwise The value is 0, where , Indicates the number of atoms in a molecule; (2) Construct a drug interaction network based on the drug interaction labels in the drug pair data to be predicted after preprocessing in step (1). And construct a drug adjacency matrix based on this drug interaction network. ,in This represents a set of nodes, where each node represents a drug in the drug pair data. The set of edges represents the interaction between two drugs in the data; in step (2), the drug adjacency matrix is constructed based on the drug interaction network. It is OK A matrix of columns, where each element Indicates drug and medicine Does an interaction exist? If so, then ,otherwise ,in , This indicates the number of drugs included in the drug pair data; (3) Input the atomic vector matrix, atomic adjacency matrix, molecular-atomic relation list obtained in step (1), and drug interaction network and drug adjacency matrix obtained in step (2) into the pre-trained drug interaction prediction model to obtain the final drug interaction prediction result; the drug interaction network model includes three parts: a sequentially connected local representation learning network, a global representation learning network, and a classifier.
2. The drug interaction prediction method based on graph attention sampling according to claim 1, characterized in that, The specific structure of the local representation learning network is as follows: The first layer is the feature transformation layer, with an input of size [value missing]. The atomic vector matrix, using Multiplying the weight matrix by the atomic vector matrix, the output is a matrix of size . The feature matrix of , where It is the length of the initial vector of the atom. It is the length of the hidden layer vector. It is the number of atoms in each molecule; The second layer is the message passing layer, whose input to the first layer is of size [value missing]. The feature matrix and its size are The atomic adjacency matrix is such that the atomic adjacency values in different molecules are 0, and they do not affect each other during message passing. The output is of size [value missing]. The feature matrix; The third layer is the message passing layer, whose input is the value obtained from the second layer. The feature matrix and its size are The atomic adjacency matrix, the output is of size The feature matrix; The fourth layer is the molecular feature calculation layer, and its input is the value obtained from the third layer. The feature matrix and the molecular-atom relationship list obtained in step (1) are used to sum and average the features of all atoms in a molecule to calculate the molecule's feature vector, and the output is a vector of size . The molecular local feature matrix; The fifth layer is the local prediction layer, and its input is of size [value missing]. The molecular local feature matrix, the output is of size The local predicted adjacency matrix.
3. The drug interaction prediction method based on graph attention sampling according to claim 2, characterized in that, The global representation learning network consists of two sequentially connected and identical graph attention sampling networks, the specific structure of which is as follows: The first layer is the attention computation layer, whose input is the local representation learning network and whose output size is... The molecular local feature matrix and its size are The drug adjacency matrix, output as a matrix of size . Attention weight matrix; The second layer is the sampling layer, whose input is of size [value missing]. The attention weight matrix is used to filter nodes within the 2-hop range of the target drug, retaining a specified proportion of nodes and edges to form an importance subgraph. The subgraph adjacency matrix is constructed based on the importance subgraph, and the subgraph adjacency matrix is output. The third layer is the subgraph node feature aggregation layer, which takes the subgraph adjacency matrix obtained from the second layer as input and has a size of [missing value]. The molecular local feature matrix is used to update the target node features by aggregating the node features in the importance subgraph, and the output is a matrix of size [value missing]. The molecular global feature matrix; The classifier has a specific structure consisting of two fully connected layers. The first layer is used to transform the dimension of the input matrix, and the second layer makes predictions based on the global molecular feature matrix and the drug adjacency matrix. The output is the drug interaction prediction result.
4. The drug interaction prediction method based on graph attention sampling according to claim 1, characterized in that, The drug interaction prediction model is trained through the following steps: (3-1) Obtain drug pair data and divide the drug pair data into training and test sets in a 7:3 ratio. Preprocess the drug pair data in the training set to obtain preprocessed drug pair data and drug molecule sequences. Use a molecular sequence transformation model to convert the preprocessed drug molecule sequences into molecular structure diagrams and atomic vector matrices. In addition to a list of molecular-atomic relationships, an atomic adjacency matrix is constructed based on the molecular structure diagram. A drug interaction network is constructed based on the drug interaction labels in the drug pair data of the training set, and a drug adjacency matrix is constructed based on this drug interaction network. ; (3-2) The atomic vector matrix obtained in step (3-1) The input is fed into the feature transformation layer of the local representation learning network to obtain a feature of size [value missing]. atomic feature matrix The specific calculation formula is as follows: , in It is the initial weight parameter matrix of the feature transformation layer. Represents matrix multiplication; (3-3) The feature matrix obtained in step (3-2) and atomic adjacency matrix The first message-passing layer of the local representation learning network is input to obtain an updated atomic feature matrix that aggregates the features of neighboring nodes. ; Specifically, for each atom, the formula for calculating its updated characteristics is: , in Represents atoms The vector updated after the first message passing layer This represents the initial vector before the update; Represents atoms neighboring atoms, This represents an atom. The set of adjacent atoms; and These are two hyperparameters used to indicate the weights of the corresponding features. Represents the perception function; (3-4) The updated atomic feature matrix obtained in step (3-3) and atomic adjacency matrix The input is fed into the second message-passing layer of the local representation learning network, and the computation process in step (3-3) is repeated to update the atomic vectors and output the atomic feature matrix. ; (3-5) The atomic feature matrix obtained in step (3-4) The list of molecule-atom relationships is input into the molecular feature computation layer for local representation learning. The summation and averaging of all atomic features in each molecule yields the feature vector for that molecule. The feature vectors of all molecules constitute a structure of size [missing information]. Molecular local feature matrix ; (3-6) The molecular local feature matrix obtained in step (3-5) The input local representation is the local prediction layer of the learning network, and the size of the network weight matrix corresponding to this layer is... The output size is Local predicted adjacency matrix ; (3-7) The molecular local feature matrix obtained in step (3-5) Adjacency matrix of drugs The input is fed into the attention computation layer of the first graph attention sampling network of the global representation learning network. The local feature vectors of molecules are used as the initial representations of drug nodes in the drug interaction network. The attention coefficients between each pair of drugs in the drug interaction network are calculated, and the output size is... Attention weight matrix; (3-8) The size obtained in step (3-7) is The attention weight matrix and the drug interaction network obtained in step (3-2) are input into the sampling layer of the first graph attention sampling network of the global representation learning network. The 2-hop neighborhood nodes of the target drug are sampled according to the attention weight to obtain the importance subgraph corresponding to each drug. The subgraph adjacency matrix is constructed based on the importance subgraph and the subgraph adjacency matrix is output. (3-9) Combine the importance subgraph obtained in step (3-8) with a size of Molecular local feature matrix The first graph attention sampling network of the global representation learning network is used to aggregate the subgraph node features, and the attention coefficients of the nodes in the importance subgraph of each drug are input to the network. Normalization is performed to obtain normalized attention coefficients. Node features from the importance subgraph are aggregated to update the features of the target drug node. Interaction information is added to the learned drug vector, and the output is a vector of size [value missing]. Molecular global feature matrix ; (3-10) For the second graph attention sampling network of the global representation learning network, repeat steps (3-7) to (3-9) above, with an output size of Molecular global feature matrix ; (3-11) Based on the drug adjacency matrix Perform edge extraction. The location of the drug and medicine Form a drug pair as an edge The output length is List of drug pairs This represents the total number of edges in the drug interaction network obtained in step (3-2); (3-12) The molecular global feature matrix obtained in step (3-10) The drug pair list obtained in step (3-11) is concatenated to obtain a list of size [size missing]. The edge feature matrix; (3-13) Input the edge feature matrix obtained in step (3-12) into the classifier for classification, and obtain the length of... A list of interaction prediction labels is generated, and then a global prediction adjacency matrix is constructed based on the list of interaction prediction labels and the list of drug pairs. ; (3-14) Based on the local predicted adjacency matrix obtained in step (3-6) The global predicted adjacency matrix obtained in step (3-13) Calculate the loss function and use it to train the drug interaction prediction model until the model converges, thus obtaining the trained drug interaction prediction model. (3-15) Use the test set obtained in step (3-1) to validate the drug interaction prediction model initially trained in step (3-14) until the classification accuracy reliability index reaches the optimal level, and finally obtain the trained drug interaction prediction model.
5. The drug interaction prediction method based on graph attention sampling according to claim 4, characterized in that, The calculation formula in step (3-7) is as follows: , in Indicates drug and medicine The weighting coefficients between them No. The feature vector of a drug corresponds to the local feature matrix of the molecule. The Row vectors; It is a vector concatenation operator used to concatenate the vectors on both sides of the symbol. This represents the network weight parameters of the attention calculation layer. It is an activation function, and the specific function formula is as follows: , in It is a fixed constant, and its range is .
6. The drug interaction prediction method based on graph attention sampling according to claim 5, characterized in that, The normalized calculation formula for the attention coefficient in step (3-9) is as follows: , in This represents an exponential function, specifically expressed as: , The maximum attention coefficient corresponding to all nodes in the subgraph representing the importance of the target drug. Represents the set of drug nodes in the importance subgraph; The formula for calculating the updated drug vector is as follows: , in Indicates drug The local eigenvectors, corresponding to the local feature matrices The OK.
7. The drug interaction prediction method based on graph attention sampling according to claim 6, characterized in that, The formula for calculating the loss function in step (3-14) is as follows: , , , in For local prediction of adjacency matrix Chinese medicine and medicine The corresponding interaction prediction results, It is a globally predicted adjacency matrix drug and medicine The corresponding interaction prediction results, Labels indicating actual drug interactions Here, is the divergence function, used to calculate the degree of difference between predictions based on the global and local representations. and This represents the weight hyperparameter.
8. A drug interaction prediction system based on graph attention sampling, characterized in that, include: The first module is used to acquire the drug pair data to be predicted. It preprocesses the drug pair data to obtain preprocessed drug pair data and drug molecule sequences. A molecular sequence transformation model is used to convert the preprocessed drug molecule sequences into molecular structure diagrams, atomic vector matrices, and a list of molecular-atom relationships. An atomic adjacency matrix is then constructed based on the molecular structure diagrams. Specifically, the first module involves filtering the drug pair data, retaining only the drug ID, drug molecule sequence, and drug pair interaction labels, resulting in filtered drug pair data. This filtered data is then cleaned, removing data with missing information. Next, the drug molecule sequences contained in the cleaned drug pair data are extracted and converted into molecular structure diagrams, atomic vector matrices, and a list of molecular-atom relationships using a molecular sequence transformation model. Each atom has a feature dimension of 147. Finally, an atomic adjacency matrix is constructed based on the molecular structure diagrams. If the atoms in the molecular structure diagram and atoms If they are connected, then these two atoms are in the atomic adjacency matrix. The corresponding element The value is 1, otherwise The value is 0, where , Indicates the number of atoms in a molecule; The second module is used to construct a drug interaction network based on the drug interaction labels in the drug pair data to be predicted after preprocessing in the first module. And construct a drug adjacency matrix based on this drug interaction network. ,in This represents a set of nodes, where each node represents a drug in the drug pair data. The first module represents the set of edges, where each edge represents an interaction between two drugs in the data; the second module is the drug adjacency matrix constructed based on the drug interaction network. It is OK A matrix of columns, where each element Indicates drug and medicine Does an interaction exist? If so, then ,otherwise ,in , This indicates the number of drugs included in the drug pair data; The third module is used to input the atom vector matrix, atom adjacency matrix, and molecular-atomic relationship list obtained from the first module, as well as the drug interaction network and drug adjacency matrix obtained from the second module, into the pre-trained drug interaction prediction model to obtain the final drug interaction prediction result. The drug interaction network model consists of three parts: a sequentially connected local representation learning network, a global representation learning network, and a classifier.