Protein function prediction method combining PO2GO and attention mechanism
By combining PO2GO with attention mechanisms, using the ESM2 model and multilayer perceptron to extract protein sequence features, and combining PO2Vec to generate gene ontology embedding representations, we have achieved efficient functional prediction of distant homologous proteins, solved the problem of insufficient accuracy in existing technologies, and improved multi-task prediction performance.
Patent Information
- Application Number
- CN202511174027.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-21
- Publication Date
- 2025-12-05
AI Technical Summary
Existing protein function prediction methods are not accurate enough for predicting distant homologous proteins, making it difficult to simultaneously address functional prediction tasks at different levels of the gene ontology, and they lack the ability to identify and interpret key functional residues.
This paper proposes a protein function prediction method that combines PO2GO and attention mechanisms. It encodes protein sequences using an ESM2 model, extracts sequence features using a multilayer perceptron and self-attention mechanism, generates gene ontology term embeddings using PO2Vec, fuses features through a cross-attention mechanism, and finally performs predictions through a multi-task learning framework.
It significantly improves the accuracy of protein function prediction, especially the prediction performance of distant homologous proteins, and can simultaneously and accurately predict the functional annotation of molecular functions, biological processes and cellular components, thereby enhancing the robustness and interpretability of the model.
Smart Images

Figure CN121075480A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of protein function prediction, and particularly relates to a protein function prediction method combining PO2GO and attention mechanism. BACKGROUND
[0002] Protein function prediction is an important research direction in the fields of bioinformatics and computational biology, and has important significance for understanding the mechanism of life activities, drug target discovery, synthetic biology and other applications. With the rapid development of high-throughput sequencing technology, the growth rate of protein sequence data far exceeds the speed of experimental verification of function annotation, resulting in a large number of unknown protein functions. Therefore, it is an urgent need to develop efficient and accurate protein function prediction methods.
[0003] In recent years, deep learning technology has brought new breakthroughs to protein function prediction, especially pre-trained protein language models (such as ProtBERT, ESM) can learn general feature representations from massive sequence data. These methods have significantly improved the performance of function prediction, but there are still problems such as insufficient recognition of local functional sites in proteins and insufficient modeling of long-range dependencies. In addition, existing models often have difficulty in simultaneously considering the function prediction tasks of different levels (molecular function, biological process, cellular component) of gene ontology (GO).
[0004] In order to further improve the prediction performance, researchers have begun to explore methods combining multiple neural network architectures, such as hybrid models of convolutional neural networks (CNN) and recurrent neural networks (RNN). However, these methods still have limitations in modeling the complex relationships in protein sequences, especially in identifying and explaining key functional residues. Therefore, how to more comprehensively capture protein sequence features while improving the explainability of protein function prediction remains an important challenge in current research. SUMMARY
[0005] To solve the problem of insufficient prediction accuracy of distantly related homologous proteins in existing protein function prediction methods, the application provides a protein function prediction method combining PO2GO and attention mechanism to solve the problems existing in the prior art.
[0006] To achieve the above purpose, the application provides a protein function prediction method combining PO2GO and attention mechanism, comprising:
[0007] Obtaining a protein sequence, encoding the protein sequence, and performing mean pooling processing on the encoding result to obtain sequence features of the protein;
[0008] Transforming the sequence features of the protein through a machine learning model to obtain optimized features;
[0009] transform the optimized features through a self-attention mechanism to obtain protein features;
[0010] obtain an embedding representation of the gene ontology term, process the embedding representation of the gene ontology through a machine learning model to obtain gene ontology term features, fuse the protein features and the gene ontology term features to obtain weighted features, splice the protein features and the weighted features, and predict the spliced results through a machine learning method to obtain protein function prediction results.
[0011] Optionally, the protein sequence is encoded through an ESM2 model.
[0012] Optionally, the process of transforming the sequence features of the protein includes:
[0013] process the sequence features of the protein through a multi-layer perceptron to obtain optimized features, wherein a fully connected layer is arranged in the multi-layer perceptron to linearly transform the sequence features of the protein, and a hidden layer in the multi-layer perceptron is arranged with a nonlinear activation function.
[0014] Optionally, the process of transforming the optimized features includes:
[0015] project the optimized features to a query, key and value space through a self-attention mechanism, calculate dot product attention scores according to the features of the projected query and key space, and obtain attention weights through softmax normalization, weight aggregate the features of the projected value space through the attention weights to obtain protein features, wherein the self-attention mechanism includes 8 attention heads.
[0016] Optionally, the gene ontology term is encoded through a PO2Vec model to obtain an embedding representation of the gene ontology term.
[0017] Optionally, the process of processing the embedding representation of the gene ontology includes:
[0018] calculate the embedding representation of the gene ontology through a multi-layer perceptron to obtain gene ontology term features.
[0019] Optionally, the protein features and the gene ontology term features are fused through a cross-attention mechanism, wherein a correlation score of the protein features and each gene ontology term feature is calculated, cross-attention weights are obtained through softmax normalization according to the correlation scores, the gene ontology term features are screened and reweighted through the cross-attention weights, and the reweighted features are subjected to layer normalization, GeLU activation and learnable parameter scaling to obtain weighted features.
[0020] Optionally, the process of predicting the spliced result by a machine learning method comprises:
[0021] The spliced result is fused by a two-layer multi-layer perceptron, and a one-layer multi-layer perceptron is used to obtain the prediction probability of molecular function, biological process and cell component according to the fused high-order features, and the prediction result of different protein functions is generated according to the prediction probability.
[0022] Optionally, the process of generating the prediction result of different protein functions according to the prediction probability comprises:
[0023] According to the prediction probability, the prediction scores of all terms are calculated independently for each gene ontology category, and terms exceeding a threshold are retained, for the retained terms, terms in conflict with ancestor terms are removed, the hierarchical relationship between terms is verified, and field-specific score correction is applied, to obtain the prediction result of protein functions.
[0024] In another aspect, the present application provides a protein function prediction system combining PO2GO and attention mechanism, which is used to execute the above-mentioned method.
[0025] Compared with the prior art, the present application has the following advantages and technical effects:
[0026] 1. The method of the present application significantly improves the accuracy of protein function prediction, and the prediction performance of distantly related homologous proteins is improved obviously.
[0027] 2. The method of the present application can accurately predict the function annotations of three gene ontology (GO) levels, molecular function (MF), biological process (BP) and cell component (CC), simultaneously through a multi-task learning framework, and the prediction performance of each level is balanced, solving the problem of low prediction performance of the existing method in the CC level.
[0028] 3. The pre-training strategy and contrast learning method used in the method of the present application enable the model to adapt to different species and different functional categories of prediction tasks, and show stronger robustness in the function prediction of new protein families. BRIEF DESCRIPTION OF DRAWINGS
[0029] The accompanying drawings, which form a part of this application, are included to provide a further understanding of the application and are incorporated in and constitute a part of this application. The embodiments of this application and their description are used to explain the application and are not intended to limit the application. In the drawings:
[0030] Figure 1 The flow chart of the protein function prediction method combining PO2GO and attention mechanism of the embodiments of the present application;
[0031] Figure 2A protein function prediction method system model combining PO2GO and attention mechanism for an embodiment of the present application. DETAILED DESCRIPTION
[0032] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments.
[0033] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown.
[0034] The present application discloses a protein function prediction method combining PO2GO and attention mechanism. In order to overcome the limitations of existing methods and solve the multi-label classification problem of protein function prediction, in-depth research is conducted and an end-to-end protein function prediction model is proposed. This is a new protein function prediction method that combines gene ontology (GO) term topology and cross-modal attention mechanism. First, the pre-trained model is used to extract protein-level sequence features, which can effectively capture the semantic information related to function in a single protein sequence. Second, the PO2Vec algorithm is used to generate GO term topology embedding with partial order relationship, explicitly modeling the shortest path dependence between terms, and better capturing the biological information of GO terms. Finally, through the multi-head self-attention mechanism, the correlation weight between protein features and GO term embedding is dynamically calculated, the context-aware function annotation is realized, and the prediction accuracy is significantly improved. Comparative experiments on the CAFA3 dataset show that the improvement in prediction performance is due to the combination of high-quality PO2Vec-based feature extraction and attention joint prediction module, which proves the effectiveness of the method.
[0035] The present application is to solve the problem of insufficient prediction accuracy of existing protein function prediction methods for distantly related homologous proteins. A protein function prediction method combining PO2GO and attention mechanism is proposed, which specifically includes the following steps:
[0036] Step one, use the ESM2 model to encode the protein sequence to generate sequence features. Specifically, given a protein P with L amino acids, obtain its protein sequence, use ESM2 to obtain the embedding of each amino acid in the protein sequence, and form an amino acid embedding feature matrix M ∈ R d×L , where d is the dimension of the amino acid embedding. In order to aggregate the global embedding representation of the protein from the amino acid level embedding, the encoded sequence is subjected to mean pooling processing to aggregate the features of the amino acids and obtain the sequence features of the protein P.
[0037] Step two, input the sequence features of the pooled protein into a multi-layer perceptron (MLP). The input sequence feature vector is linearly transformed by the fully connected layer inside the MLP, which helps the model learn the complex relationship between the input features and the output. And the nonlinear activation function is introduced in the hidden layer of the MLP, so that the model can learn and represent the nonlinear features of the input data, enhancing the model's expression ability and generalization ability. Thus a new set of feature representations is generated. In this model, the MLP is used to map the ESM2 output and the sequence embedding matrix averaged by pooling to a low-dimensional query vector to generate optimized features, providing a feature basis for the subsequent multi-head attention mechanism. Batch normalization (BatchNorm1d) is also inserted between layers to adapt to different data distribution characteristics, and dropout is used to prevent overfitting.
[0038] Step three, calculate the self-attention score using the Softmax function. Use the self-attention mechanism to weight the optimized features, highlighting important features and suppressing unimportant features. Convert the MLP layer's output on the optimized features into a probability distribution to generate weighted probabilities, which are used as weights in the weighted sum step. The sequence features of the protein are weighted and summed to generate the final protein features, and based on these protein features, the subsequent protein and GO term fusion weights are generated to integrate protein sequence features and GO term features.
[0039] Step four, obtain the embedding representation of each term by PO2Vec. By defining the partial order relationship within and outside the path in the GO directed acyclic graph (DAG), the hierarchical association between GO terms is more comprehensively described. At the same time, these partial order relationships are used to generate positive and negative sample pairs, and the embedding vectors of GO terms (as nodes in the GO DAG) are optimized through a contrastive learning strategy. However, traditional random negative sampling in modeling results in a much larger number of out-of-path terms than in-path terms, causing the model to learn simple irrelevant terms and ignore important but difficult term associations. Therefore, in the PO2Vec model, an improved negative sampling method is used to increase the proportion of in-path terms, forcing the model to learn to distinguish between semantically similar terms, thus more accurately learning the hierarchical partial order relationship. This method consists of three stages: index construction, hierarchical sampling, and contrastive learning. This process ultimately ensures that the embedding vector of each term can reflect the overall structural information of GO in detail.
[0040] Step five, input the embedding representation of GO terms into a multilayer perceptron (MLP) to obtain GO term features, obtain the GO term weight corresponding to the protein feature based on the protein feature, cross-fuse the GO term feature and the protein feature based on the weight, and make subsequent prediction according to the fusion result. The protein sequence feature and the GO term feature are embedded, and two completely independent MLPs are used to project the two into the same semantic space to eliminate the distribution difference. Then, the dot product of the projection vectors of the protein and all terms is calculated as the basic similarity, and then a third MLP is used to perform nonlinear transformation on the similarity vector to output the final prediction probability, and then the final prediction result is obtained.
[0041] Specifically, the mean pooling operation in step one generates a fixed-dimension protein feature overall representation by globally averaging the amino acid level embedding features. This pooling method can retain the global statistical features of the sequence while reducing the feature dimension and improving the computational efficiency.
[0042] The embedding function of the protein sequence in step one is represented as follows:
[0043] The protein sequence embedding function is represented as f(p) = mean(M) ∈ R d×L , wherein mean(·) represents the average pooling of the embedding matrix of the amino acid in the amino acid dimension.
[0044] Specifically, the multilayer perceptron (MLP) in step two is composed of multiple fully connected layers, which performs high-order abstraction on the protein feature through the combination of linear transformation and nonlinear activation function. The introduction of activation functions such as ReLU enables the model to learn complex nonlinear mapping relationships and enhance the feature expression ability.
[0045] The application of MLP in step two obtains the projected protein embedding f proj (p i ) is represented as follows:
[0046] The application of MLP in step two obtains the projected protein embedding f proj (p i ) is represented as f proj (p i ) = MLP(f(p i )), wherein p i represents the i-th protein sequence feature, and f represents the mean pooling.
[0047] Specifically, the self-attention mechanism in step three includes multiple attention heads, each of which independently weights different parts of the sequence.
[0048] Specifically, step four proposes a GO term embedding method based on PO2Vec. By analyzing the in-path and out-of-path relationships in the GO term directed acyclic graph, positive and negative sample pairs are constructed, and a contrastive learning strategy is used to optimize the term embedding. This method can effectively capture the hierarchical relationships and semantic associations between GO terms, providing structured prior knowledge for function prediction.
[0049] Step four obtains its projection embedding e proj (t i ) through the GO term encoder and MLP.
[0050] Step four obtains its projection embedding e proj (t i ) through the GO term encoder and MLP. proj (t j ) = MLP(e(t j )), t represents the GO term, e() represents the encoding process, which is completed by PO2Vec.
[0051] Specifically, step five again uses MLP to process GO term features and realizes feature reweighting through cross-attention mechanism. This mechanism can automatically identify functional term features important to the current prediction task, improving the discriminability of the model. Further, the processed protein sequence features and GO term features are integrated and processed through the MLP network. This network learns the deep interaction patterns of the two types of features and establishes the mapping relationship from sequence to function. Finally, the function prediction results of the protein at the three levels of Gene Ontology are output, including molecular function, biological process, and cellular component.
[0052] In step five, the similarity vector s ∈ R m×1 is used to measure the similarity between protein p i and all GO terms, where m is the number of GO terms. The jth element of the similarity vector s is calculated as follows:
[0053] The calculation formula of the jth element of s is s j = e proj (t j ) T · f proj (p i )).
[0054] In step five, another MLP layer is introduced to obtain the final result of protein function prediction instead of directly using this similarity vector as the final prediction result.
[0055] In step five, the loss function is calculated by multi-label binary cross-entropy loss.
[0056] The loss function is calculated as follows: loss function where y j ∈R m×1 ∈{0,1} represents whether the GO term t j is annotated to the protein, represents the predicted probability of the model for the GO term t j .
[0057] In the above technical solution, a protein function prediction method combining PO2GO and attention mechanism includes the following aspects:
[0058] (1) Feature encoding module: ESM2 protein language model is used to encode the input sequence. This model can effectively capture the evolutionary relationship and structural features between amino acids by pre-training on large-scale protein sequence data. The encoding process converts the protein sequence into a dense vector representation, where each amino acid corresponds to a 768-dimensional embedding vector, forming a Lx768 feature matrix.
[0059] (2) Feature aggregation module: The amino acid level features are aggregated by mean pooling operation to generate protein level global representation. This module can smooth the local fluctuations in the sequence, retain the overall feature pattern of the protein, and reduce the computational complexity. The dimension of the pooled features is 1x768, which is convenient for subsequent processing.
[0060] (3) Feature enhancement module: contains multi-layer perceptron (MLP) and nonlinear activation function, which performs nonlinear transformation on the pooled features. MLP consists of two fully connected layers, uses ReLU activation function in the middle, and adopts Layer Normalization at the end for normalization.
[0061] (4) Attention calculation module: uses multi-head self-attention mechanism to map input features to multiple subspaces and calculate attention in parallel. Each attention head learns different feature interaction patterns independently, and finally the outputs of each head are concatenated and fused. This module can focus on different regions of the sequence at the same time and capture long-range dependencies.
[0062] (5) GO term processing module: generates embedding representation of GO terms based on PO2Vec method. By analyzing the topological structure of GO directed acyclic graph, the partial order relationship between terms is defined, and the embedding space is optimized using contrastive learning.
[0063] (6) Feature fusion module: cross-attention calculation is performed on protein features and GO term features to establish the association between sequence and function. This module uses dot product attention mechanism to calculate the relevance score of protein features and each GO term, generating a weighted function representation.
[0064] (7)Predicted output module: a multi-task learning framework is adopted to predict the functions of molecular function, biological process and cellular component simultaneously. Each task uses an independent classifier, but shares the underlying feature representation. The output layer uses a sigmoid activation function, supports multi-label prediction, and can handle the case where one protein corresponds to multiple function terms.
[0065] The above technical solutions will be described in detail by way of examples in combination with the related drawings:
[0066] As shown in Figure 1 , the embodiment of the present application provides a protein function prediction method combining PO2GO and attention mechanism, which comprises the following steps:
[0067] Step one, encode the protein sequence using the ESM2 model to generate sequence features. Specifically, given a protein P with L amino acids, obtain its protein sequence, use ESM2 to obtain the embedding of each amino acid in the protein sequence, and form an amino acid embedding feature matrix M ∈ R d×L , where d is the dimension of the amino acid embedding. In order to aggregate the global embedding representation of the protein from the amino acid level embedding, the encoded sequence is subjected to mean pooling processing to aggregate the features of the amino acids and obtain the sequence features of the protein P.
[0068] Step two, input the pooled sequence features of the protein into a multi-layer perceptron (MLP). The input sequence feature vector is linearly transformed by the fully connected layers inside the MLP, which helps the model learn the complex relationship between the input features and the output. And introduce a nonlinear activation function in the hidden layer of the MLP, and then the model can learn and represent the nonlinear features of the input data, enhancing the expression ability and generalization ability of the model. Thus a new set of feature representations is generated. In this model, MLP is used to map the sequence embedding matrix output by ESM2 and averaged by pooling to a low-dimensional query vector to generate optimized features to provide a feature basis for the subsequent multi-head attention mechanism. Batch normalization (BatchNorm1d) is also inserted between layers to adapt to different data distribution characteristics, and dropout is used to prevent overfitting.
[0069] Step three, calculate the self-attention score using the Softmax function. Use the self-attention mechanism to weight the optimized features, highlight important features, and suppress unimportant features. Convert the output of the MLP layer about the optimized features into a probability distribution to generate weighted probabilities, which are used as weights in the weighted summation step. The sequence features of the protein are weighted and summed to generate the final protein features, and based on the protein features, the weight of the subsequent protein and GO term fusion is generated to integrate the protein sequence features and GO term features.
[0070] Step four, the GO term obtains the embedding representation of each term by PO2Vec. By defining the partial order relation within and outside the path in the GO directed acyclic graph (DAG), the hierarchical association between GO terms is described more comprehensively. At the same time, these partial order relations are used to generate positive and negative sample pairs, and the embedding vectors of GO terms (as nodes in the GO DAG) are optimized through a contrast learning strategy. However, traditional random negative sampling in modeling results in a much larger number of path-outside terms than path-inside terms, causing the model to learn simple irrelevant terms and ignore important but difficult term associations. Therefore, in the PO2Vec model, an improved negative sampling method is used to increase the proportion of path-inside terms and force the model to learn to distinguish between semantically similar terms, thereby more accurately learning the hierarchical partial order relationship. The method is divided into three stages: index construction, hierarchical sampling and contrast learning. This process ultimately ensures that the embedding vector of each term can reflect the overall structural information of GO in detail.
[0071] Step five, input the embedding representation of the GO term into a multilayer perceptron (MLP) to obtain the GO term feature, obtain the GO term weight corresponding to the protein feature based on the protein feature, and cross-fuse the GO term feature and the protein feature based on the weight, and perform subsequent prediction according to the fusion result. The protein sequence feature and the GO term feature are embedded, and two completely independent MLPs are used to project the two into the same semantic space to eliminate the distribution difference. Then, the dot product of the projection vectors of the protein and all terms is calculated as the basic similarity, and then a third MLP is used to perform nonlinear transformation on the similarity vector to output the final prediction probability, and then the final prediction result is obtained.
[0072] Further, the step one includes the following specific steps:
[0073] The system structure model constructed by the application is as shown in Figure 2 First, input the protein amino acid sequence P={a1, a2, a3,..., a L}, where L is the sequence length. Then the sequence is preprocessed by replacing non-standard amino acids with the closest standard amino acid and unifying the sequence format to FASTA format. Subsequently, the parameters of the ESM2 model are configured as a 768-dimensional hidden layer, 20 attention heads, and a 36-layer Transformer structure, and a partial fine-tuning strategy (fine-tuning only the top 3 layers) is adopted. In the fine-tuning strategy, the three Transformer encoders closest to the output are fine-tuned, and the remaining 33 layers of parameters are frozen to maintain the pre-training weights. The preprocessed sequence is input into the ESM2 model, and a 768-dimensional vector representation of each amino acid is obtained through the embedding layer. After processing by the 36-layer Transformer encoder, a Lx768-dimensional feature matrix is output. Finally, layer normalization, GeLU activation, and position encoding enhancement are performed on the feature matrix to improve the discriminability and stability of the features. The embedding layer is a mechanism that maps discrete input data to a continuous vector space. The embedding layer receives the preprocessed protein amino acid sequence as input.
[0074] Protein feature aggregation. Based on the above step one, the encoded amino acid embedding feature matrix is first standardized by calculating the mean and variance of each feature dimension and performing a standardization conversion. Then, mean pooling is performed along the sequence dimension to convert the variable-length sequence into a 768-dimensional global protein representation (sequence feature of the protein).
[0075] Further, the step two includes the following specific steps:
[0076] Protein feature enhancement. The encoded sequence (amino acid embedding feature matrix) is subjected to mean pooling along the sequence dimension to obtain the global protein representation (sequence feature of the protein) described above. Then, the feature dimension is adjusted to 512 dimensions through the fully connected layer in the multi-layer perception, and batch normalization and PReLU activation function are applied to enhance the feature expression ability.
[0077] Feature nonlinear transformation. The 512-dimensional protein feature is mapped to a 256-dimensional space through a fully connected layer, and a Swish activation function is used for nonlinear transformation. This function dynamically adjusts the activation strength through a learnable parameter β. To alleviate the problem of gradient vanishing in deep networks, a residual connection structure is introduced to add the transformed feature to the original feature. Subsequently, layer normalization is applied to standardize the feature distribution, and finally a second fully connected layer is used to output a 128-dimensional optimized feature representation, providing a suitable feature dimension for subsequent attention calculation.
[0078] Further, step three includes the following specific steps:
[0079] Self-attention mechanism calculation. The 128-dimensional feature is projected into query, key, and value spaces, each with a dimension of 64. When calculating the scaled dot-product attention score, the square root of the dimension of the key space is divided by the square root of the dimension of the key space. (d=64) stable gradient propagation, and then normalized by softmax to get attention weights (self-attention scores). These weights are used to aggregate the value vectors, resulting in 64-dimensional context-aware features. To capture multi-faceted feature relationships, 8 such attention head calculations are performed in parallel, and the results are spliced and fused through a 512x512 projection matrix. Finally, a residual connection and layer normalization are added to maintain the stability of information flow. Through the above structure processing, the self-attention scores obtained by the self-attention mechanism highlight the optimized features of the above proteins, and finally obtain the protein features.
[0080] Further, steps four and five include the following specific steps:
[0081] Feature cross-attention calculation. The 128-dimensional embedding of GO terms is projected to a 64-dimensional space through an MLP, and cross-attention calculation is performed with the protein features. First, the relevance scores of the protein features and each GO term are calculated, and the attention weights (cross-attention scores) are obtained by softmax normalization. These cross-attention scores are used to filter and reweight the GO term features, highlighting the functional features related to the current protein. Finally, the weighted features are layer normalized, GeLU activated, and scaled by learnable parameters, outputting a 64-dimensional optimized functional representation.
[0082] Multi-task prediction processing. The 512-dimensional protein features and 64-dimensional GO features are spliced to form a 576-dimensional joint representation, and high-order feature fusion is performed through two layers of MLP. The first layer uses a 256-dimensional hidden layer and ReLU activation, and the second layer is compressed to 128 dimensions. A prediction head is established for each of the three branches of GO (MF / BP / CC), and each prediction head uses a sigmoid function to output the prediction probability of the term, supporting multi-label classification tasks. This multi-task learning framework shares the bottom-level feature representation, while optimizing the prediction performance of the three functional dimensions.
[0083] Further, step five includes the following specific steps:
[0084] Prediction result generation and post-processing. For each GO category, the prediction scores of all terms are calculated independently, sorted in descending order of scores and terms above the 0.5 threshold are retained. To ensure the logical consistency of the prediction results, strict post-processing is implemented: removing predictions conflicting with ancestor terms, verifying the hierarchical relationships among terms, applying field-specific score correction. The final output contains the prediction results of the MF, BP and CC subsets, each term accompanied by a calibrated confidence score, providing a reliable basis for subsequent biological analysis. Answer: For each GO category (such as molecular function (MF), biological process (BP) and cellular component (CC)), the prediction scores of all terms are calculated independently. This is usually done through some machine learning model or deep learning model, which outputs the prediction score of each term.
[0085] For the above-mentioned related post-processing content, the specific process is as follows: In the prediction results, if a sub-term is predicted to be true, but its ancestor term is not predicted to be true, there is a logical conflict. In order to solve this conflict, it is necessary to remove the predictions of those sub-terms that are inconsistent with the predictions of their ancestor terms. First, a data structure containing the hierarchical structure of GO terms is constructed. Second, check for conflicts. For each term predicted to be true, check if all its ancestor terms are also predicted to be true. If an ancestor term is not predicted to be true, it is considered to be in conflict. Finally, once a conflict is found, remove the prediction result of the sub-term. This ensures that the prediction results are logically self-consistent and avoid contradictions. Verifying the hierarchical relationships among terms is to further verify whether the retained terms conform to the hierarchical structure of GO. This step includes checking whether the relationship between a sub-term and its ancestor term is reasonable. For each term predicted to be true, check if all its sub-terms are also predicted to be true. If a sub-term is not predicted to be true, but its parent term is predicted to be true, it may indicate that the hierarchical relationship is unreasonable. Based on the verification results of the hierarchical relationship, the prediction result of the term can be re-evaluated or the prediction of the term can be removed. The application of field-specific score correction is to determine the weight of each GO term according to the specific research field. These weights are determined based on the frequency, importance or relevance to other biological information of the term in a specific field. Multiply the prediction score of each term by its corresponding field-specific weight. This adjusts the score of the term to make it more consistent with the actual biological needs. According to the corrected score, the terms are re-ranked and selected. This step ensures that the final output of the prediction results not only has a high confidence score, but also meets the actual needs of the specific field.
[0086] Example 1
[0087] According to the embodiments of the above method, examples are completed for protein sequence data in the CAFA3 dataset. Table 1 compares the performance of six protein function prediction methods (Naive, DiamondBlast, DiamondScore, DeepGOPlus, PO2GO and the method POSA-GO) on the CAFA3 benchmark test. Through the quantitative results of the three core indicators (Fmax, Smin, AUPR) in the three functional dimensions of Gene Ontology (molecular function MF, biological process BP, and cellular component CC), the differences in prediction accuracy (Fmax), semantic consistency (Smin), and classification reliability (AUPR) of different methods are shown. Table 1 is the performance indicator of the method in Example 1.
[0088] Table 1
[0089]
[0090] As can be seen from the above table, the method in the present application exhibits excellent performance. In the Fmax indicator, the molecular function (MF), biological process (BP), and cellular component (CC) reach 0.589, 0.481, and 0.650, respectively, among which the CC-Fmax value is particularly outstanding; in the AUPR indicator which measures prediction accuracy, the method also performs best (MF 0.611, BP 0.442, CC 0.683), especially in molecular function prediction, significantly better than other methods; although the Smin indicator shows that there is still room for optimization in semantic distance, the overall performance has obviously surpassed traditional sequence alignment methods and existing deep learning methods (such as PO2GO), which is mainly due to the deep integration of the innovative multi-head attention mechanism and the PO2GO framework, effectively improving the model's ability to capture multi-level features of protein sequences and the relevance modeling of functional terms.
[0091] Example 2
[0092] Table 2 shows the size distribution of the training set and test set in the CAFA3 evaluation. The larger training set size (BP 50,813, MF 35,086, CC 49,328) provides sufficient learning samples for the model, while the test set size (BP 2,133, MF 1,088, CC 1,094) ensures the statistical significance of the evaluation results. In particular, the difference in the number of annotations (BP 19,901, MF 6,367, CC 2,470) directly reflects the prediction difficulty of different functional categories, and the Figure 1 The results of the method in the present application are consistent with the results of the method in the present application. Table 2 is the performance indicator of the method in Example 2.
[0093] Table 2
[0094]
[0095] Through the comparison of evaluation comparison on the protein sequence dataset, it can be found that the method of the present application achieves the best result on all core evaluation indexes, and the comprehensive performance is improved by 1.2-3.2% compared with the suboptimal method PO2GO, and is improved by 15-35% compared with the traditional sequence alignment method. Especially, while maintaining the traditional advantage of CC dimension (Fmax 0.650), the prediction accuracy of MF dimension (AUPR 0.611) is significantly improved, and balanced optimization of the three functional categories of Gene Ontology is realized. This overall leading verifies the breakthrough value of the technical route combining PO2GO and attention mechanism in the field of protein function prediction.
[0096] The above is only the preferred specific embodiment of the present application, but the protection scope of the present application is not limited to this. Any changes or replacements that can be easily thought of by those skilled in the art within the technical scope disclosed in the present application should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A protein function prediction method combining PO2GO and attention mechanism, characterized in that, The method comprises the following steps: obtaining a protein sequence, encoding the protein sequence, mean-pooling the encoding result to obtain a sequence feature of the protein; transforming the sequence feature of the protein through a machine learning model to obtain an optimized feature; converting the optimized feature through a self-attention mechanism to obtain a protein feature; obtaining an embedding representation of a gene ontology term, processing the embedding representation of the gene ontology through a machine learning model to obtain a gene ontology term feature; fusing the protein feature and the gene ontology term feature to obtain a weighted feature, splicing the protein feature and the weighted feature, and predicting the splicing result through a machine learning method to obtain a protein function prediction result.
2. The method of claim 1, wherein the protein sequence is encoded by an ESM2 model.
3. The method of claim 1, wherein the process of transforming the sequence feature of the protein comprises: processing the sequence feature of the protein through a multi-layer perceptron to obtain an optimized feature, wherein the multi-layer perceptron is provided with a fully connected layer to linearly transform the sequence feature of the protein, and the hidden layer of the multi-layer perceptron is provided with a nonlinear activation function.
4. The method of claim 1, wherein the process of converting the optimized feature comprises: projecting the optimized feature to a query, key and value space through a self-attention mechanism, calculating dot product attention scores according to the features of the projected query and key space, and obtaining attention weights through softmax normalization, weighting and aggregating the features of the projected value space through the attention weights to obtain the protein feature; wherein the self-attention mechanism comprises 8 attention heads.
5. The method of claim 1, wherein the gene ontology term is encoded by a PO2Vec model to obtain an embedding representation of the gene ontology term.
6. The method of claim 1, wherein the process of processing the embedding representation of the gene ontology comprises: calculating the embedding representation of the gene ontology through a multi-layer perceptron to obtain a gene ontology term feature.
7. The method of claim 1, wherein the protein feature and the gene ontology term feature are fused through a cross-attention mechanism, wherein the correlation scores of the protein feature and each gene ontology term feature are calculated, the cross-attention weights are obtained through softmax normalization according to the correlation scores, the gene ontology term features are screened and reweighted through the cross-attention weights, and the reweighted features are subjected to layer normalization, GeLU activation and learnable parameter scaling to obtain a weighted feature.
8. The method of claim 1, wherein the process of predicting the splicing result through a machine learning method comprises: high-order feature fusion of the splicing result through two layers of multi-layer perceptron, and prediction probability of molecular function, biological process and cellular component is obtained from the fused high-order features through one layer of multi-layer perceptron, and different protein function prediction results are generated according to the prediction probability. 9. The method of claim 8, wherein, The process of generating protein function prediction results according to the prediction probabilities comprises: According to the prediction probabilities, the prediction scores of all terms are calculated independently for each gene ontology category, and terms exceeding a threshold are reserved, for the reserved terms, terms in conflict with ancestor terms are removed, hierarchical relationships between terms are verified, and field-specific score correction is applied, to obtain protein function prediction results.
10. A protein function prediction system combining PO2GO with attention mechanism, characterized in that, A computer program product for performing the method of any of claims 1-9.