Antibacterial peptide function explainable prediction method and system based on graph causal learning
By constructing an antimicrobial peptide function prediction model based on graph causal learning, the problems of insufficient modeling of sequence structure information and poor interpretability in existing technologies are solved. This model achieves efficient identification and interpretable prediction of antimicrobial peptide functions, and improves the robustness and interpretability of the model.
Patent Information
- Application Number
- CN202511339234.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-18
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2045-09-18
AI Technical Summary
Existing methods for predicting the function of antimicrobial peptides lack the ability to model sequence structure information, making it difficult to express the complex spatial dependencies between residues. Furthermore, the models lack interpretability and fail to provide mechanistic support for experimental verification and molecular design. In multi-label prediction tasks, they are weak in identifying rare functional categories.
A graph causal learning-based approach is adopted. By introducing a pre-trained protein language model to extract the contextual semantic vectors of residues, a residue contact probability matrix is constructed and a binary contact map is formed. Graph neural networks are used to encode node features, and an attention-guided feature selection mechanism is used to dynamically compress redundant regions. A multi-task classifier is introduced for functional prediction, and the model is optimized through semantic-level and instance-level comparative learning to locate key functional regions and visualize them.
It significantly enhances the modeling ability of antimicrobial peptide spatial topological relationships, improves the robustness and generalization ability of the model, realizes the focus and interpretability of functional regions, provides an explanatory path from residue diagrams to biological mechanisms, and enhances the transparency and biological explanatory ability of the model.
Smart Images

Figure CN120808899B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of bioinformatics technology, and particularly relates to a method and system for interpretable prediction of antimicrobial peptide function based on graph causal learning. Background Technology
[0002] With the increasing resistance of pathogens such as bacteria, fungi, and viruses to traditional chemical antibiotics, the development of novel, highly effective, and low-toxicity treatments for infections has become an important research direction in the biomedical field. Antimicrobial peptides (AMPs), as an important component of the body's innate immune system, are widely found in animals, plants, and microorganisms. They possess broad-spectrum antibacterial properties, low resistance induction, and immunomodulatory functions, and have become potential candidate molecules to replace antibiotics, finding wide application in infection control, tumor treatment, and immune enhancement, among other fields.
[0003] In recent years, with the development of high-throughput sequencing technology and experimental validation methods, multiple antimicrobial peptide databases have been established, such as APD3, DRAMP, dbAMP, and AMPfun, providing rich basic data resources for constructing computational models. Based on this data accumulation, numerous computational methods have been proposed for the identification and functional prediction of antimicrobial peptides.
[0004] Existing methods such as iAMP-2L and AMPfun mainly rely on traditional machine learning models (such as KNN, SVM, RF, etc.) and manually constructed sequence features (PseAAC, AAC, RAAC, etc.) for prediction, but their ability to capture complex contextual dependencies and spatial topological structures between residues is limited. In recent years, deep learning methods have been gradually introduced, such as iAMP-CA2L combining CNN and LSTM for two-stage modeling, and multi-AMP constructing a multi-task network to predict AMPs and their functions, but they still use linear sequences as input and lack explicit modeling of structural information and functional motifs.
[0005] Therefore, although existing methods have achieved certain results in AMP identification and functional prediction and have practical value in specific tasks, they still have the following prominent problems: First, they lack the ability to model sequence structure information and are difficult to express complex spatial dependencies between residues; second, the models are mostly black box structures, lack interpretability, and are difficult to provide mechanistic support for experimental verification and molecular design; third, they have weak ability to identify rare functional categories in multi-tag prediction tasks and are difficult to adapt to the needs of large-scale antimicrobial peptide screening and complex functional peptide development. Summary of the Invention
[0006] The purpose of this application is to provide a method and system for interpretable prediction of antimicrobial peptide function based on graph causal learning, so as to at least solve the technical problems of existing methods in AMP identification and functional prediction, which lack the ability to model sequence structure information and lack interpretability.
[0007] To achieve the above objectives, the embodiments of this application provide the following technical solutions.
[0008] According to one embodiment of this application, a method for interpretable prediction of antimicrobial peptide function based on graph causal learning is provided, comprising the following steps:
[0009] S101: Introduce a pre-trained protein language model, extract the context semantic vector of each residue, and construct a residue contact probability matrix by combining attention weights. After thresholding, form a binary contact graph. Construct a protein graph structure with protein residues as nodes and the binary contact graph as edges.
[0010] S102: A graph neural network (GNN) is used to encode the residue nodes of the graph structure. Based on an attention-guided feature selection mechanism, task-related weights are assigned to each node and node edge relationships. Redundant regions are dynamically compressed and weakened to obtain structural sub-graph regions related to antibacterial function, thus forming a graph representation.
[0011] S103: Map the graph representation to a multi-layer contrastive space to form an embedded representation for contrast optimization. The multi-layer contrastive space includes semantic-level contrastive learning and instance-level contrastive learning. Introduce a multi-task classifier to predict the functional category label of the antimicrobial peptide based on the graph representation. Use cross-entropy loss and contrastive loss to jointly optimize the overall objective function to obtain an invariant graph representation. Through this joint optimization process, the model can extract an invariant graph representation with causal stability, providing a foundation for subsequent functional region localization and interpretation analysis.
[0012] S104: Based on the node attention weights and edge importance scores in the invariant graph representation obtained during training, the regions that play a decisive role in predicting antibacterial function are located and labeled, and a causal subgraph with causal basis is constructed. Combining the key functional motifs of known antibacterial peptide structures, the extracted causal subgraph nodes are mapped back to the original amino acid sequences. A sliding window alignment is used to visualize the key functional motifs.
[0013] Preferably, in step S101:
[0014] Two non-shared multilayer perceptrons were used to perform dimensional alignment and nonlinear fusion of protein sequences and residue properties to obtain node features;
[0015] Extract the multi-head attention weight tensors of each multi-layer language model from the protein pre-trained language model, perform cross-layer and cross-head weighted summation, and obtain the overall attention between residue pairs;
[0016] By setting a structural connection threshold and binarizing the contact probability matrix, we obtain the graph edges used to construct the protein graph structure.
[0017] Construct a two-dimensional protein graph structure G=(V,E) using protein residues as nodes and a binary contact graph as edges, where... It is a set of nodes, corresponding to each residue in the protein. This represents the number of residues in an amino acid sequence, with each residue forming a node, and the nodes together constitute a set V. Let be the set of edges, corresponding to pairs of residues that are spatially close to each other. Represents a node With nodes The relationship between them Represents a node With nodes There is an edge between them;
[0018] Edge features are embedded using Gaussian radial basis function (RBF) to embed continuous contact strength values, ultimately yielding a K-dimensional edge feature embedding, expressed as:
[0019]
[0020] In the formula, To fix the mean center, Indicates the kernel width; Edge features representing residue pairs; represents the sum of multi-head attention across all layers, exp represents the natural exponential function, and K represents the dimension of the edge feature embedding;
[0021] For each residue, the semantic vector and physicochemical features of the protein pre-trained language model are fused together, and the weights of the edges are combined to construct a weighted graph structure, represented as: G=(V,E,X,Φ), where V represents the set of nodes, E represents the set of edges, X represents the node features, and Φ represents the edge features.
[0022] Preferably, in step S102, a multi-layer stacked graph neural network structure is adopted. Each layer of the network structure includes a neighbor aggregation module, a message passing module, and a node update module. In the node update module, the original feature vector of node v in the l-th layer is represented as... The update rule is expressed as:
[0023]
[0024] In the formula, Sigmoid represents the activation function, and AGGREGATE represents the aggregation function. and These are learnable parameters; This represents the set of neighboring nodes of node v. Let represent the original feature vector of node u in the (l-1)th layer, where u represents a neighboring node that has an edge with node v;
[0025] Using node attention channels, the importance of a single residue node to the current functional task is evaluated, denoted as:
[0026]
[0027] In the formula, This represents a node attention scoring network that outputs the attention saliency score of node v. ; This represents the original feature vector of node u. This represents the original feature vector of node v;
[0028] The structural propagation saliency between two adjacent residues is evaluated using the side attention channel, as shown below:
[0029]
[0030] In the formula, Represents the edge attention function. LeakyReLU represents vector concatenation; LeakyReLU represents the activation function. This represents the original feature vector of node u. This represents the original feature vector of node v; , Let E represent the original feature vector of the edge;
[0031] Based on node attention weights and edge attention weights, the node features and edge features are updated with weights respectively, resulting in a compressed graph representation, as follows:
[0032]
[0033] In the formula, A graphical representation focusing on the structural-functional coupling region. The attention saliency score represents the value of a node. The importance score represents the edge; V represents the set of nodes, v represents a node in the set of nodes V, and u represents a neighboring node that has an edge with node v. Representing edge features, This represents the original feature vector of node v.
[0034] Preferably, in step S103, the diagram is represented. Mapping to a contrastive learning space, a unified embedding representation of antimicrobial peptide map samples is constructed. ;
[0035] The mapping function employs a two-level nonlinear transformation, expressed as:
[0036]
[0037] In the formula, Represents a semantic feature transformer; , Represents a linear transformation matrix. , ReLU represents the bias term, and ReLU represents the activation function. This represents the activation function Sigmoid; A graphical representation focusing on the structural-functional coupling region.
[0038] Preferably, in step S103:
[0039] The constructed semantic-level contrastive learning objectives include: for each functional category C represents the total number of functional categories, and a semantic center vector is defined. , Represents a d-dimensional real space; initializes or updates it by aggregating sample embedding vectors; for any graph sample Graph-level representation through embedding functions Mapped to contrast space, where, The embedding representation of the i-th sample is defined, and a semantic center vector is defined based on each antibacterial function. The constructed semantic contrast loss is represented as follows:
[0040]
[0041] In the formula, This represents the temperature coefficient; T is the transpose operator. Represent the true functional category of the i-th graph sample and determine the semantic center that the sample should "approach"; Let C represent the semantic center vector corresponding to the true functional category of the i-th graph sample, and let C represent the total number of functional categories. It is the semantic center vector of the c-th functional category;
[0042] The constructed instance-level contrastive learning objective includes: for each graph sample The contrast loss is calculated together with the positive and negative examples to construct a positive-negative pair for each sample. , The constructed instance contrastive loss is expressed as:
[0043]
[0044] In the formula, Here, J is another temperature coefficient, and J is the number of negative samples. This represents the positive embedding of the i-th graph sample; This represents the negative embedding of the j-th graph sample; j represents the index of the negative sample; T is the transpose operator. This represents the embedding representation of the i-th antimicrobial peptide map sample in the contrastive learning space after mapping.
[0045] Preferably, in step S103, the structural diagram is represented. The input is fed into a classifier, and the sigmoid activation is used to obtain the predicted probability of the function label. C represents the total number of functional categories; the prediction loss is the cross-entropy loss, expressed as:
[0046]
[0047] In the formula, C represents the total number of functional categories; Indicates the true label, Indicates the predicted probability;
[0048] Construct a general objective function that includes multi-label cross-entropy, instance contrastive loss, and semantic contrastive loss, expressed as:
[0049]
[0050] in, Describe the overall objective function. Represents cross-entropy loss, This represents semantic contrast loss. Indicates instance comparison loss. , All represent weights. .
[0051] Preferably, in step S104, the attention saliency score of node v is extracted from the output layer of the graph neural network (GNN). Importance score of edges ,in, This is used to quantify the contribution of nodes to functional prediction; , used to characterize the functional correlation of interactions between residues;
[0052] Attention saliency score for node v Normalization was performed, and the attention saliency score after normalization was obtained. Represented as:
[0053]
[0054] Introducing a threshold adaptation mechanism to set a dynamic threshold Filter out those that meet the requirements The residue nodes are used to form a key residue subset, and the key residue subset is used as a node set. Preserve the edges between nodes within the subset and construct a causal subgraph. ,in, v represents a node in the node set, u represents a neighboring node that has an edge with node v, and E represents the edge set.
[0055] Preferably, in step S104, a rule base containing key functional motifs is constructed, including diamino acid motifs, triamino acid motifs, cation-rich regions, and aromatic motifs; the key residue nodes of the causality graph are mapped back to the original amino acid sequences to obtain the corresponding sequence fragments. n is the number of key residues;
[0056] The segment is scanned using a sliding window algorithm with a window length of 2-5. The matching motif is detected using the following formula:
[0057]
[0058] in, These correspond to two-amino acid motifs and three-amino acid motifs, respectively. Indicates the test results. This represents a subsequence of length k starting from position i in sequence segment S; the motif library is a rule base for key functional motifs;
[0059] The cation enrichment region is determined by an indicator function, as shown in the following formula:
[0060]
[0061] in, Indicates an indicator function; Used to determine whether the i-th residue is lysine K or arginine R, where b represents the starting position of the window;
[0062] Calculate confidence scores for matching motifs The formula is as follows:
[0063]
[0064] The results are sorted by confidence level, and the highly relevant results are retained and then visualized.
[0065] Preferably, binary and multi-classification metrics are introduced for performance evaluation and verification;
[0066] Among them, the binary classification metrics include precision, recall, and F1 score; in the multi-class classification metrics, a class adaptive threshold mechanism is introduced, and multiple metrics are combined for quantitative evaluation.
[0067] In the category adaptive threshold mechanism, for each functional label, different probability thresholds are enumerated, and the optimal threshold that maximizes the F1 score or AUPR of the current category is selected, so that the optimal threshold is used as the decision boundary of the current category.
[0068] In the quantitative evaluation using multiple metrics, these metrics include macro average precision, macro average recall, and macro average F1 score.
[0069] According to another embodiment of this application, a graph causal learning-based system for predicting the function of antimicrobial peptides is provided. The prediction system includes the following modules:
[0070] The graph structure module is used to introduce a pre-trained protein language model, extract the contextual semantic vector of each residue, and construct a residue contact probability matrix by combining attention weights. After thresholding, a binary contact graph is formed. The protein graph structure is constructed with protein residues as nodes and the binary contact graph as edges.
[0071] The graph representation module is used to encode the residue nodes of the graph structure using a graph neural network (GNN), and based on an attention-guided feature selection mechanism, assigns task-related weights to each node and node edge relationships, dynamically compresses and weakens redundant regions, and obtains structural subgraph regions related to antibacterial function to form a graph representation.
[0072] The contrast optimization module maps the graph representation to the semantic contrast space to form an embedded representation for contrast optimization. Semantic-level contrast learning objectives and instance-level contrast learning objectives are constructed respectively. A multi-task classifier is introduced to predict the functional category label of the antimicrobial peptide based on the graph representation. The overall objective function is jointly optimized using cross-entropy loss and contrast loss to obtain an invariant graph representation.
[0073] The causal subgraph module is used to locate and label regions that play a decisive role in predicting antibacterial function based on node attention weights and edge importance scores obtained during training. It constructs a causal subgraph with causal basis, combines key functional motifs of known antibacterial peptide structures, maps the extracted causal subgraph nodes back to the original amino acid sequences, and uses a sliding window alignment to visualize the key functional motifs.
[0074] Compared with the prior art, the beneficial effects of the antimicrobial peptide function interpretable prediction method and system based on graph causal learning in this application are:
[0075] This application introduces a pre-trained protein language model to extract the contextual semantic vector of each residue. A residue contact probability matrix is then constructed by combining this matrix with the model's internal attention weights. After thresholding, a binary contact graph is formed. Each residue node is further integrated with physicochemical properties to construct a multi-channel feature representation. This results in a functional correlation graph structure with residues as nodes and structural contacts as edges, significantly enhancing the model's ability to model spatial topological relationships. This method does not require three-dimensional structural information, overcoming the limitations of traditional linear sequence modeling and providing graph neural networks with more semantically rich and structurally sensitive input representations.
[0076] During training, the model in this application dynamically assigns task-relevance weights to residue nodes and their connections, uses node attention values to filter functionally significant regions, constructs key subgraphs, and effectively eliminates residue paths unrelated to the target function. This mechanism not only enhances the model's ability to focus on functional regions but also reduces the interference of invalid information propagation, improving the model's robustness and generalization ability across data distributions. Compared to traditional graph coding methods, this module achieves an organic combination of structural cognition and target recognition, demonstrating stronger structural awareness and expression compression capabilities.
[0077] This application's semantic-level contrast constructs semantic center vectors for functional categories, guiding similar samples to cluster in the embedding space and improving intra-class consistency; instance-level contrast constructs positive and negative sample pairs, optimizing the discriminativeness of graph embeddings and improving inter-class separability; this mechanism combines structural perturbation and sample transformation to mine functional structural features that remain stable in different environments, avoiding the model learning spurious correlation patterns; the contrastive learning process guides the model to extract invariant representations with causal stability through projection mapping and joint loss optimization.
[0078] In the model prediction stage, this application utilizes node attention to identify key functional regions and map them back to the original sequence. It then uses a sliding window algorithm to detect typical functional fragments such as two / three amino acid motifs, cation-rich regions, and aromatic residues. The matching results are presented in a visual manner, constructing an explanatory path from residue maps to biological mechanisms. This enables traceable verification of the model's decision results and significantly enhances the model's transparency and biological explanatory power. Attached Figure Description
[0079] The accompanying drawings, which form part of this application, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:
[0080] Figure 1 This is a flowchart illustrating the workflow of the antimicrobial peptide function interpretability prediction method based on graph causal learning in this application.
[0081] Figure 2This is a flowchart illustrating the implementation of the graph causal learning-based method for predicting the function of antimicrobial peptides in this application.
[0082] Figure 3 This is a sub-flowchart of the antimicrobial peptide function interpretability prediction method based on graph causal learning in this application;
[0083] Figure 4 This is a block diagram of the antimicrobial peptide function interpretability prediction system based on graph causal learning in this application. Detailed Implementation
[0084] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0085] According to the embodiments of this application, a method embodiment of an interpretable prediction method for antimicrobial peptide function based on graph causal learning is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0086] Currently, the identification of antimicrobial peptide functions in related technologies faces technical challenges such as lack of structural modeling, insufficient predictive interpretability, and poor generalization ability of multi-label learning. Existing methods generally use linear sequences as input, failing to fully capture the spatial dependencies and structure-function coupling relationships between residues in antimicrobial peptides, making it difficult to effectively identify key functional regions. Furthermore, most mainstream deep learning models are black-box structures, lacking clear biological interpretation pathways and failing to provide mechanistic support for downstream antimicrobial peptide design and experimental validation. In addition, the label distribution of multifunctional antimicrobial peptides is extremely unbalanced, and existing models exhibit weak identification ability and poor robustness when facing rare functional categories.
[0087] To address the aforementioned issues, the prediction method in this application introduces a protein language model and attention mechanism to construct a residue structure diagram. It also integrates graph neural network encoding, redundancy compression mechanism, and causal invariance contrastive learning method to extract stable and reliable functional feature representations. Simultaneously, this application introduces causal interpretability analysis and biological motif backtracking mechanism to achieve a complete reasoning path from sequence to structure and from structure to function, effectively supporting the screening, classification, and interpretable prediction of antimicrobial peptides.
[0088] The prediction method of this application will be specifically described below with reference to specific embodiments.
[0089] In one embodiment of this application, a method for interpretable prediction of antimicrobial peptide function based on graph causal learning is provided. In the data collection and preprocessing steps, this application constructs a high-quality antimicrobial peptide multi-class dataset. Positive samples are from public databases such as APD3, CAMP, and DRAMP, while negative samples are screened from UniProt and sequences containing antimicrobial keywords are excluded. All sequences undergo a unified screening process to remove sequences with abnormal lengths or containing non-standard residues.
[0090] In addition, to reduce redundancy and homology bias, the CD-HIT tool is used for clustering filtering, with a similarity threshold of 40% set and relaxed to 50% for independent test sets. Furthermore, to avoid data leakage, there are no duplicate or highly similar sequences between the test set and the training set, thus ensuring the scientific rigor and precision of model training and evaluation.
[0091] Specifically, this application divides the antimicrobial peptide prediction task into two stages: the first stage is to identify antimicrobial peptides, and the second stage is to identify the functional activity of antimicrobial peptides. Different datasets were collected for the two stages.
[0092] For the first phase: Training data was integrated from seven publicly available antimicrobial peptide databases (APD3, CAMP, dbAMP, DRAMP, YADAMP, ADAPTABLE, and AMPfun), with positive samples being experimentally validated antimicrobial peptide sequences. The original sequences underwent uniform processing, filtering out sequences with lengths less than or equal to 10 or greater than or equal to 100, as well as samples containing non-standard amino acid residues (B, J, O, U, X, Z). Negative samples were obtained from the UniProt database, removing records containing antimicrobial-related keywords such as "antibacterial," and were cleaned using the same standards. To eliminate sequence redundancy and homology bias, the CD-HIT tool was used to cluster both positive and negative samples, setting a sequence similarity threshold of 40%, ultimately resulting in a training set of 5430 positive and 5430 negative samples. The independent test set was integrated from the DRAMP2.0 database and publicly released data from Veltri et al. and Bhadra et al. Samples underwent the same cleaning process, and the CD-HIT clustering threshold was increased to 50% to balance sequence diversity and quantity. The test set contains 3446 positive samples and 3446 negative samples. All models underwent five-fold cross-validation on this unified dataset to eliminate performance bias caused by differences in the original training sets, ensuring the comparability of experimental results and the reliability of conclusions.
[0093] For the second phase, the training data was primarily integrated from publicly available databases such as AMPfun, dbAMP, DRAMP, and ADAPTABLE, retaining antimicrobial peptide sequences with clearly defined multifunctional tag annotations. The original samples underwent a standardized cleaning process, including length filtering (10-100 residues), removal of non-standard residues, and homology redundancy removal. The CD-HIT clustering threshold was set to 40% to control sequence similarity and improve the diversity and representativeness of the training set.
[0094] The final multi-label training set consisted of 19,840 antimicrobial peptide samples, including both single-label and multi-label samples. The independent test set was derived from the same data system as the training set. A subset of independent functional annotations not used for training was selected and subjected to the same preprocessing and clustering operations (with a similarity threshold set to 50%), resulting in a test set of 4,510 multifunctional antimicrobial peptide samples.
[0095] Multi-label distributions exhibit a certain degree of class imbalance. This invention introduces a multi-label contrastive learning mechanism and a class adaptive threshold strategy during training to improve the model's ability to recognize low-frequency functional categories. All experiments employ a unified five-fold cross-validation design to ensure the model's performance stability and generalization ability in multi-functional recognition scenarios.
[0096] Please refer to Figure 1 and Figure 2 This application provides an interpretable prediction method for the function of antimicrobial peptides based on graph causal learning;
[0097] Includes the following steps:
[0098] S101: Introduce a pre-trained protein language model, extract the context semantic vector of each residue, and construct a residue contact probability matrix by combining attention weights. After thresholding, form a binary contact graph. Construct a protein graph structure with protein residues as nodes and the binary contact graph as edges.
[0099] Step S101 of this embodiment aims to convert linear protein sequences into structured graph representations, facilitating subsequent graph neural network modeling. This application introduces a structure adaptation mechanism and residue expression enhancement strategy based on a general protein pre-training framework to achieve deep semantic representation and functionally relevant feature modeling of amino acid sequences. Contextual dependency information between residues is extracted through a multi-layer Transformer encoder. Based on this, a contact probability matrix between residues is constructed and, after thresholding, forms a binary contact graph used to define structural relationships in the sequence. Each residue node integrates the semantic vector of the protein pre-training language model with its physicochemical properties (such as charge, polarity, hydrophobicity, etc.) to form a multi-dimensional feature representation. Finally, a functionally relevant two-dimensional graph structure is constructed with residues as nodes and structural contacts as edges.
[0100] Furthermore, structural contact edge prediction and binarization are performed;
[0101] Please refer to Figure 3 Step S101 in this embodiment specifically includes:
[0102] S201: Two non-shared multilayer perceptrons are used to perform dimensional alignment and nonlinear fusion of protein sequences and residue properties to obtain node features;
[0103] Specifically, step S201 is the step of extracting semantic features of protein residues, wherein a protein language modeling method (PLM) optimized for antimicrobial peptide tasks is used to semantically embed the original amino acid sequence; let the input be a sequence containing... A protein sequence of 100 amino acid residues, initially represented as , representing the high-dimensional embedding feature of the i-th residue in the output of the improved PLM model;
[0104] To enhance the interpretability and physicochemical properties of protein nodes, embodiments of this application further introduce the encoding of the physicochemical properties of residues. It includes properties such as hydrophobicity, acidity / basicity, charge, and aromaticity, with a total of 50 dimensions of physicochemical property vectors representing the properties of each residue;
[0105] Finally, two non-shared multilayer perceptrons are used to perform dimensional alignment and nonlinear fusion on the two channels mentioned above. The node features are fused in the following form:
[0106]
[0107] Wherein, MLP stands for Multilayer Perceptron, which is used to map the original embedding to a unified dimension d; It is a multilayer perceptron for processing high-dimensional embedded features in the output of improved PLM models. It is a multilayer perceptron that processes 50-dimensional physicochemical property vectors.
[0108] S202: Extract the multi-head attention weight tensors of each multi-layer language model in the protein pre-training model, perform cross-layer and cross-head weighted summation, and obtain the overall attention between residue pairs;
[0109] In step S202, the multi-head attention weight tensors of each layer in the protein pre-trained language model are extracted. A cross-layer, cross-head weighted summation is performed to obtain the overall attention between residue pairs. The overall attention is obtained by summing the multi-head attention of each layer. Characterized as follows:
[0110]
[0111] in, This represents the activation function sigmoid. The weights are adjustable; L represents the number of layers, and H represents the number of heads.
[0112] S203: Set the structural connection threshold, binarize the contact probability matrix, and obtain the graph edges used to construct the protein graph structure;
[0113] In step S203, a structural connection threshold is set. The contact probability matrix is binarized and expressed as:
[0114]
[0115] This yields the preliminary adjacency matrix. This binary adjacency matrix is used to construct the edge structure of a graph, representing the spatial proximity between two residues.
[0116] Furthermore, it also includes:
[0117] S204: Construct a two-dimensional protein graph structure using protein residues as nodes and binary contact graphs as edges;
[0118] In this embodiment, the constructed two-dimensional protein map structure is represented as: G=(V,E), where, It is a set of nodes, corresponding to each residue in the protein. This represents the number of residues in an amino acid sequence, with each residue forming a node, and the nodes together constitute a set V. Let be the set of edges, corresponding to pairs of residues that are spatially close to each other. Represents a node With nodes The relationship between them Represents a node With nodes There is an edge between them;
[0119] Edge features are embedded using Gaussian radial basis function (RBF) to embed continuous contact strength values, ultimately yielding a K-dimensional edge feature embedding, expressed as:
[0120]
[0121] In the formula, To fix the mean center, Indicates the kernel width; Represents the edge features of residue pairs (i,j); represents the sum of multi-head attention at each layer (i.e., continuous value of contact intensity), exp represents the natural exponential function, and K represents the dimension of the edge feature embedding;
[0122] Furthermore, at each node residue, after fusing the semantic vector and physicochemical features of the protein pre-trained language model, a weighted graph structure is constructed by combining the edge weights, represented as: G=(V,E,X,Φ), where V represents the set of nodes, E represents the set of edges, X represents the node features, and Φ represents the edge features;
[0123] The weighted graph structure constructed in this embodiment retains sequence context information and structural contact information, and introduces physicochemical constraints, which enhances the ability to identify functionally relevant residues during the modeling process. Compared with existing methods that only use a single semantic or contact graph structure, this application introduces a joint modeling mechanism of contact semantics assisted by physicochemical properties, which effectively improves the characterization ability of functional sites and the generalization ability of the model without the need for three-dimensional structural input.
[0124] In summary, this application introduces a pre-trained protein language model to extract the contextual semantic vector of each residue. This vector is then combined with the model's internal attention weights to construct a residue contact probability matrix. After thresholding, a binary contact graph is formed. Each residue node is further integrated with physicochemical properties to construct a multi-channel feature representation. Ultimately, a functional correlation graph structure is formed with residues as nodes and structural contacts as edges, significantly enhancing the model's ability to model spatial topological relationships. This method does not require three-dimensional structural information, overcoming the limitations of traditional linear sequence modeling and providing graph neural networks with more semantically rich and structurally sensitive input representations.
[0125] Please continue to refer to Figure 1 and Figure 2 Based on the antimicrobial peptide residue contact map constructed in the previous steps, in order to further improve the model's ability to identify key functional regions and suppress the interference of redundant information propagation, the antimicrobial peptide function interpretability prediction method based on graph causal learning in this application embodiment further includes:
[0126] S102: A graph neural network (GNN) is used to encode the residue nodes of the graph structure. Based on an attention-guided feature selection mechanism, task-related weights are assigned to each node and node edge relationships. Redundant regions are dynamically compressed and weakened to obtain structural sub-graph regions related to antibacterial function, thus forming a graph representation.
[0127] In step S102, this embodiment of the application utilizes a graph coding method that combines structure-aware feature extraction with task-driven compression mechanism to fuse and model the topological structure with residue semantics, and identifies functionally relevant subgraph regions through attention mechanism, effectively suppressing interference from structurally redundant regions.
[0128] Specifically, in the graph coding mechanism for structure-aware feature extraction, the constructed two-dimensional residue contact map is first input into a graph neural network (GNN) structure to construct a semantic representation based on topological information and residue context; weighted graph Where V represents the set of nodes, E represents the set of edges, and X represents the node features. Edge features; node features It includes context vectors, residue physicochemical property encodings, and positional bias information extracted from the protein language model.
[0129] A multi-layered stacked graph neural network structure is adopted. Each layer includes a neighbor aggregation module, a message passing module, and a node update module. In the node update module, the original feature vector of node v in layer l is represented as... The update rule is expressed as:
[0130]
[0131] In the formula, Sigmoid represents the activation function, and AGGREGATE represents the aggregation function. and These are learnable parameters; This represents the set of neighboring nodes of node v. Let represent the original feature vector of node u in the (l-1)th layer, where u represents a neighboring node that has an edge with node v;
[0132] Furthermore, in the task-driven compression mechanism, considering that there are a large number of structural regions in antimicrobial peptides that are not directly related to the prediction of the target function, if they are used directly for graph-level representation learning without screening, it may lead to a decrease in the generalization ability of the model.
[0133] To this end, the embodiments of this application dynamically calculate the task relevance weights of nodes and edges to compress redundant information and assign task relevance weights to nodes and edges to achieve structural focus on important subgraph regions;
[0134] Specifically, two attention channels are introduced:
[0135] The node attention channel is used to evaluate the importance of a single residue node to the current functional task, denoted as:
[0136]
[0137] In the formula, This represents a node attention scoring network that outputs the attention saliency score of node v. ; This represents the original feature vector of node u. This represents the original feature vector of node v;
[0138] The side attention channel is used to evaluate the structural propagation saliency between two adjacent residues, denoted as:
[0139]
[0140] In the formula, Represents the edge attention function. LeakyReLU represents vector concatenation; LeakyReLU represents the activation function. This represents the original feature vector of node u. This represents the original feature vector of node v; , Let E represent the original feature vector of the edge;
[0141] Based on node attention weights and edge attention weights, the node features and edge features are updated with weights respectively, resulting in a compressed graph representation, as follows:
[0142]
[0143] In the formula, A graphical representation focusing on the structural-functional coupling region. The attention saliency score represents the value of a node. The importance score represents the edge; V represents the set of nodes, v represents a node in the set of nodes V, and u represents a neighboring node that has an edge with node v. Representing edge features, This represents the original feature vector of node v.
[0144] During training, the model in this application dynamically assigns task-relevance weights to residue nodes and their connections, uses node attention values to filter functionally significant regions, constructs key subgraphs, and effectively eliminates residue paths unrelated to the target function. This mechanism not only enhances the model's ability to focus on functional regions but also reduces the interference of invalid information propagation, improving the model's robustness and generalization ability across data distributions. Compared with traditional graph coding methods, this module achieves an organic combination of structural cognition and target recognition, demonstrating stronger structural awareness and expression compression capabilities.
[0145] Furthermore, to enhance the model's generalization ability and interpretability in the multifunctional antimicrobial peptide prediction task, this invention introduces a causal invariant contrastive learning framework, combining multi-level contrastive objectives and multi-label supervision mechanisms to learn stable and robust functional feature representations; specifically, the antimicrobial peptide functional interpretability prediction method based on graph causal learning in this application embodiment further includes:
[0146] S103: Map the graph representation to a multi-layer contrastive space to form an embedded representation for contrast optimization. The multi-layer contrastive space includes constructed semantic-level contrastive learning and instance-level contrastive learning. Introduce a multi-task classifier to predict the functional category label of the antimicrobial peptide based on the graph representation. Use cross-entropy loss and contrastive loss to jointly optimize the overall objective function to obtain an invariant graph representation.
[0147] Through this joint optimization process, the model in this application embodiment can extract an invariant graph representation with causal stability, providing a basis for subsequent functional area localization and interpretation analysis;
[0148] In one implementation, in step S103, the structural-functional coupling diagram extracted in step S103 is represented. Mapping to a contrastive learning space, a unified embedding representation of antimicrobial peptide map samples is constructed. ;
[0149] The mapping function employs a two-level nonlinear transformation, expressed as:
[0150]
[0151] In the formula, This represents the semantic projection layer. , Represents a linear transformation matrix. , ReLU represents the bias term, and ReLU represents the activation function. This represents the activation function Sigmoid; A graphical representation focusing on the structural-functional coupling region.
[0152] Furthermore, in step S103:
[0153] The constructed semantic-level contrastive learning objective aims to narrow the distance between samples of the same functional category in the embedding space, forming a compact intra-class structure, while simultaneously widening the representations between different functional categories.
[0154] Specifically, this includes: for each functional category C represents the total number of functional categories, and a semantic center vector is defined. , It represents a d-dimensional real space, which is initialized or updated by aggregating sample embedding vectors;
[0155] For any given graph sample Graph-level representation through embedding functions Mapped to contrast space, where, Let represent the embedding representation of the i-th sample;
[0156] Furthermore, a semantic center vector is defined based on each type of antibacterial function. Semantic contrastive loss encourages similar samples to embed closer to the semantic center of the class, enhancing intra-class compactness;
[0157] The constructed semantic contrast loss is represented as follows:
[0158]
[0159] In the formula, This represents the temperature coefficient; T is the transpose operator. Represent the true functional category of the i-th graph sample and determine the semantic center that the sample should "approach"; Let C represent the semantic center vector corresponding to the true functional category of the i-th graph sample, and let C represent the total number of functional categories. It is the semantic center vector of the c-th functional category;
[0160] Furthermore, an instance-level contrastive learning objective is constructed to enhance inter-class separability and sample discrimination ability. The idea is to treat each graph sample as an instance of a contrarian learning objective. Positive examples (usually the same image from different perspectives / data augmentation) are compared with negative examples (samples from other images) to calculate the contrastive loss, thus constructing a positive-negative pair for each sample. , The constructed instance contrast loss is expressed as:
[0161]
[0162] In the formula, Here, J is another temperature coefficient, and J is the number of negative samples. This represents the positive embedding of the i-th graph sample; This represents the negative embedding of the j-th graph sample; j represents the index of the negative sample; T is the transpose operator. This represents the embedding representation of the i-th antimicrobial peptide map sample in the contrastive learning space after mapping.
[0163] Furthermore, a semantic fusion mechanism is introduced. To further improve the stability and semantic consistency of the embedding space, the contrastive embedding vector of each sample is weighted and fused with its corresponding semantic center to form the final embedding representation used for contrast optimization.
[0164]
[0165] in: Controls the fusion ratio between individual representations and category prototypes; Indicates the semantic center of the current category; The final contrastive embedding representation after fusion is represented; this mechanism further enhances intra-class consistency and stability against structural perturbations without sacrificing individual differences in expression, and is suitable for generalized modeling of antimicrobial peptide structures under multiple distributions.
[0166] Furthermore, in step S103, this embodiment performs task prediction and joint optimization; specifically, the structure diagram is represented as follows. The input is fed into a classifier, and the sigmoid activation is used to obtain the predicted probability of the function label. C represents the total number of functional categories; the prediction loss is the cross-entropy loss, expressed as:
[0167]
[0168] In the formula, C represents the total number of functional categories; Indicates the true label, Indicates the predicted probability;
[0169] Construct a general objective function that includes multi-label cross-entropy, instance contrastive loss, and semantic contrastive loss, expressed as:
[0170]
[0171] in, Describe the overall objective function. Represents cross-entropy loss, This represents semantic contrast loss. Indicates instance comparison loss. , All represent weights. .
[0172] The objective function in this embodiment ensures that the model, while possessing classification capabilities, learns to acquire stable and invariant feature representations across tasks, species, and distributions, making it suitable for applications such as high-throughput antimicrobial peptide screening and complex functional peptide identification.
[0173] The semantic-level comparison in this application constructs semantic center vectors for functional categories, guiding similar samples to cluster in the embedding space and improving intra-class consistency. The instance-level comparison constructs positive and negative sample pairs, optimizing the discriminativeness of graph embedding and improving inter-class separability. This mechanism combines structural perturbation and sample transformation to mine functional structural features that remain stable in different environments, avoiding the model learning spurious correlation patterns. The contrastive learning process guides the model to extract invariant representations with causal stability through projection mapping and joint loss optimization.
[0174] Furthermore, to enhance the interpretability of biological mechanisms and the ability to locate functional regions in antimicrobial peptide recognition, this application introduces a causal importance subgraph extraction and functional motif backtracking mechanism to achieve traceable mapping of model prediction results to structural regions, sequence fragments and functional motifs.
[0175] Please continue to refer to Figure 1 and Figure 2The method for predicting the function of antimicrobial peptides based on graph causal learning in this application further includes:
[0176] S104: Based on the node attention weights and edge importance scores in the invariant graph representation obtained during training, the regions that play a decisive role in predicting antibacterial function are located and labeled, and a causal subgraph with causal basis is constructed. Combining the key functional motifs of known antibacterial peptide structures, the extracted causal subgraph nodes are mapped back to the original amino acid sequences, and the key functional motifs are visualized by using a sliding window alignment.
[0177] Specifically, step S104 in this embodiment includes three steps: constructing a causal importance subgraph, mapping the subgraph to a sequence and detecting functional motifs, and visual interpretation.
[0178] In the step of constructing the causal importance subgraph, the dynamic extraction of the causal importance subgraph aims to locate the core region that plays a decisive role in predicting antibacterial function from the graph structure; firstly, the attention salience score of node v is extracted from the output layer of the graph neural network (GNN). Importance score of edges ,in, This is used to quantify the contribution of nodes to functional prediction; , used to characterize the functional correlation of interactions between residues;
[0179] Attention saliency score for node v Normalization was performed, and the attention saliency score after normalization was obtained. Represented as:
[0180]
[0181] Furthermore, embodiments of this application introduce a threshold adaptive mechanism to set a dynamic threshold. (This can be adjusted based on the characteristics of the functional categories), filter out those that meet the requirements. The residue nodes are used to form a key residue subset; the key residue subset is used as a node set. Preserve the edges between nodes within the subset (based on the binary contact graph constructed in step S101) and construct a causal subgraph. This subgraph retains only the structural paths directly related to the antibacterial function, effectively eliminating redundant information;
[0182] in, v represents a node in the node set, u represents a neighboring node that has an edge with node v, and E represents the edge set.
[0183] Furthermore, in the steps of mapping the causal subgraph to the sequence and detecting functional motifs, the construction and matching of the functional motif rule base is a crucial link connecting the causal subgraph with biological significance. This embodiment, based on generally accepted knowledge in the field of antimicrobial peptides, constructs a rule base containing key functional motifs, including diamino acid motifs (such as RW, KR), triamino acid motifs (such as RRR, KRL), cation-rich regions (three or more consecutive K / R residues), and aromatic motifs (rich in F, W, and Y residues). The key residue nodes of the causal subgraph are then mapped back to the original amino acid sequence to obtain the corresponding sequence fragments. n is the number of key residues;
[0184] The segment is scanned using a sliding window algorithm with a window length of 2-5. The matching motif is detected using the following formula:
[0185]
[0186] Where k=2 and 3 correspond to the two-amino acid motif and the three-amino acid motif, respectively; M k Indicates the test results. This represents a subsequence of length k starting from position i in sequence segment S; the motif library is a rule base for key functional motifs;
[0187] The cation enrichment region is determined by an indicator function, as shown in the following formula:
[0188]
[0189] in, Indicates an indicator function; Used to determine whether the i-th residue is lysine K or arginine R, where b represents the starting position of the window;
[0190] Calculate the confidence level C for the matching motif. m The formula is as follows:
[0191]
[0192] The results are sorted by confidence level, and the highly relevant results are retained and then visualized.
[0193] Furthermore, in the visualization and interpretation step, a causal subgraph is constructed using validation set data to locate the set of key edges that the model depends on when predicting antibacterial activity. Among them, the importance score of the key edge ( (As a threshold for edge importance, it can be set to 0.6); generate multiple versions of training data for causal subgraphs. The edges are retained according to the proportion Process (i.e. retain) (After removing key edges and randomly deleting remaining edges), a series of perturbed graph structure data are generated. Use the same trained model for each version Inference was performed, and performance metrics such as precision, recall, F1 score, and AUC were recorded. As the retention ratio r decreased (i.e., the edge deletion ratio increased), the model performance metrics showed a monotonically decreasing trend, thereby verifying the decisive role of key edges in the causal subgraph on the model's prediction and proving the effectiveness of the explanation mechanism.
[0194] In the model prediction stage, this application utilizes node attention to identify key functional regions and map them back to the original sequence. It then uses a sliding window algorithm to detect typical functional fragments such as two / three amino acid motifs, cation-rich regions, and aromatic residues. The matching results are presented in a visual manner, constructing an explanatory path from residue maps to biological mechanisms. This enables traceable verification of the model's decision results and significantly enhances the model's transparency and biological explanatory power.
[0195] Finally, to comprehensively evaluate the performance of the antimicrobial peptide function interpretability prediction method based on graph causal learning in binary and multi-class classification tasks, this invention uses multiple evaluation indicators to quantitatively analyze the model's accuracy in function recognition, class discrimination ability, and overall generalization stability.
[0196] The evaluation content covers two sub-tasks: binary classification and multi-classification indicators. That is, this application introduces binary classification and multi-classification indicators for performance evaluation and verification.
[0197] Among them, the binary classification metrics include precision, recall, and F1 score;
[0198] In multi-class indicators, a category adaptive threshold mechanism is introduced, and multiple indicators are combined for quantitative evaluation;
[0199] In the category adaptive threshold mechanism, for each functional label, different probability thresholds are enumerated, and the optimal threshold that maximizes the F1 score or AUPR of the current category is selected, so that the optimal threshold is used as the decision boundary of the current category.
[0200] In quantitative evaluation using multiple metrics, the metrics include macro average precision, macro average recall, and macro average F1 score.
[0201] Specifically, in this embodiment, precision is the proportion of samples that are actually antimicrobial peptides among all samples predicted as such by the model, reflecting the accuracy of the model's prediction results. Let TP represent the number of samples correctly predicted as antimicrobial peptides by the model, and FP represent the number of samples incorrectly predicted as antimicrobial peptides by the model. The calculation formula is:
[0202]
[0203] Recall measures the proportion of all real antimicrobial peptides correctly identified by the model, reflecting the model's coverage. It is calculated as the proportion of correctly predicted antimicrobial peptides out of the total number of correctly predicted peptides. Let TP represent the number of correctly predicted antimicrobial peptides, and FN represent the number of incorrectly predicted non-antimicrobial peptides. The formula for calculating recall is: ;
[0204] The F1 score comprehensively considers precision and recall, using the harmonic mean of precision and recall to provide a balanced evaluation metric. F1 more comprehensively reflects the quality of the model's explanation, avoiding the biased evaluation that may occur when using precision or recall alone. The formula for calculating F1 is: .
[0205] Furthermore, in the multi-class classification of this application embodiment, during the antimicrobial peptide multifunctional recognition stage, the model needs to determine whether each sample simultaneously possesses multiple antimicrobial functions. This task belongs to the multi-label classification problem. Due to the extremely uneven distribution of functional labels and the very small number of samples in some functional categories, directly using a fixed probability threshold (e.g., 0.5) for discrimination can easily lead to insufficient recognition performance for small categories. Therefore, this invention introduces a per-class adaptive thresholding mechanism and combines multiple indicators to quantitatively evaluate the model's multifunctional prediction capability; wherein, the per-class adaptive thresholding mechanism includes:
[0206] On the validation set, for each functional label, enumerate different probability thresholds and select the optimal threshold that maximizes the F1 score or AUPR for that category. This serves as the decision boundary for that category. This method fully considers the differences in category distribution, effectively improving the model's sensitivity to low-frequency functional labels and its overall prediction stability.
[0207] In macro-precision, the precision is calculated separately for each function label and then averaged to measure the accuracy of various prediction types. It is defined as follows:
[0208]
[0209] In macro-recall, the average of the recall rates for each feature label is calculated, reflecting the model's coverage across different features. It is defined as:
[0210]
[0211] In the macro-average F1 score, the harmonic mean of precision and recall is calculated for each feature label, and then averaged. The expression is as follows:
[0212]
[0213] in, , These represent the precision and recall of the tags, respectively.
[0214] Through the above-mentioned multi-index combination evaluation mechanism, combined with the category-optimal threshold strategy based on dynamic adjustment of the validation set, the present invention ensures that the model's predictive performance is balanced on high-frequency and low-frequency functional labels, thereby enhancing the adaptability and generalization ability of antimicrobial peptide multifunctional distribution modeling.
[0215] To verify the effectiveness of the method of this invention, experiments were conducted on independent test sets for both binary classification tasks (Stage 1: antimicrobial peptide recognition) and multi-class classification tasks (Stage 2: antimicrobial peptide function prediction), and comparisons were made with existing mainstream methods. The comparative models used in the experiments included AMP-BERT, TriNet, AMPpredMFA, amPEPpy, TranslmbAMP, IAMPCN, and IAMP-CA2L.
[0216] The evaluation metrics cover a comprehensive range of performance indicators, including accuracy (ACC), precision, recall, F1 score, specificity, and AUC, to fully reflect the model's predictive capabilities in different tasks.
[0217] Table 1 Results of the binary classification task
[0218]
[0219] Table 2 Results of Multi-Classification Task
[0220]
[0221] As can be seen from Table 1, in the binary classification task (Stage 1), the method of this invention significantly outperforms the comparison model in all evaluation metrics, especially in precision (0.8659), specificity (0.8871) and AUC (0.8643), indicating that the method can effectively identify antimicrobial peptide samples while ensuring high accuracy and maintaining strong generalization performance.
[0222] As can be seen from Table 2, the method of this invention also shows significant advantages in the multi-class classification task (Stage 2), with an overall accuracy of 0.6440 and an AUC of 0.7054, both of which are higher than the existing comparative methods. At the same time, it has a significant improvement in precision and recall compared with the comparative model, which verifies that the present invention has stronger robustness and discriminative ability when dealing with complex tasks with multiple labels and imbalanced classes.
[0223] In summary, the experimental results show that the present invention not only achieves a significant performance improvement in the antimicrobial peptide recognition task, but also demonstrates superior stability and generalization ability in the multi-classification task of antimicrobial peptide function, which can effectively support the practical application needs of large-scale antimicrobial peptide screening and functional prediction.
[0224] like Figure 4 As shown, according to another embodiment of this application, a predictive system for the interpretable function of antimicrobial peptides based on graph causal learning is provided. The predictive system includes the following modules:
[0225] Graph structure module 301 is used to introduce a pre-trained protein language model, extract the context semantic vector of each residue, and construct a residue contact probability matrix by combining attention weights. After thresholding, a binary contact graph is formed. The protein graph structure is constructed with protein residues as nodes and the binary contact graph as edges.
[0226] The graph representation module 302 is used to encode the residue nodes of the graph structure using a graph neural network (GNN), and based on an attention-guided feature selection mechanism, assign task-related weights to each node and node edge relationships, dynamically compress and weaken redundant regions, and obtain structural subgraph regions related to antibacterial function to form a graph representation.
[0227] The contrast optimization module 303 is used to map the graph representation to the semantic contrast space to form an embedded representation for contrast optimization. Semantic-level contrast learning objectives and instance-level contrast learning objectives are constructed respectively. A multi-task classifier is introduced to predict the functional category label of the antimicrobial peptide based on the graph representation. The overall objective function is jointly optimized using cross-entropy loss and contrast loss to obtain an invariant graph representation.
[0228] The causal subgraph module 304 is used to locate and label the regions that play a decisive role in predicting antibacterial function based on the node attention weights and edge importance scores obtained during training, construct a causal subgraph with causal basis, combine the key functional motifs of known antibacterial peptide structures, map the extracted causal subgraph nodes back to the original amino acid sequences, and use a sliding window comparison to visualize the key functional motifs.
[0229] Although embodiments of the present invention have been disclosed above, they are not limited to the applications listed in the specification and embodiments. It can be applied to various fields suitable for the present invention. Other modifications can be readily made by those skilled in the art. Therefore, without departing from the general concept defined by the claims and their equivalents, the present invention is not limited to the specific details and examples shown and described herein.
Claims
1. A method for predicting the interpretable function of antimicrobial peptides based on graph causal learning, characterized in that, Includes the following steps: S101: Introduce a pre-trained protein language model, extract the contextual semantic vector of each residue, and construct a residue contact probability matrix by combining attention weights. After thresholding, a binary contact graph is formed. The protein graph structure is constructed with protein residues as nodes and the binary contact graph as edges. S102: A graph neural network (GNN) is used to encode the residue nodes of the graph structure. Based on an attention-guided feature selection mechanism, task-related weights are assigned to each node and node edge relationships. Redundant regions are dynamically compressed and weakened to obtain structural subgraph regions related to antibacterial function, thus forming a graph representation. S103: Map the graph representation to a multi-layer contrastive space to form an embedded representation for contrast optimization. The multi-layer contrastive space includes constructed semantic-level contrastive learning and instance-level contrastive learning. Introduce a multi-task classifier to predict the functional category label of the antimicrobial peptide based on the graph representation. Use cross-entropy loss and contrastive loss to jointly optimize the overall objective function to obtain an invariant graph representation. S104: Based on the node attention weights and edge importance scores in the invariant graph representation obtained during training, the regions that play a decisive role in predicting antibacterial function are located and labeled, and a causal subgraph with causal basis is constructed. Combining the key functional motifs of known antibacterial peptide structures, the extracted causal subgraph nodes are mapped back to the original amino acid sequences. A sliding window alignment is used to visualize the key functional motifs.
2. The method for interpretable prediction of antimicrobial peptide function based on graph causal learning according to claim 1, characterized in that, In step S101: Two non-shared multilayer perceptrons were used to perform dimensional alignment and nonlinear fusion of protein sequences and residue properties to obtain node features; Extract the multi-head attention weight tensors of each multi-layer language model from the protein pre-trained language model, perform cross-layer and cross-head weighted summation, and obtain the overall attention between residue pairs; By setting a structural connection threshold and binarizing the contact probability matrix, we obtain the graph edges used to construct the protein graph structure. Construct a two-dimensional protein graph structure G=(V,E) using protein residues as nodes and a binary contact graph as edges, where... It is a set of nodes, corresponding to each residue in the protein. This represents the number of residues in an amino acid sequence, with each residue forming a node, and the nodes together constitute a set V. Let be the set of edges, corresponding to pairs of residues that are spatially close to each other. Represents a node With nodes The relationship between them Represents a node With nodes There is an edge between them; Edge features are embedded using Gaussian radial basis function (RBF) to embed continuous contact strength values, resulting in a K-dimensional edge feature embedding, expressed as: ; In the formula, To fix the mean center, Indicates the kernel width; Edge features representing residue pairs; represents the sum of multi-head attention across all layers, exp represents the natural exponential function, and K represents the dimension of the edge feature embedding; For each residue, the semantic vector and physicochemical features of the protein pre-trained language model are fused together, and the weights of the edges are combined to construct a weighted graph structure, represented as: G=(V,E,X,Φ), where V represents the set of nodes, E represents the set of edges, X represents the node features, and Φ represents the edge features.
3. The method for interpretable prediction of antimicrobial peptide function based on graph causal learning according to claim 2, characterized in that, In step S102, a multi-layer stacked graph neural network structure is adopted, and each layer of the network structure includes a neighbor aggregation module, a message passing module, and a node update module. In the node update module, the original feature vector of node v in layer l is represented as: The update rule is expressed as: ; In the formula, Sigmoid represents the activation function, and AGGREGATE represents the aggregation function. and These are learnable parameters; This represents the set of neighboring nodes of node v. Let represent the original feature vector of node u in the (l-1)th layer, where u represents a neighboring node that has an edge with node v; Utilize node attention channels to evaluate the importance of individual residue nodes to the current functional task; The saliency of structural propagation between two adjacent residues was evaluated using the side attention channel. Based on node attention weights and edge attention weights, the node features and edge features are updated with weights respectively, resulting in a compressed graph representation, as follows: ; In the formula, h G A graphical representation focusing on the structural-functional coupling region. This represents the attention saliency score of node v. The importance score represents the edge; V represents the set of nodes, v represents a node in the set of nodes V, and u represents a neighboring node that has an edge with node v. Representing edge features, The graph representation of node v.
4. The method for interpretable prediction of antimicrobial peptide function based on graph causal learning according to claim 3, characterized in that, In step S103, the diagram is represented as h. G Mapping to a contrastive learning space, a unified embedding representation of antimicrobial peptide map samples is constructed. ; The mapping function employs a two-level nonlinear transformation, expressed as: ; In the formula, Represents a semantic feature transformer; , Let b1 and b2 represent the linear transformation matrix, b1 and b2 represent the bias terms, and ReLU represent the activation function. This represents the activation function Sigmoid; A graphical representation focusing on the structural-functional coupling region.
5. The method for interpretable prediction of antimicrobial peptide function based on graph causal learning according to claim 4, characterized in that, In step S103: The constructed semantic-level contrastive learning objectives include: for each functional category C represents the total number of functional categories, and a semantic center vector is defined. , Represents a d-dimensional real space; initializes or updates it by aggregating sample embedding vectors; for any graph sample Graph-level representation through embedding functions Mapped to contrast space, where, The embedding representation of the i-th sample is defined, and a semantic center vector is defined based on each antibacterial function. The constructed semantic contrast loss is represented as follows: ; In the formula, This represents the temperature coefficient; T is the transpose operator. This represents the true functional category of the i-th graph sample; Let C represent the semantic center vector corresponding to the true functional category of the i-th graph sample, and let C represent the total number of functional categories. It is the semantic center vector of the c-th functional category; The constructed instance-level contrastive learning objective includes: for each graph sample The contrast loss is calculated together with the positive and negative examples to construct a positive-negative pair for each sample. , Constructed instance contrast loss Represented as: ; In the formula, Here, J is another temperature coefficient, and J is the number of negative samples. This represents the positive embedding of the i-th graph sample; This represents the negative embedding of the j-th graph sample; j represents the index of the negative sample; T is the transpose operator. This represents the embedding representation of the i-th antimicrobial peptide map sample in the contrastive learning space after mapping.
6. The method for interpretable prediction of antimicrobial peptide function based on graph causal learning according to claim 5, characterized in that, In step S103, the structural diagram is represented. The input is fed into a classifier, and the sigmoid activation is used to obtain the predicted probability of the function label. C represents the total number of functional categories; the prediction loss is the cross-entropy loss. , represented as: ; In the formula, C represents the total number of functional categories; Indicates the true label, Indicates the predicted probability; Construct a general objective function that includes multi-label cross-entropy, instance contrastive loss, and semantic contrastive loss, expressed as: ; in, Describe the overall objective function. Represents cross-entropy loss, This represents semantic contrast loss. Indicates instance comparison loss. , Both represent weights, and .
7. The method for interpretable prediction of antimicrobial peptide function based on graph causal learning according to claim 6, characterized in that, In step S104, the attention saliency score of node v is extracted from the output layer of the graph neural network (GNN). Importance score of edges ,in, This is used to quantify the contribution of nodes to functional prediction; , used to characterize the functional correlation of interactions between residues; Attention saliency score for node v Normalization was performed, and the attention saliency score after normalization was obtained. Represented as: ; Introducing a threshold adaptation mechanism, the dynamic threshold is represented as: Filter out those that meet the requirements The residue nodes are used to form a key residue subset, and the key residue subset is used as a node set. Preserve the edges between nodes within the subset and construct a causal subgraph. ,in, v represents a node in the node set, u represents a neighboring node that has an edge with node v, and E represents the edge set.
8. The method for interpretable prediction of antimicrobial peptide function based on graph causal learning according to claim 7, characterized in that, In step S104, a rule base containing key functional motifs is constructed, including two-amino acid motifs, three-amino acid motifs, cation-rich regions, and aromatic motifs; the key residue nodes of the causality graph are mapped back to the original amino acid sequences to obtain the corresponding sequence fragments. n is the number of key residues; The sliding window algorithm is used to scan the fragment, with a window length of 2-5. The matching motif is detected using the following formula: ; Where k=2 and k=3 correspond to the diamino acid motif and the triamino acid motif, respectively; Indicates the test results. This represents a subsequence of length k starting from position i in sequence segment S; the motif library is a rule base for key functional motifs; The cation enrichment region is determined by an indicator function, as shown in the following formula: ; in, Indicates an indicator function; Used to determine whether the i-th residue is lysine K or arginine R, where b represents the starting position of the window; Calculate confidence scores for matching motifs The formula is as follows: ; The results are sorted by confidence level, and the highly relevant results are retained and then visualized.
9. The method for interpretable prediction of antimicrobial peptide function based on graph causal learning according to claim 8, characterized in that, Binary and multi-class classification metrics are introduced for performance evaluation and validation. The binary classification metrics include precision, recall, and F1 score. In the multi-class classification metrics, a class adaptive threshold mechanism is introduced, and multiple metrics are combined for quantitative evaluation. In the category adaptive threshold mechanism, for each functional label, different probability thresholds are enumerated, and the optimal threshold that maximizes the F1 score or AUPR of the current category is selected. The optimal threshold is then used as the decision boundary of the current category. In the quantitative evaluation using multiple metrics, these metrics include macro average precision, macro average recall, and macro average F1 score.
10. A prediction system for implementing the graph causal learning-based method for predicting the functionally interpretable antimicrobial peptides as described in any one of claims 1 to 9, characterized in that, Includes the following modules: The graph structure module is used to introduce a pre-trained protein language model, extract the contextual semantic vector of each residue, and construct a residue contact probability matrix by combining attention weights. After thresholding, a binary contact graph is formed. The protein graph structure is constructed with protein residues as nodes and the binary contact graph as edges. The graph representation module is used to encode the residue nodes of the graph structure using a graph neural network (GNN), and based on an attention-guided feature selection mechanism, assigns task-related weights to each node and node edge relationships, dynamically compresses and weakens redundant regions, and obtains structural subgraph regions related to antibacterial function to form a graph representation. The contrast optimization module maps the graph representation to the semantic contrast space to form an embedded representation for contrast optimization. Semantic-level contrast learning objectives and instance-level contrast learning objectives are constructed respectively. A multi-task classifier is introduced to predict the functional category label of the antimicrobial peptide based on the graph representation. The overall objective function is jointly optimized using cross-entropy loss and contrast loss to obtain an invariant graph representation. The causal subgraph module is used to locate and label regions that play a decisive role in predicting antibacterial function based on the node attention weights and edge importance scores in the invariant graph representation obtained during training. It constructs a causal subgraph with causal basis, combines the key functional motifs of known antibacterial peptide structures, maps the extracted causal subgraph nodes back to the original amino acid sequences, and uses a sliding window alignment to visualize the key functional motifs.
Citation Information
Patent Citations
Novel method for efficiently cloning antibacterial peptide encoding gene
CN102154260A
Inplanatable node classification prediction method based on adversarial causal graph learning
CN120524163A