Graph neural network-oriented prediction result interpretation visualization method

By designing a visualization method for predicting drug interactions, and utilizing view design and interactive functions, the problem of insufficient explanatory power of existing methods is solved. This enables an intuitive display of drug interaction pathways and biological mechanisms, improving user experience and decision-making efficiency.

CN121148463APending Publication Date: 2025-12-16SICHUAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511298213.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-11
Publication Date
2025-12-16

AI Technical Summary

Technical Problem

Existing methods for predicting drug interactions lack interpretability in terms of visualization, making it difficult to reveal the interaction pathways and biological mechanisms between drugs. This results in users struggling to fully understand the complexity, and the methods are cumbersome and unintuitive to use.

Method used

A visualization method for interpreting prediction results of graph neural networks is designed. Through view design and interactive functions, including drug aggregation view, drug target view, drug action path view, path comparison view and drug grouping result view, the interaction paths between drugs and their potential biological mechanisms are displayed. Interactive visualization view and multi-dimensional interactive functions are adopted.

Benefits of technology

It increases users' confidence in the model's prediction results, simplifies the complexity of operation, enables users to explore prediction data more efficiently, quickly locate key pathways, and provide valuable decision support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121148463A_ABST
    Figure CN121148463A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of information visualization and visual analysis, and discloses a graph neural network-oriented prediction result interpretation visualization method, which comprises the following steps: acquiring and processing drug and protein related data, converting the data into a knowledge graph form, and storing the data in a graph database; performing view design, including a projection-based drug aggregation view, a drug target view, a directed acyclic graph-based drug action path view, a path comparison view and a multi-panel-based drug grouping result view, and performing visual layout and implementation respectively. According to the method, in visualization of drug interaction prediction, important features influencing model prediction can be identified, and an interaction path between drugs and a potential biological mechanism thereof are further disclosed, so that the defect that an existing method is insufficient in interpretation capability is overcome; and by constructing an interactive visual view, the credibility of the user on the model prediction result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information visualization and visual analysis technology, specifically to a visualization method for interpreting prediction results from graph neural networks. Background Technology

[0002] Drug interactions have a significant impact on disease prevention and treatment, affecting not only drug efficacy and safety but also potentially triggering adverse reactions and increasing patient morbidity and mortality. While traditional in vitro experiments and clinical trials are frequently used by researchers in the pharmaceutical field, they suffer from limitations such as high cost and lengthy processes, and are particularly difficult to detect subtle drug interactions. With the development of computer science, many researchers have begun to use computational methods to predict drug interactions. A commonly used computational prediction strategy is based on similarity searches of drug molecular structures and analysis of the mechanisms of action between drugs. In recent years, with advancements in biological networks and systems biology, neural network-based prediction methods have been proposed. Drug interactions can be viewed as relationships between different nodes in a biological network. Due to the graph structure of biomolecules such as drugs and targets, graph neural networks have made significant progress in drug interaction prediction.

[0003] In drug interaction prediction, besides pursuing higher prediction accuracy, researchers have increasingly recognized that the interpretability of prediction results is equally important. Understanding the biological mechanisms behind the predictions not only helps verify the reliability of the model but also provides valuable scientific evidence for drug development and clinical decision-making. Graph neural network-based drug interaction prediction methods should not only possess high prediction accuracy but also reveal the underlying biological mechanisms through interpretable models.

[0004] Visualization technology plays a crucial role in enhancing users' understanding of the internal workings of models and increasing their trust in model predictions. While current visualization methods can identify the most critical features for model decision-making, they fall short in explaining how these features specifically influence prediction results, a problem particularly prominent in the field of drug interaction prediction. Most existing tools rely on graph visualizations to show the relationships between drug entities, failing to fully reveal the interaction pathways and underlying biological mechanisms, making it difficult for users to fully understand the complexity of drug interactions. Furthermore, existing methods are relatively basic in their view design, lacking rich interactive features, making the user experience cumbersome and unintuitive. This not only limits users' ability to explore data in depth but also affects the efficiency of their effective decision-making based on visualization results. Summary of the Invention

[0005] To address the aforementioned problems, the present invention aims to provide a visualization method for interpreting graph neural network prediction results. This method, in the visualization of drug interaction predictions, not only identifies key features affecting model predictions but also further reveals the interaction pathways between drugs and their underlying biological mechanisms, thereby overcoming the shortcomings of existing methods in terms of interpretability. The technical solution is as follows:

[0006] A method for interpreting and visualizing prediction results from graph neural networks includes the following steps:

[0007] Step S1: Obtain drug and protein-related data and perform data cleaning;

[0008] Step S2: Convert the data obtained in Step 1 into a knowledge graph and store it in a graph database;

[0009] Step S3: View Design

[0010] Design a projection-based aggregated view of drugs, and present the dimensionality reduction results of drug entities in the form of a scatter plot;

[0011] Design a drug target view to show the relationship between the user-selected drug node and other drug nodes, and display the prediction results and correlations between drug combinations;

[0012] Design a drug action path view based on directed acyclic graphs (DAGs), and present detailed explanations of drug interaction prediction examples through DAGs;

[0013] Design a path comparison view to graphically display the specific paths of drug combinations in a directed acyclic graph, helping users view specific paths in the drug action path view;

[0014] Design a multi-panel-based drug grouping results view, and present the prediction results between drug group combinations through the interactive linkage of the drug action path view and the path comparison view.

[0015] Step S4: Visual Layout and Implementation

[0016] The drug aggregation view visualization layout is based on a scatter plot, which projects drug entities into a two-dimensional space and calculates the spatial position of view elements by the similarity and difference of drug nodes.

[0017] The drug target visualization layout is based on the target map. It encodes the relationship between drug nodes by position, angle and color, encodes the confidence of the prediction result by the size of the radius of the target map circle, distinguishes different types of drug nodes by color, and distinguishes different relationships of drug combinations by line type.

[0018] The visualization layout of the drug action path view is based on a directed acyclic graph. First, the subgraphs in the knowledge graph are extracted and converted into paths with fixed directions. Then, nodes of the same type are merged, and the path set is simplified into a directed acyclic graph.

[0019] The pathway comparison view visualization layout graphically displays the pathway differences between multiple drug combinations, encoding the pathways of action between drug combinations through glyphs, colors, and positions;

[0020] The drug grouping results view visualization layout is based on a multidimensional data panel, which encodes the predicted results between drug combinations by location and color.

[0021] The beneficial effects of this invention are:

[0022] 1) This invention not only identifies key features affecting model predictions in the visualization of drug interaction predictions, but also further reveals the interaction pathways between drugs and their potential biological mechanisms, thus overcoming the shortcomings of existing methods in terms of explanatory power. By constructing an interactive visualization view, this invention enables users to understand the complex relationships between drug entities in an intuitive and hierarchical manner, enhancing users' confidence in the model's prediction results.

[0023] 2) This invention introduces multi-dimensional interactive functions into the view design, such as node clicking, dynamic path display, data highlighting, and result comparison, which greatly improves the user experience and reduces operational complexity. With these functions, users can more efficiently explore predictive data and quickly locate key pathways, thereby providing more valuable decision support in drug development and drug safety analysis. Attached Figure Description

[0024] Figure 1 This is a schematic diagram of the framework of the drug interaction prediction visualization interpretation method in this invention.

[0025] Figure 2 This is a schematic diagram illustrating the visualization process for predicting results in this invention.

[0026] Figure 3 This is a schematic diagram comparing the directed acyclic graph of this invention with traditional methods.

[0027] Figure 4 This is a schematic diagram of the drug action path view interaction in this invention.

[0028] Figure 5 This is a schematic diagram showing the effect and overall layout of the present invention. Detailed Implementation

[0029] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.

[0030] like Figure 1 As shown, the specific steps of the overall method flow of the present invention are as follows:

[0031] Step 1: Data Acquisition and Cleaning

[0032] First, drug data, protein data, and relationship data between them are obtained from publicly available datasets. This data is stored in the files drugs.csv, protein.csv, and edges.csv, respectively. Drug data includes drug names, basic properties, side effect information, and chemical structures. Protein data includes protein names, protein gene identifiers, and protein sequences. Relationship data records the interactions between drugs and proteins, including source node names, target node names, and relationship types.

[0033] Figure 1 Decagon is an artificial intelligence system designed by Marinka Zitnik, a postdoctoral fellow in computer science, and his colleagues, graduate student Monica Agrawal and associate professor of computer science Jure Leskovec, to predict rather than simply track the potential side effects of drug combinations. It can better describe and help doctors decide which drugs to take and assist researchers in finding better drug combinations to treat complex diseases.

[0034] Secondly, drug and protein data are validated using drug and protein databases to ensure accuracy and consistency. Next, column names in the data tables are standardized according to the specifications of public databases, converting raw field names into lowercase letters connected by underscores in a uniform format; for example, "DrugName" is converted to "drug_name", and "ProteinGene" is converted to "protein_gene". This standardization ensures the uniformity of the data structure and facilitates subsequent processing and analysis. Finally, redundant data and missing values ​​are removed to guarantee data quality.

[0035] Step Two: Data Processing and Storage

[0036] The acquired protein data, drug data, and the relationships between them are structured to transform this data into standardized triplet formats for further analysis and querying. Specifically, the information in the protein and drug data is transformed according to the pattern "<entity>relationship<entity>" to form a triplet data structure, where each triple consists of two entities and their relationship. Entities mainly include protein entities and drug entities, while relationships represent the interactions, targeting effects, or other relevant biological associations between proteins and drugs.

[0037] To ensure efficient storage and retrieval of triplet data, the transformed triplet data is imported and stored in the graph database Neo4j. Graph databases are naturally suited to graph-structured data, enabling efficient storage and retrieval of complex relationships between entities. By transforming the data into a graph structure and storing it in Neo4j, rapid retrieval and analysis of relationships between drugs and proteins can be achieved, supporting subsequent reasoning, visualization, and drug development. The storage structure of the graph database is as follows:

[0038] Graph(V, E)

[0039] Where V is the set of nodes in the graph, containing drug nodes and protein nodes, and E is the set of edges in the graph, representing the interactions or other relationships between drugs and proteins.

[0040] Step 3: View Design

[0041] like Figure 1 As shown, the visualization module of this invention is divided into two parts: a prediction result exploration visualization module and a prediction result interpretation visualization module. The prediction result exploration visualization module is as follows: Figure 2 As shown, the view includes a drug aggregation view and a drug target view, with the specific view design as follows:

[0042] 1. Drug Aggregation View Design: To help researchers in the pharmaceutical field quickly overview the prediction results of the model, this invention presents the dimensionality reduction results of drug entities in the form of a scatter plot, and allows users to interactively select drug nodes to view the corresponding prediction results.

[0043] (1) Visual encoding

[0044] Drug entities are represented by circular nodes, their relative positions are used to indicate similarity and differences, and different types of drug nodes are distinguished by color.

[0045] Color: In order to distinguish different types of drug nodes and to ensure visual consistency as much as possible, this invention uses orange to represent user-selected drug nodes, dark green to represent confirmed drug nodes, and light green to represent predicted drug nodes.

[0046] Line type: In order to clearly show the relationship between drug nodes, this invention uses different line types to represent the relationship between drug nodes. Solid lines are used to represent drug nodes that have been confirmed to have drug interaction with the currently selected drug node, and dashed lines are used to represent drug nodes that are predicted to have drug interaction with the currently selected drug node.

[0047] (2) Interaction Design

[0048] Tip: To help users identify other nodes related to a specific drug node, when a user hovers the mouse over a node, other related nodes will be highlighted. To enhance visibility, the system uses a gradual flashing effect to highlight these edges, ensuring users can clearly identify the relevant nodes.

[0049] Interactive View: This invention helps users select drug nodes of interest for further analysis through mouse click selection. When a user clicks on a node, the drug target view is redrawn based on the relevant data for that drug node.

[0050] 2. Drug Target View Design: To assist researchers in the pharmaceutical field in selecting drug combinations, this invention presents the relationship between the user-selected drug node and other drug nodes, showcasing the prediction results and correlations between drug combinations. It also allows users to interactively select a second drug node, providing a detailed explanation of this drug combination.

[0051] The visual encoding is as follows:

[0052] Location: In the drug aggregation view, the drug node selected by the user is placed at the center of the view. Other nodes that are related to the currently selected drug node are distributed in different locations on the target map. Specifically, the radius of each ring in the view represents a different relationship. The outermost solid ring represents drug nodes that have proven interactions with the selected drug node. The five inner dashed rings, from the outside in, represent the intervals of prediction scores of 0.6, 0.7, 0.8, 0.9, and 1.0, respectively. Drug nodes with prediction scores greater than 0.6 are displayed in the corresponding ring according to their prediction scores.

[0053] Angle: In order to facilitate users to quickly locate drug nodes, this invention adopts the same angle encoding method as the relative angle in the drug aggregation view, and presents other nodes that are related to the currently selected drug node in the drug target view according to their relative angles.

[0054] Color: To maintain visual consistency, the node color coding in the drug target view is consistent with the color coding in the drug aggregation view.

[0055] The prediction result interpretation visualization module includes a drug action path view, a path comparison view, and a drug grouping result view. The specific view design is as follows:

[0056] 3. Drug Action Pathway View Design: To present a detailed explanation of a specific drug interaction prediction example, this invention first obtains the subgraph that has the greatest impact on that example. Then, the subgraph is pruned, removing disconnected nodes. By extracting paths from the subgraph, the set of all action pathways for the selected drug combination is obtained. This invention adds a fixed direction to each path, constructs a linked list data structure, and merges as many nodes of the same type as possible to simplify the path set. Finally, the path set is simplified into a directed acyclic graph to clearly display the path information.

[0057] (1) Visual encoding

[0058] Color: This invention uses color to distinguish between drug nodes and protein nodes. Orange represents the drug node selected by the user, green represents other drug nodes in the action path, and purple represents protein nodes in the action path.

[0059] Position: The relative position of nodes indicates their order in the action path. This invention uses a line from the starting node to the ending node as a drug action pathway.

[0060] Width: The width of an edge represents the size of the set of overlapping edges. To address the issue that the size of the set of overlapping edges in the resulting subgraphs of a directed acyclic graph may differ depending on the interpretation of different prediction results, this invention normalizes it to ensure that the width of the edges does not lack visual expressiveness due to the sheer number of edges.

[0061] (2) Interaction Design

[0062] Tip: To help users identify paths through specific nodes, this invention incorporates a hover interaction. When a user hovers the mouse over a node, the path associated with that node and other related nodes are highlighted, allowing the user to quickly identify structures directly related to that node. To further enhance path visibility, especially for edges with small sets of overlapping edges, this invention employs a gradient flashing effect to highlight these edges.

[0063] Interactive Views: This invention helps users select a path of interest in a directed acyclic graph for further analysis through mouse click selection. When a user clicks a node, the path comparison view is redrawn based on the related paths of that node.

[0064] 4. Pathway Comparison View Design: To assist users in viewing specific paths within the drug action pathway view, this invention clearly presents the action pathways between different drug combinations, helping users more intuitively compare the interactions of different drug combinations in biological pathways. This pathway diagram can not only display the action pathway of a single drug but also simultaneously show the path differences between multiple drug combinations, allowing users to quickly identify the similarities and differences in the mechanisms of action of drug combinations. By comparing the nodes and edges between different paths, users can conduct in-depth analysis of drug interactions.

[0065] (1) Visual encoding

[0066] Fonts: The fonts in the path comparison view include path length fonts, path thumbnail fonts, drug node fonts, and protein node fonts. A bar percentage indicator represents the path length comparison among all paths, forming the path length font. The highest height of the path represents the longest path, and the ratio of the current path's height to the longest path corresponds to this. The path thumbnail font uses a green rectangle (D) to represent drug nodes and a purple rectangle (P) to represent protein nodes. If multiple protein nodes or adjacent drug nodes exist in a path, the "D:X" format is used to further simplify the path representation. The drug node font displays the drug's DrugBank name, and the protein node font simultaneously displays the protein's length and molar mass.

[0067] Color: To ensure visual consistency, the colors of drug nodes and protein nodes are consistent with the color coding of nodes in the drug action pathway.

[0068] Location: This invention arranges the user-selected multi-hop paths sequentially from top to bottom, with each row representing one path. The path nodes for each path are arranged from left to right, making the comparison between different paths more intuitive.

[0069] (2) Interaction Design

[0070] Selection: To help users explore the details of the pathway in depth, this invention designs a click-based interaction method, allowing users to click on a protein node to view various properties of that protein. Specific properties are displayed in the form of a frequency histogram, helping users understand the role and distribution of proteins in different pathways.

[0071] Interactive View: This invention helps users explore the interaction between drug groups through mouse click selection. When a user selects a certain action path, the drug group view will be redrawn based on the drug-related data in the selected path.

[0072] Exploration: To help users more comprehensively view the functions of proteins, this invention designs a drag-and-drop interactive method, allowing users to observe the three-dimensional spatial structure of proteins from multiple angles.

[0073] Note: To help users compare the similarities and differences between different pathways of action, this invention highlights all protein pathways within the pathways of action.

[0074] 5. Drug Grouping Result View Design: To help users explore the differences between prediction results of different drugs, this invention clearly presents the prediction results between drug group combinations.

[0075] (1) Visual encoding

[0076] Color: This invention uses color to distinguish different interaction categories in the bar chart. The Tableau 10 color palette is used to differentiate between different categories of drug interaction examples, making comparisons between drug groups more intuitive.

[0077] Location: This invention uses a multi-panel layout to display the prediction results between drug combinations. One group of drugs is arranged horizontally, and the other group is arranged vertically. The intersection of the two groups represents the prediction results for these two drugs. Within each drug combination, the top five drug interaction types with the highest prediction scores are displayed, and the prediction scores are shown using a bar chart.

[0078] (2) Interaction Design

[0079] Note: To help users better identify different drug groups with the same interaction in a drug combination, this invention features a mouse hover interaction. When a user hovers the mouse over a prediction result, other prediction results that predict the same type of drug interaction as that node will be highlighted. This highlighting effect helps users quickly identify other drug combinations related to the current drug, facilitating comparison and analysis in the visualization.

[0080] Step 4: Visual Layout and Implementation

[0081] 1. Visual layout and implementation of drug aggregation view:

[0082] To preserve the local structure and nonlinear relationships of the data and to present the clustering structure in visualization, this method uses the UMAP (Uniform Manifold Approximation and Projection) algorithm for dimensionality reduction. Assume the original dataset is X = {x1, x2, ..., x...} n},in Let represent the high-dimensional feature of the i-th data point, and d be the original dimension of the data. Using the UMAP algorithm, these data points are reduced to a two-dimensional space, resulting in a new dataset Y = {y1, y2, ..., y...}. n},in This represents the coordinates of the i-th data point in two-dimensional space.

[0083] To address the different attributes of drug data (such as drug structure and descriptive information), this invention combines multiple processed data features using a concatenative fusion method. For example, the structural information of a drug can be represented as a vector. Drug description information can be represented as After fusing these different data features, we obtain the merged vector v. merged .

[0084] Use GNNExplainer to adjust the dimensionality reduction results, ensuring all coordinate values ​​are non-negative. If there exists a coordinate y... i If the expression = (x, y) such that x < 0 or y < 0, then the following formula can be used for adjustment:

[0085] y i ′=max(0,y i )

[0086] In the formula, y i ′ represents the adjusted coordinates, ensuring that all coordinate values ​​are non-negative.

[0087] GNNExplainer is a model-independent, perturbation-based method that can provide interpretable reports on predictions from any GNN (Graph Neural Networks)-based model on any graph-based machine learning task.

[0088] Based on SVG (Scalable Vector Graphics) technology, call <path>The element draws the paths between drug entity nodes and sets the path line type according to a preset visual encoding scheme. The path line type includes both solid and dashed lines to distinguish different types of relationships. (Call) <circle>The element draws each drug entity node, determines the node's display position in the view based on the dimension-reduced coordinate values, and writes the corresponding drug node identification information into the [database / module name]. <circle>The `class` attribute of each element facilitates subsequent interactive operations. Each drug entity node is assigned a color according to a color visual coding scheme; different colors distinguish the attributes or categories of the drug nodes. A mouse click event is bound to each drug entity node; when the user triggers a click, the system responds and implements the selection and interaction functions for the drug node.

[0089] 2. Visualization layout and implementation of drug target view:

[0090] Based on the interaction prediction results, this invention can obtain the prediction scores of drug nodes related to the currently selected node by the user. The prediction score of each drug node represents the strength of its interaction or the degree of association with the selected drug. These prediction scores will be used to determine the position of the drug nodes in the view and their hierarchical structure.

[0091] First, the position of each drug node in the view is calculated based on its predicted score and its relationship with the selected drug. Specifically, drug nodes with higher predicted scores are placed closer to the selected drug node, while those with lower predicted scores are placed relatively further away. To achieve this, the predicted scores are mapped to specific locations in the coordinate system, ensuring that the relative position of each drug node reflects the strength of its relationship with the selected drug node.

[0092] During view rendering, call <path>The element draws the paths between drug entity nodes and sets the path line style according to a preset visual encoding scheme. The path line style includes both solid and dashed lines to distinguish different types of relationships. This is achieved using SVG. <circle>Each drug node is drawn using the element. The node's display position in the view is determined based on its reduced coordinates, and the corresponding drug node identification information is written to the [database / module name]. <circle>The `class` attribute of the element is used for subsequent interactive operations; each drug entity node is assigned a color according to the color visual coding scheme, and different colors are used to distinguish the attributes or categories of drug nodes; a mouse click event is bound to each drug entity node, and when the user triggers a click operation, the system responds and implements the selection and interaction functions of the drug node.

[0093] The location of a drug node is determined by its prediction score and its relative relationship with the selected drug node. The specific calculation process is as follows:

[0094] Assume the coordinates of the selected drug node are (x selected y selected If ), then the distance d from the selected node is... i and θ i It is possible to predict the score s i Perform the calculation. For the i-th drug node, its position (x... i y i It can be determined by calculation formula:

[0095] x i =x selected +d i ×cos(θ i ), y i =y selected +d i ×sin(θ i )

[0096] In the formula, d i =f(s) i ), angle θ i The relative position and hierarchical structure of the drug nodes determine the position. Next, each drug node is drawn one by one according to the calculated coordinates, ensuring that the position of these nodes matches their predicted score. The color of the drug nodes is also encoded according to their type.

[0097] 3. Visual layout and implementation of drug action pathway view:

[0098] Based on the graph neural network interpretation method GNNExplainer, this invention receives a trained prediction model and the prediction instance to be interpreted as input, generating an interpretation subgraph containing the relationship between drugs and proteins. This interpretation subgraph characterizes the key structures and relationships of the model for that prediction instance. In the processing, the invention first prunes the interpretation subgraph, removing disconnected nodes to ensure the graph is connected and avoid isolated nodes affecting subsequent analysis. Next, two nodes in the drug combination are selected as the start and end nodes, and a depth-first traversal method is used to extract all paths from the start to the end node from the subgraph. These paths represent the pathways of action of the drug combination. To make the path display more orderly, fixed directions are added to the paths, and they are constructed as linked list data structures. The linked list structure effectively reduces the clutter in the path display, making the relationships and order of the paths clearer. Next, in the linked list set, this invention merges nodes of the same type as much as possible. After these optimizations, the simplified path set is finally transformed into a directed acyclic graph. Since the path information does not contain cycles, its dependencies are represented by directed edges, specifically P = {p1, p2, ..., p...}. n }

[0099] In the formula, p i For nodes on the path, the directed edges (p) in the directed acyclic graph i ,p j () indicates path dependencies.

[0100] like Figure 3 As shown, the traditional force-guided graph layout, presenting a directed acyclic graph (DAG), fails to clearly display the interaction between drug nodes and protein nodes, and contains numerous intersecting edges, making it difficult to identify drug action pathways. This invention adds fixed direction information to the extracted path set and constructs each path as a linked list data structure. Within the linked list set, nodes of the same type are merged to simplify the graph structure, transforming the simplified path set into a DAG. Utilizing its acyclic property, the DAG clearly displays path flow and dependencies, avoiding cyclic relationships. To optimize visualization, this invention employs the Sugiyama algorithm to optimize the layout of the DAG, minimizing edge intersections and thus clearly displaying path information.

[0101] A configuration set network of the directed acyclic graph (DAG) is constructed using the networkx utility library, and nodes and edges are added, deleted, and simplified. The simplified graph structure is then stored as an adjacency list, converted into a graph object from the graphlib library, node styles and animation effects are set, and mouse event listener logic is bound to the front-end interface. The viz.js library is used to generate an SVG-formatted visualization on the front end, displaying the DAG rendering result to the user. The SVG format ensures clear display of the graphics at different resolutions and supports zooming and interactive operations in the browser.

[0102] Specifically, assuming the intersection degree of the paths is C, this invention reduces intersections by optimizing the following objective function:

[0103]

[0104] In the formula, E represents the set of edges in the graph, and cross(e i ,e j ) is edge e i and e j The degree of overlap between them.

[0105] The desired effect is as follows Figure 3 As shown, this optimized directed acyclic graph visualization method greatly improves the visualization of drug action pathways, simplifies complex drug-protein interaction networks, enables users to analyze drug mechanisms of action more clearly, and provides strong support for subsequent drug research and development.

[0106] 4. Path comparison view visualization layout and implementation:

[0107] This invention uses <path> 、 <rect> 、 <text>The SVG element draws a path and fills the path with color according to the preset color coding scheme. In the view, the nodes of each path are arranged in turn according to the design requirements. Specifically, the path nodes N = {n1, n2, …, n n} are set to have P i = (x i , y i ). Wherein P i represents the coordinates of the i-th node, x i , y i are the horizontal and vertical coordinates calculated according to the path relationship.

[0108] These paths show the interaction between drugs and proteins and their action pathways, helping users quickly identify the association between different nodes.

[0109] Whenever the user selects a new path, the system will add the relevant path data to the path array and trigger the update of the view. This update operation enables the paths displayed in the view to reflect the user's selection and requirements in a timely manner. Each path will be redrawn according to the new data to ensure that the latest path information is displayed, while dynamically displaying in the view. As shown in Figure 4 , in this way, the user can observe the changes in the path in real time, facilitating the analysis of the interaction relationship between different drugs or proteins.

[0110] 5. Drug grouping result view visualization layout and implementation:

[0111] First, according to the obtained prediction results and the drug grouping selected by the user through interaction, the corresponding prediction results will be extracted. These prediction results will be used to show the relative relationship between drug groups, especially the prediction scores between them. In order to effectively present these data, the present application uses a <rect>The elements are used to draw column charts in the view, where each column chart represents the prediction result of a drug group. Specifically, the height of the column chart is proportional to the prediction score between the drug groups, and the higher the prediction score, the higher the height of the column chart. Assuming that the prediction score of the drug group G i is s i , the height h i of the i-th column chart is mapped by a linear function, that is, h i = f(s i ). In the process of drawing the column chart, the application sets appropriate styles for each column chart, including color filling, the width of the column chart, and the like. Assuming that the width of each column chart is w, the color of the column chart is encoded according to the type or other attributes of the drug group.

[0112] The implementation effect and overall layout of the application are shown in Figure 5 . The application can not only identify important features affecting model prediction in the visualization of drug interaction prediction, but also further reveal the interaction paths between drugs and their potential biological mechanisms, thereby making up for the defects of the existing methods in insufficient explanation ability. The application enables users to understand the complex relationships between drug entities in an intuitive and hierarchical manner by constructing an interactive visualization view, thereby improving the trust of users in the prediction results of the model. The application introduces multi-dimensional interaction functions in the view design, greatly improves the user experience, and reduces the operation complexity; this function enables users to more efficiently explore the prediction data and quickly locate the key action pathways, thereby providing more valuable decision support in drug research and development and drug safety analysis.< / rect> < / text> < / rect> < / path> < / circle> < / circle> < / path> < / circle> < / circle> < / path>

Claims

1. A method for interpreting and visualizing prediction results from graph neural networks, characterized in that, Includes the following steps: Step S1: Obtain drug and protein-related data and perform data cleaning; Step S2: Convert the data obtained in Step 1 into a knowledge graph and store it in a graph database; Step S3: View Design Design a projection-based aggregated view of drugs, and present the dimensionality reduction results of drug entities in the form of a scatter plot; Design a drug target view to show the relationship between the user-selected drug node and other drug nodes, and display the prediction results and correlations between drug combinations; Design a drug action path view based on directed acyclic graphs (DAGs), and present detailed explanations of drug interaction prediction examples through DAGs; Design a path comparison view to graphically display the specific paths of drug combinations in a directed acyclic graph, helping users view specific paths in the drug action path view; Design a multi-panel-based drug grouping results view, and present the prediction results between drug group combinations through the interactive linkage of the drug action path view and the path comparison view. Step S4: Visual Layout and Implementation The drug aggregation view visualization layout is based on a scatter plot, which projects drug entities into a two-dimensional space and calculates the spatial position of view elements by the similarity and difference of drug nodes. The drug target visualization layout is based on the target map. It encodes the relationship between drug nodes by position, angle and color, encodes the confidence of the prediction result by the size of the radius of the target map circle, distinguishes different types of drug nodes by color, and distinguishes different relationships of drug combinations by line type. The visualization layout of the drug action path view is based on a directed acyclic graph. First, the subgraphs in the knowledge graph are extracted and converted into paths with fixed directions. Then, nodes of the same type are merged, and the path set is simplified into a directed acyclic graph. The pathway comparison view visualization layout graphically displays the pathway differences between multiple drug combinations, encoding the pathways of action between drug combinations through glyphs, colors, and positions; The drug grouping results view visualization layout is based on a multidimensional data panel, which encodes the predicted results between drug combinations by location and color.

2. The method for interpreting and visualizing prediction results of graph neural networks according to claim 1, characterized in that, In step S1, data acquisition and cleaning specifically involve: Step S11: Obtain three files, drugs.csv, protein.csv, and edges.csv, from the public dataset containing drug data, protein data, and relation data. Drug data includes drug name, basic attributes, side effects, and chemical structure; protein data includes protein name, protein gene, and protein sequence; relation data includes source node name, target node name, and relation type. Step S12: Check the drug and protein data through drug and protein databases, standardize the data format according to the public database standard data column names, and delete redundant and missing values.

3. The method for interpreting and visualizing prediction results of graph neural networks according to claim 2, characterized in that, In step S2, the data processing and storage specifically include: Step S21: The acquired protein data, drug data, and the relationship between them are structured and transformed into data in the form of triplets according to the <entity>relationship<entity> pattern. The entities include protein entities and drug entities, and the relationships include the interaction and targeting effects between proteins and drugs. Step S22: Import and store the transformed triplet data in the graph database Neo4j.

4. The method for interpreting and visualizing prediction results of graph neural networks according to claim 1, characterized in that, In step S3, the drug aggregation view design includes: Visual encoding: Circular nodes represent drug entities, and relative positions represent the similarity and differences between drug nodes; colors are used to distinguish different types of drug nodes, with the first color representing the user-selected drug node, a dark second color representing confirmed drug nodes, and a light second color representing predicted drug nodes; lines are used to represent different relationships between drug nodes, with solid lines representing nodes that have been confirmed to interact with the currently selected drug node, and dashed lines representing nodes predicted to interact with the currently selected drug node. Interaction design: Hovering the mouse over a node highlights the current node and its related nodes; clicking the mouse to select a node redraws the drug target view based on the drug data of the selected node.

5. The method for interpreting and visualizing prediction results of graph neural networks according to claim 4, characterized in that, In step S3, the drug target view design includes: Visual encoding: The selected drug node in the drug aggregation view is represented by the center position of the view; dashed rings are used to represent drug nodes with different confidence levels that are predicted to have an interaction relationship, with the range of predicted scores increasing from the outside to the inside. Drug nodes with predicted scores greater than a set threshold are displayed in the corresponding rings according to their predicted scores; solid rings are used to represent drug nodes that have been confirmed to have an interaction relationship; different types of nodes are distinguished by color, and the color coding is consistent with the color coding of the drug aggregation view; the same angle coding method as the relative angle in the drug aggregation view is used to present other nodes that are related to the currently selected drug node in the drug target view according to their relative angles.

6. The method for interpreting and visualizing prediction results of graph neural networks according to claim 5, characterized in that, In step S3, the drug action pathway view design includes: Visual encoding: Different nodes are distinguished by color. The first color represents the drug node selected by the user, the second color represents other drug nodes in the path, and the third color represents protein nodes in the path. The relative position between nodes represents their data in the action path. The width of the edges represents the size of the set of overlapping edges. Interaction design: Hovering the mouse over the node highlights the path associated with the current node and other related nodes, and the visibility of the path is enhanced by a gradient flashing highlight effect.

7. The method for interpreting and visualizing prediction results of graph neural networks according to claim 6, characterized in that, In step S3, the path comparison view design includes: Visual encoding: A bar percentage indicator is used to represent the length of a certain path among all paths, forming the path length glyph; a second-colored rectangle is used to represent drug nodes, forming the drug node glyph; a third-colored rectangle is used to represent protein nodes, and a bar chart is used inside the rectangle to present the length and molar mass of the protein, forming the protein node glyph; Interactive design: Users can click on protein nodes to view their various attributes and three-dimensional structure, and drag the protein's three-dimensional structure to display its conformation, active site, and interaction with other molecules.

8. The method for interpreting and visualizing prediction results of graph neural networks according to claim 7, characterized in that, In step S3, the design of the drug grouping results view includes: Visual encoding: One group of drugs is arranged horizontally, and another group is arranged vertically. The intersection of the two groups represents the prediction results of the two drugs. In each drug pair, the top n drug interaction types with the highest prediction scores are displayed, and the prediction scores are shown in a bar chart. Different interaction categories in the bar chart are distinguished by color. Interaction design: When predicting results by hovering the mouse over the node, other predictions that predict the same type of drug interaction as the current node will be highlighted, while other irrelevant predictions will be grayed out.

9. The method for interpreting and visualizing prediction results of graph neural networks according to claim 8, characterized in that, In step S4, the specific process of visualizing and implementing the drug aggregation view is as follows: Data dimensionality reduction: All drug-related data, including drug structure information and drug side effect information, are processed. A series fusion method is used to merge multi-dimensional drug attribute data into a unified data representation. Based on the unified drug attribute data, a uniform manifold approximation and projection algorithm is invoked to construct a uniform manifold approximation and projection model object, mapping the high-dimensional data to a two-dimensional space. For different attributes of the drug data, the processed multiple data features are merged using a series fusion method. Layout implementation: Based on the predicted score of each drug node and its relationship with the selected drug, the position of the drug node in the view is calculated. By mapping the predicted score to a specific position in the coordinate system, the relative position of each drug node is ensured to reflect the strength of its relationship with the selected drug node. Based on SVG technology, call <path>The element draws the paths between drug entity nodes and sets the path line style according to a preset visual encoding scheme; [The function] calls... <circle>The element draws each drug entity node, determines the node's display position in the view based on the dimension-reduced coordinate values, and writes the corresponding drug node identification information into the [database / module name]. <circle> The element's class attribute; assigning colors to each drug entity node according to a color visual coding scheme, with different colors used to distinguish the attributes or categories of drug nodes; binding a mouse click event to each drug entity node, so that when the user triggers a click operation, the system responds and implements the drug node selection and interaction functions.< / circle> < / circle> < / path> 10. The method for interpreting and visualizing prediction results of graph neural networks according to claim 9, characterized in that, In step S4, the specific process of visualizing and implementing the drug target view is as follows: Based on the interaction prediction results of the drug combination, prediction scores of other drug nodes related to the selected drug node are obtained; these prediction scores reflect the association strength between the drug node and the selected node, and serve as the basis for determining the position and hierarchy of the drug node in the visualization view; SVG is invoked. <circle> The element draws drug entity nodes. During the drawing process, based on the predicted score and the relative position of the drug node and the selected node in the drug aggregation view, the angle value of each drug node relative to the selected drug node is calculated according to the determined relative position coordinates, and the drug nodes are drawn in sequence according to the order of the predicted scores. At the same time, the color coding scheme of the drug aggregation view is used to color code the nodes.< / circle> 11. The method for interpreting and visualizing prediction results of graph neural networks according to claim 10, characterized in that, In step S4, the specific process of visualizing and implementing the drug action path view is as follows: Path extraction: Based on the graph neural network interpretation method, a trained prediction model and the prediction instance to be interpreted are received as input to generate an interpretation subgraph containing the relationship between drugs and proteins; the interpretation subgraph is pruned to remove unconnected nodes with a degree of 0. The two drug nodes corresponding to the target drug combination are set as the start node and the end node, respectively, and the adjacency relationship representation for path search is determined on the pruned interpretation subgraph. The depth-first traversal method is used to enumerate and extract all paths from the start node to the end node in the interpretation subgraph to obtain a path set. Each path consists of a sequence of nodes and edges arranged in traversal order. The path set is stored and filtered and sorted according to preset criteria for subsequent visualization rendering and result interpretation display. Layout implementation: Fixed direction information is added to the extracted path set, and each path is constructed as a linked list data structure. Nodes of the same type are merged within the linked list to simplify the graph structure. The simplified path set is then converted into a directed acyclic graph (DAG) to display path flow and dependencies. The Sugiyama algorithm is used to optimize the layout of the DAG, minimizing the number of edge intersections. A configuration set network for the DAG is constructed using the networkx library, and nodes and edges are added, deleted, and simplified. The simplified graph structure is stored as an adjacency list, converted into graph objects from the graphlib library, node styles and animation effects are set, and mouse event listener logic is bound to the front-end interface. The viz.js library is used to generate SVG format visualizations on the front end to display the rendering results of the DAG.

12. The method for interpreting and visualizing prediction results of graph neural networks according to claim 10, characterized in that, In step S4, the specific process of visualizing and implementing the path comparison view is as follows: Calling SVG <path> 、 <rect> 、 <text> The system draws the drug-protein action pathway and fills the pathway with color according to a preset color coding scheme. The nodes of each path are arranged sequentially according to design requirements to visually display the path relationships between nodes. When a user selects a new path, the corresponding path data is added to the path array, triggering a view update. The system redraws the corresponding path based on the updated path data, achieving dynamic display of the path in the view. Click interaction events are bound to the nodes in the path; when a user clicks a target node, the system displays detailed information related to the target node, including the basic attributes, 3D structure, and frequency histogram of the protein node.< / text> < / rect> < / path> 13. The method for interpreting and visualizing prediction results of graph neural networks according to claim 10, characterized in that, In step S4, the specific process of visualizing and implementing the drug grouping results view is as follows: Based on the obtained interaction prediction results and the drug groups selected by researchers in the pharmaceutical field through interactive methods, the prediction result data corresponding to the drug groups are extracted; SVG is called. <rect> Elements are used to draw coordinate axes and bar charts. The prediction results for each drug group are presented in the form of a bar chart, and the height of the bar chart represents the prediction score between drugs. The display style of the bar chart is set, including the color fill method and the bar chart width parameter.< / rect> Bind a mouse event listener to the bar chart element to trigger a highlight effect when the user interacts with it.