Enzyme EC number prediction method

By combining the BERT model and graph isomorphic neural network, and constructing a reaction map using the SMILES sequences of substrates and products and performing multimodal feature fusion, the problem of poor accuracy in enzyme EC number prediction is solved, and efficient and accurate enzyme EC number prediction is achieved.

CN121583339APending Publication Date: 2026-02-27JIANGNAN UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202610051094.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-15
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Existing methods for predicting enzyme EC numbers do not fully utilize information about the reaction and the enzyme, resulting in poor prediction accuracy.

Method used

By obtaining the SMILES sequences of substrates and products, sequence features are extracted using the BERT model, a reaction map is constructed and atomic mapping and truncation are performed, molecular graph features are extracted using a graph isomorphic neural network, and multimodal feature fusion is performed using a bidirectional cross-attention mechanism, and finally end-to-end prediction of enzyme EC numbers is performed.

Benefits of technology

It significantly improves the prediction accuracy and reliability of enzyme EC numbering, overcomes the problems of high cost and low efficiency in traditional biological experiments, and provides important technical support for enzyme screening and modification and metabolic pathway modeling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121583339A_ABST
    Figure CN121583339A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence application, and discloses an enzyme EC number prediction method, and the method comprises the steps: obtaining the sample sequence characteristics of a to-be-predicted sample containing a substrate SMILES sequence and a product SMILES sequence through a target BERT model; constructing a molecular object and feature coding based on atom mapping, atom truncation and sequence analysis, constructing a reaction graph of a to-be-predicted sample, inputting the reaction graph into a target graph isomorphic neural network, and constructing molecular graph features of the to-be-predicted sample based on a recursive neighborhood aggregation mechanism; and fusing the sample sequence features of the to-be-predicted sample with the molecular map features by using a bidirectional cross attention mechanism to obtain multi-modal features, inputting the multi-modal features into the multi-layer perceptron, and obtaining the prediction probability of the enzyme EC number of the to-be-predicted sample. According to the method, efficient and accurate end-to-end prediction of enzyme EC numbering is realized through the multi-dimensional chemical spatial characteristics of the collaborative modeling reaction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence application technology, and in particular to a method for predicting enzyme EC numbers. Background Technology

[0002] Enzymes, as the core engine of biomanufacturing, are key catalysts supporting metabolic activities and industrial biosynthesis. In the context of the deep integration of synthetic biology and intelligent manufacturing, enzymes have become the cornerstone of building efficient microbial cell factories. Among them, the Enzyme Commission number (EC number), as a core link between enzyme sequences, catalytic functions, and metabolic pathways, plays a crucial role in the design of biosynthetic pathways. By accurately predicting enzyme EC numbers, researchers can rapidly identify corresponding enzymes from massive sequences and adapt key catalytic elements, thereby effectively filling functional gaps in artificial synthetic pathways and achieving precise regulation of metabolic pathways. This not only significantly accelerates the iterative process of microbial cell factory development from digital design to engineered construction but also provides a crucial component foundation for bio-intelligent manufacturing. However, currently, over 99% of entries in the UniProt protein database still lack high-quality EC number annotations, preventing a large number of potentially functional enzymes from being effectively applied to biosynthetic pathway design. Most importantly, given the core demands of intelligent manufacturing for efficiency, precision, and scalability, traditional experimental methods for determining EC numbers suffer from time-consuming, costly, and labor-intensive processes, which can no longer meet the development requirements of bio-intelligent manufacturing for efficient metabolic pathway design and large-scale cell factory construction. Therefore, developing efficient and accurate EC number prediction methods can accelerate the design and construction of microbial cell factories, thereby promoting the development of bio-intelligent manufacturing and synthetic biology.

[0003] Currently, some studies focus on predicting enzyme function based on sequence or structural features. The CLEAN method, which uses contrastive learning to capture amino acid sequence features to predict EC numbers, demonstrates high reliability in systematic experiments but cannot predict based on substrate and product information. The TopEC method further utilizes spatial information, predicting EC numbers based on the local three-dimensional structure of the protein. It is suitable for enzymes with known structures or those predictable using AlphaFold; however, this method is ineffective for unstructured enzymes and requires significant computational resources. The CARE method also considers predicting EC numbers based on protein sequence similarity as an important task. Overall, these methods are relatively mature in enzyme protein characterization, but they do not consider the logic of the chemical reaction itself, and still have limitations in predicting EC numbers when information such as enzyme sequence is insufficient.

[0004] Another group of studies attempts to infer enzyme function solely from the chemical reaction itself (i.e., the transformation relationship between reactants and products). For example, Cai et al. used reaction fingerprints as input features and constructed a multi-classification model based on machine learning methods such as random forests, support vector machines, and k-nearest neighbors. However, it only predicted the tertiary numbers of oxidoreductases (EC 1) and hydrolases (EC 3). Watanabe et al. used deep neural networks (DNNs) to integrate enzyme sequence information with the difference fingerprints of reactants and products as input to predict EC numbers. Although this supported dual input of enzyme sequence and reaction, the study found that the accuracy dropped significantly when relying solely on reaction information. In Task 2 of the CARE method, an attempt was made to fuse reaction SMILES sequences and textual description information to predict EC numbers. However, this only combined the one-dimensional reaction textual information, and the reaction information was not fully utilized. Fruscia et al. used a large language model (Llama-3.1 70B) for prediction. Although the accuracy of the first-level numbering was as high as 91.7%, the prediction accuracy for the second- and third-level numbers was only 61.7% and 49.2%, respectively, and it faced extremely high hardware deployment costs. The BEC-Pred method uses the reaction SMILES sequence based on the BERT model architecture to predict EC numbers, but its utilization of reaction information is still limited to one-dimensional sequences.

[0005] In summary, existing enzyme EC number prediction methods do not fully utilize information about the reaction and the enzyme, and lack methods for integrating multimodal reaction information, resulting in incomplete characterization of reaction information and consequently poor accuracy in predicting enzyme EC numbers. Summary of the Invention

[0006] Therefore, the technical problem to be solved by the present invention is to overcome the problem that the prior art does not fully utilize the information of the reaction and enzyme, resulting in inaccurate prediction of the enzyme EC number.

[0007] To address the aforementioned technical problems, this invention provides a method for predicting enzyme EC numbers, comprising: Obtain the sample to be predicted, which includes the substrate SMILES sequence and the product SMILES sequence; The sample to be predicted is input into the target BERT model. After word segmentation and word embedding of each SMILES sequence, the output is processed by multiple two-layer Transformer encoders in series, and then global average pooling is performed to obtain the sample sequence features of the sample to be predicted. Atom mapping is performed on the sample to be predicted to obtain the mapped reaction formula, and the reaction center and the total number of reaction atoms are identified so that the atom truncation strategy can be used to truncate the sample and obtain the truncated reaction formula. Each SMILES sequence in the truncated reaction formula is parsed into a molecular object containing atomic nodes and chemical bond edges, and all molecular objects are merged to obtain a joint molecular object. The atomic nodes and chemical bond edges in the joint molecular object are feature encoded to obtain the initial node feature matrix and the initial edge feature matrix, and the reaction map of the sample to be predicted is constructed. The reaction graph of the sample to be predicted is input into the target graph isomorphic neural network. Based on the recursive neighborhood aggregation mechanism, the target node aggregation features of each node are obtained, combined into the target node aggregation feature matrix, and global summation pooling and linear transformation are performed to obtain the molecular graph features of the sample to be predicted. A bidirectional cross-attention mechanism is used to fuse the sample sequence features and molecular graph features of the sample to be predicted to obtain multimodal features, which are then input into a multilayer perceptron to obtain the prediction probability of the enzyme EC number of the sample to be predicted.

[0008] Preferably, the sample to be predicted is input into the target BERT model. After word segmentation and word embedding of each SMILES sequence, the output is processed by multiple cascaded two-layer Transformer encoders, and then global average pooling is performed to obtain the sample sequence features of the sample to be predicted, including: After segmenting each SMILES sequence using the byte-pair encoding method, multiple tokens are obtained; The SMILES vocabulary is used to map each lexical element to a lexical ID. Using a word embedding matrix, each word ID is mapped to a continuous vector representation of a preset dimension; Based on the position of each word, position embedding vectors of each word are generated using absolute position encoding; based on whether each word belongs to a substrate or a product, fragment embedding vectors are generated for each word. The concatenated vector representation of each word is obtained by adding the continuous vector representation, positional embedding vector, and fragment embedding vector element by element; the concatenated vector representations of all words are stacked to obtain the initial embedding matrix. The initial embedding matrix is ​​passed through layer normalization and Dropout operations in sequence, and then through multiple cascaded Transform encoders. In each Transformer encoder, the input features are transformed by a multi-head self-attention sub-layer and a feedforward network sub-layer in sequence. The output of the last Transformer encoder is obtained as the context sequence feature matrix. The context sequence feature matrix is ​​averaged along the sequence length direction and aggregated to obtain the sample sequence features of the sample to be predicted.

[0009] Preferably, the sample to be predicted is atomically mapped to obtain the mapped reaction formula, and the reaction center and the total number of reaction atoms are identified so that an atomic truncation strategy can be used to truncate the reaction formula, including: After replacing the polymer connectors in the sample to be predicted with preset virtual atoms, perform atom mapping to obtain the mapping reaction formula; Identify and obtain the reaction centers and the total number of reaction atoms in the mapped reaction formula; By employing a molecular truncation strategy, atoms far from the reaction center are truncated when the total number of reaction atoms exceeds a preset threshold, until the total number of reaction atoms in the truncated reaction formula is less than the preset threshold, thus obtaining a truncated reaction formula.

[0010] Preferably, the atomic nodes and chemical bond edges in the joint molecular object are feature-encoded to obtain an initial node feature matrix and an initial edge feature matrix, and a reaction map of the sample to be predicted is constructed, including: Traverse each atomic node in the joint molecular object, extract atomic features, perform one-hot encoding, and obtain the corresponding atomic feature vectors; stack all the atomic feature vectors in order to obtain the initial node feature matrix; the atomic features include element type, chiral label, aromaticity, and formal charge; The chemical bond edges in the joint molecular object are traversed, chemical bond features are extracted, one-hot encoding is performed, and the corresponding chemical bond feature vectors are obtained. All chemical bond feature vectors are stacked in order to obtain an initial edge feature matrix. The chemical bond features include bond type, conjugation, and stereochemical properties. The reaction graph of the sample to be predicted is composed of the initial node feature matrix and the initial edge feature matrix.

[0011] Preferably, the reaction graph of the sample to be predicted is input into a graph isomorphic neural network. Based on the recursive neighborhood aggregation mechanism, the target node aggregation features of each node are obtained, combined into a target node aggregation feature matrix, and global summation pooling and linear transformation are performed to obtain the molecular graph features of the sample to be predicted, including: The reaction map of the sample to be predicted is input into the graph isomorphic neural network. After the embedding layer, the initial node feature matrix and the initial edge feature matrix are activated by the linear rectified function with leakage to obtain the node features and edge features of layer 0. Using a recursive neighborhood aggregation mechanism, based on the features of the nodes at layer 0, the features of each node and its neighboring nodes and connecting edges are aggregated to obtain the features of the nodes at layer 1. This iterative aggregation is repeated until the preset number of iterations is reached to obtain the aggregated features of the target nodes for each node. Based on the target node aggregation features of each node, a target node aggregation feature matrix is ​​formed, and global summation and pooling are performed to obtain graph-level feature vectors; A linear transformation is performed on the graph-level feature vectors to obtain the molecular graph features of the sample to be predicted.

[0012] Preferably, the reaction map of the sample to be predicted is input into a graph isomorphic neural network. After passing through the embedding layer, the initial node feature matrix and the initial edge feature matrix are activated by a linear rectified function with leakage to obtain the zero-layer node features and zero-layer edge features, represented as: Node features at layer 0 , represented as: ; 0-layer edge features , represented as: ; in, and These are the learnable weight matrices for nodes and edges, respectively; This represents the set of nodes corresponding to the initial node feature matrix; This represents the total number of nodes in the node set; This represents the set of edges corresponding to the initial edge feature matrix. This represents the total number of edges in the edge set; and These are the bias terms for nodes and edges, respectively; The dimension of a graph isomorphic neural network model; The i-th node The node aggregation feature after the second update , represented as: ; in, , For nodes The set of neighboring nodes, and These are the nodes before and after the update. The feature representation vector, For the edge The feature representation vector; , , and This is the learnable parameter matrix.

[0013] Preferably, a bidirectional cross-attention mechanism is used to fuse the sample sequence features and molecular graph features of the sample to be predicted to obtain multimodal features, including: Using sample sequence features as queries and molecular graph features as keys and values, a cross-attention mechanism is used to extract features and obtain the first fusion feature. Using molecular graph features as queries and sample sequence features as keys and values, a cross-attention mechanism is used to extract features and obtain the second fusion feature. The first fusion feature and the second fusion feature are concatenated to obtain multimodal features.

[0014] Preferably, the process of acquiring multimodal features and inputting them into a multilayer perceptron to obtain the predicted probability of the enzyme EC number of the sample to be predicted includes: inputting the multimodal features into the multilayer perceptron and sequentially passing them through layer normalization, linear operation, ReLU activation function, linear operation and Softmax activation function to obtain the predicted probability of the enzyme EC number of the sample to be predicted.

[0015] Preferably, obtaining the target BERT model and the target graph isomorphic neural network includes: Multiple enzyme-catalyzed reaction samples containing substrate SMILES sequences, product SMILES sequences, and corresponding enzyme EC numbers were obtained and combined to form an enzyme-catalyzed reaction sample set. By using a pre-trained BERT model and an initial graph isomorphic neural network, the predicted probability of the enzyme EC number for each enzyme-catalyzed reaction sample is obtained. Based on the predicted probability and the actual number value of the enzyme EC number of each enzyme-catalyzed reaction sample, a cross-entropy loss function is constructed. The gradient descent optimization algorithm is used to train the pre-trained BERT model and the initial graph isomorphic neural network until the cross-entropy loss function converges, thus obtaining the target BERT model and the target graph isomorphic neural network.

[0016] Preferably, the pre-trained BERT model is obtained by training using a chemical reaction sample set, and the training process includes: Multiple chemical reaction samples containing substrate SMILES sequences and product SMILES sequences were obtained and combined to form a chemical reaction sample set; Using a masked language model, some words in a chemical reaction sample are randomly masked, and the initial BERT model is made to predict the masked words based on the context to obtain the predicted words. The initial BERT model is trained based on the cross-entropy loss between predicted words and actual masked words until the cross-entropy loss converges, thus obtaining a pre-trained BERT model.

[0017] Compared with the prior art, the above-described technical solution of the present invention has the following advantages: The enzyme EC number prediction method described in this invention is based on the substrate SMILES sequence and product SMILES sequence of a sample. It uses a BERT model to extract sequence features and obtain sample sequence features. A reaction map of the sample is constructed using atom mapping, atom truncation, sequence parsing, and feature encoding. Graph features of the reaction map are extracted using a graph isomorphic neural network to obtain molecular graph features. The sample sequence features and molecular graph features are fused using bidirectional cross-attention for prediction, achieving end-to-end prediction of enzyme EC numbers. This method effectively overcomes the problems of high cost, low efficiency, and incomplete utilization of reaction information in traditional biological experimental methods and existing models, significantly improving the accuracy and reliability of enzyme EC number prediction. It provides important technical support for enzyme screening and modification, metabolic pathway modeling, and related bioengineering research.

[0018] This invention utilizes the BERT model to extract sample sequence features, and combines its deep bidirectional Transformer architecture to enable the model to deeply understand the chemical syntax and contextual dependencies of SMILES sequences. This provides high-quality sequence representations rich in chemical semantics for subsequent predictions, thereby improving the prediction accuracy of enzyme EC numbers.

[0019] In constructing the reaction graph of a sample, this invention resolves the SMILES sequence into a joint molecule containing atomic nodes and chemical bond edges, and introduces atomic mapping and atomic truncation strategies. This achieves accurate and efficient modeling of the spatial structure of enzymatic reactions, while fully preserving key structural information such as molecular topological connections and stereochemistry. At the same time, it avoids the problem of excessively large graph size caused by macromolecules, providing a standardized, computable, and information-complete input for graph neural networks, and laying the foundation for structural feature extraction.

[0020] This invention employs a graph isomorphic neural network and its recursive neighborhood aggregation mechanism when extracting molecular graph features from samples. This effectively identifies and encodes higher-order substructures and chemical environments in molecules, enabling the extracted graph features to distinguish subtle stereochemical and topological differences. This provides crucial structural evidence for understanding the structure-activity relationship between reaction centers and enzyme functions, further ensuring the accuracy of enzyme EC number prediction.

[0021] When performing feature fusion using a bidirectional cross-attention mechanism, this invention allows sample sequence features and molecular graph features to serve as queries and contexts for each other, enabling dynamic and fine-grained cross-modal information interaction. This allows the model to automatically focus on key information that corroborates and complements each other in the two modalities, thereby generating more discriminative and robust multimodal fusion features and improving prediction robustness.

[0022] This invention employs a two-stage strategy—combining chemical reaction pre-training with enzyme-catalyzed reaction fine-tuning—for training the BERT model and the graph isomorphic neural network, along with end-to-end joint optimization. The pre-training stage utilizes a massive amount of unlabeled chemical reaction samples to infuse the BERT model with general chemical knowledge, alleviating the problem of insufficient labeled enzyme-catalyzed reaction sample data. The fine-tuning stage optimizes the model overall through cross-entropy loss and gradient descent, enabling the BERT model and the graph isomorphic neural network to collaboratively adapt to the specific task of EC number prediction. This training strategy significantly improves the model's convergence speed, generalization ability, and final performance stability, ensuring complete, accurate, and efficient prediction of enzyme EC numbers. Attached Figure Description

[0023] To make the content of this invention easier to understand, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings, wherein: Figure 1 This is a flowchart of the enzyme EC number prediction method of the present invention; Figure 2 This is a schematic diagram illustrating the principle of enzyme EC number prediction. Figure 3 This is a graph showing the accuracy variation of the method of the present invention on the training set, validation set, and test set; Figure 4 This is a graph showing the accuracy variation of the method of the present invention on the training set, validation set, and test set; Figure 5 This is a graph showing the recall rate of the method of the present invention on the training set, validation set, and test set. Figure 6 This is a graph showing the changes in F1 scores of the method of the present invention on the training set, validation set, and test set; Figure 7 This is a graph showing the variation of the Matthews correlation coefficient of the method of the present invention on the training set, validation set, and test set; Figure 8 This is a comparison chart of the performance indicators of the method of the present invention under different Top-k values. Detailed Implementation

[0024] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments described are not intended to limit the present invention.

[0025] Reference Figure 1 The flowchart of the enzyme EC number prediction method of the present invention is shown in steps S101 to S107.

[0026] S101: Obtain the sample to be predicted, which includes the substrate SMILES sequence and the product SMILES sequence.

[0027] S102: Input the sample to be predicted into the target BERT model. After word segmentation and word embedding of each SMILES sequence, the output is processed by multiple cascaded two-layer Transformer encoders, followed by global average pooling to obtain the sample sequence features of the sample to be predicted, including: After segmenting each SMILES sequence using the byte-pair encoding method, multiple tokens are obtained; The SMILES vocabulary is used to map each lexical element to a lexical ID. Using a word embedding matrix, each word ID is mapped to a continuous vector representation of a preset dimension; Based on the position of each word, position embedding vectors of each word are generated using absolute position encoding; based on whether each word belongs to a substrate or a product, fragment embedding vectors are generated for each word. The concatenated vector representation of each word is obtained by adding the continuous vector representation, positional embedding vector, and fragment embedding vector element by element; the concatenated vector representations of all words are stacked to obtain the initial embedding matrix. The initial embedding matrix is ​​passed through layer normalization and Dropout operations in sequence, and then through multiple cascaded Transform encoders. In each Transformer encoder, the input features are transformed by a multi-head self-attention sub-layer and a feedforward network sub-layer in sequence. The output of the last Transformer encoder is obtained as the context sequence feature matrix. The context sequence feature matrix is ​​averaged along the sequence length direction and aggregated to obtain the sample sequence features of the sample to be predicted.

[0028] This invention utilizes the BERT model to extract sample sequence features, and combines its deep bidirectional Transformer architecture to enable the model to deeply understand the chemical syntax and contextual dependencies of SMILES sequences. This provides high-quality sequence representations rich in chemical semantics for subsequent predictions, thereby improving the prediction accuracy of enzyme EC numbers.

[0029] S103: Perform atomic mapping on the sample to be predicted, obtain the mapped reaction formula, and identify the reaction center and the total number of reaction atoms so as to use an atomic truncation strategy to truncate the reaction formula, including: After replacing the polymer connectors in the sample to be predicted with preset virtual atoms, perform atom mapping to obtain the mapping reaction formula; Identify and obtain the reaction centers and the total number of reaction atoms in the mapped reaction formula; By employing a molecular truncation strategy, atoms far from the reaction center are truncated when the total number of reaction atoms exceeds a preset threshold, until the total number of reaction atoms in the truncated reaction formula is less than the preset threshold, thus obtaining a truncated reaction formula.

[0030] S104: Parse each SMILES sequence in the truncated reaction formula into a molecular object containing atomic nodes and chemical bond edges, and merge all molecular objects to obtain a joint molecular object.

[0031] S105: Feature encoding is performed on the atomic nodes and chemical bond edges in the joint molecular object to obtain the initial node feature matrix and the initial edge feature matrix, and the reaction map of the sample to be predicted is constructed, including: Traverse each atomic node in the joint molecular object, extract atomic features, perform one-hot encoding, and obtain the corresponding atomic feature vectors; stack all the atomic feature vectors in order to obtain the initial node feature matrix; the atomic features include element type, chiral label, aromaticity, and formal charge; The chemical bond edges in the joint molecular object are traversed, chemical bond features are extracted, one-hot encoding is performed, and the corresponding chemical bond feature vectors are obtained. All chemical bond feature vectors are stacked in order to obtain an initial edge feature matrix. The chemical bond features include bond type, conjugation, and stereochemical properties. The reaction graph of the sample to be predicted is composed of the initial node feature matrix and the initial edge feature matrix.

[0032] In constructing the reaction graph of a sample, this invention resolves the SMILES sequence into a joint molecule containing atomic nodes and chemical bond edges, and introduces atomic mapping and atomic truncation strategies. This achieves accurate and efficient modeling of the spatial structure of enzymatic reactions, while fully preserving key structural information such as molecular topological connections and stereochemistry. At the same time, it avoids the problem of excessively large graph size caused by macromolecules, providing a standardized, computable, and information-complete input for graph neural networks, and laying the foundation for structural feature extraction.

[0033] S106: Input the response map of the sample to be predicted into the target graph isomorphic neural network. Based on the recursive neighborhood aggregation mechanism, obtain the target node aggregation features of each node, combine them into a target node aggregation feature matrix, and perform global summation pooling and linear transformation to obtain the molecular graph features of the sample to be predicted, including: S106-1: Input the reaction map of the sample to be predicted into the graph isomorphic neural network. After the embedding layer, activate the initial node feature matrix and the initial edge feature matrix with a leaky linear rectified function to obtain the 0-layer node features and 0-layer edge features, represented as: Node features at layer 0 , represented as: ; 0-layer edge features , represented as: ; in, and These are the learnable weight matrices for nodes and edges, respectively; This represents the set of nodes corresponding to the initial node feature matrix; This represents the total number of nodes in the node set; This represents the set of edges corresponding to the initial edge feature matrix. This represents the total number of edges in the edge set; and These are the bias terms for nodes and edges, respectively; The dimension of a graph isomorphic neural network model; S106-2: Using a recursive neighborhood aggregation mechanism, based on the features of the nodes at layer 0, the features of each node and its neighboring nodes and connecting edges are aggregated to obtain the features of the nodes at layer 1. The aggregation is repeated until the preset number of iterations is reached to obtain the aggregated features of the target nodes of each node. The i-th node The node aggregation feature after the second update , represented as: ; in, , For nodes The set of neighboring nodes, and These are the nodes before and after the update. The feature representation vector, For the edge The feature representation vector; , , and The learnable parameter matrix; S106-3: Based on the target node aggregation features of each node, combine them into a target node aggregation feature matrix, and perform global summation pooling to obtain graph-level feature vectors; S106-4: Perform a linear transformation on the graph-level feature vector to obtain the molecular graph features of the sample to be predicted.

[0034] This invention employs a graph isomorphic neural network and its recursive neighborhood aggregation mechanism when extracting molecular graph features from samples. This effectively identifies and encodes higher-order substructures and chemical environments in molecules, enabling the extracted graph features to distinguish subtle stereochemical and topological differences. This provides crucial structural evidence for understanding the structure-activity relationship between reaction centers and enzyme functions, further ensuring the accuracy of enzyme EC number prediction.

[0035] S107: A bidirectional cross-attention mechanism is used to fuse the sample sequence features and molecular graph features of the sample to be predicted, obtaining multimodal features. These features are then input into a multilayer perceptron to obtain the predicted probability of the enzyme EC number of the sample to be predicted, including: S107-1: Using sample sequence features as queries and molecular graph features as keys and values, feature extraction is performed using a cross-attention mechanism to obtain the first fusion feature; S107-2: Using molecular graph features as queries and sample sequence features as keys and values, feature extraction is performed using a cross-attention mechanism to obtain the second fusion feature; S107-3: Concatenate the first fusion feature with the second fusion feature to obtain multimodal features; S107-4: Input the multimodal features into the multilayer perceptron, and pass them through layer normalization, linear operation, ReLU activation function, linear operation and Softmax activation function in sequence to obtain the prediction probability of the enzyme EC number of the sample to be predicted.

[0036] When performing feature fusion using a bidirectional cross-attention mechanism, this invention allows sample sequence features and molecular graph features to serve as queries and contexts for each other, enabling dynamic and fine-grained cross-modal information interaction. This allows the model to automatically focus on key information that corroborates and complements each other in the two modalities, thereby generating more discriminative and robust multimodal fusion features and improving prediction robustness.

[0037] Based on the above embodiments, in this embodiment of the invention, obtaining the target BERT model and the target graph isomorphic neural network includes: Multiple enzyme-catalyzed reaction samples containing substrate SMILES sequences, product SMILES sequences, and corresponding enzyme EC numbers were obtained and combined to form an enzyme-catalyzed reaction sample set. By using a pre-trained BERT model and an initial graph isomorphic neural network, the predicted probability of the enzyme EC number for each enzyme-catalyzed reaction sample is obtained. Based on the predicted probability and the actual number value of the enzyme EC number of each enzyme-catalyzed reaction sample, a cross-entropy loss function is constructed. The gradient descent optimization algorithm is used to train the pre-trained BERT model and the initial graph isomorphic neural network until the cross-entropy loss function converges, thus obtaining the target BERT model and the target graph isomorphic neural network.

[0038] The pre-trained BERT model was obtained using a chemical reaction sample set, and the training process included: Multiple chemical reaction samples containing substrate SMILES sequences and product SMILES sequences were obtained and combined to form a chemical reaction sample set; Using a masked language model, some words in a chemical reaction sample are randomly masked, and the initial BERT model is made to predict the masked words based on the context to obtain the predicted words. The initial BERT model is trained based on the cross-entropy loss between predicted words and actual masked words until the cross-entropy loss converges, thus obtaining a pre-trained BERT model.

[0039] Specifically, in this embodiment, after obtaining the chemical reaction sample set and the enzyme-catalyzed reaction sample set, the sample sets are preprocessed, including: standardizing the SMILES sequences in each chemical reaction sample in the chemical reaction sample set, and deleting duplicate samples, samples that do not conform to chemical specifications, samples missing substrate SMILES sequences, and samples missing product SMILES sequences to obtain a preprocessed chemical reaction sample set; and deleting samples in the enzyme-catalyzed reaction sample set that are missing substrate SMILES sequences, missing product SMILES sequences, or have incomplete enzyme EC numbers to obtain a preprocessed enzyme-catalyzed reaction sample set.

[0040] This invention employs a two-stage strategy—combining chemical reaction pre-training with enzyme-catalyzed reaction fine-tuning—for training the BERT model and the graph isomorphic neural network, along with end-to-end joint optimization. The pre-training stage utilizes a massive amount of unlabeled chemical reaction samples to infuse the BERT model with general chemical knowledge, alleviating the problem of insufficient labeled enzyme-catalyzed reaction sample data. The fine-tuning stage optimizes the model overall through cross-entropy loss and gradient descent, enabling the BERT model and the graph isomorphic neural network to collaboratively adapt to the specific task of EC number prediction. This training strategy significantly improves the model's convergence speed, generalization ability, and final performance stability, ensuring complete, accurate, and efficient prediction of enzyme EC numbers.

[0041] Based on the above embodiments, this invention provides a complete process from model training to enzyme EC number prediction. By constructing a dataset of chemical reactions and enzyme-catalyzed reactions for model training and testing, the BERT model is pre-trained using chemical reactions to learn chemical reaction rules. Then, enzyme-catalyzed reaction SMILES sequence features are extracted, a reaction map is constructed, molecular graph features are extracted using a graph neural network, multimodal features are fused, and enzyme EC number prediction results are output. The dataset is then used for model training and testing. (Refer to...) Figure 2 The diagram shown is a schematic of the enzyme EC number prediction principle. Based on this principle, the specific steps are shown in S201 to S207.

[0042] S201: Construct and preprocess the dataset of chemical and enzymatic reactions for training.

[0043] S201-1: Collect chemical reaction datasets and enzyme-catalyzed reaction datasets. Each chemical reaction and enzyme-catalyzed reaction sample contains substrate and product SMILES sequence information, and each enzyme-catalyzed reaction sample has corresponding enzyme EC number information; specifically including: On the one hand, a dataset containing 350,000 chemical reactions was obtained from the database (https: / / github.com / KeeliaQWJ / BEC-Pred / tree / main / data) collected by the paper that proposed BECPred (Qian W, Wang X, Kang Y, et al. A general model for predicting enzyme functions based on enzymatic reactions. Journal of Cheminformatics, 2024, 16(1): 38.).

[0044] Each chemical reaction sample contains SMILES sequence information for both reactants and products. For example, consider the following chemical reaction sample: CC(=O)OC[C@H](N)C(=O)OS>>CC(=O)ON[C@@H](CS)C(=O)O; Wherein, CC(=O)OC[C@H](N)C(=O)O is the SMILES sequence of the reactant O-acetyl-L-serine, and S is the SMILES sequence of the reactant sulfur. CC(=O)O is the SMILES sequence of the product acetic acid, and N[C@@H](CS)C(=O)O is the SMILES sequence of the product L-cysteine.

[0045] On the other hand, the ECREACT dataset containing 62,000 enzymatic reactions was obtained from the database compiled in the paper (Probst D, Manica M, Nana Teukam YG, et al. Biocatalysed synthesis planning using data-driven learning. Nature communications, 2022, 13(1):964.). Each reaction in ECREACT has a corresponding enzyme EC number, for example, the following reaction: NC(=O)C1=CC=C[N+](=C1)[C@@H]1O[C@H](COP([O-])(=O)OP(O)(=O)OC[C@H]2O[C@H]([C@H](O)[C@@H]2O)N2 C=NC3=C(N)N=CN=C23)[C@@H](O)[C@H]1O.O=O.Oc1ccc2ccccc2n1.[H+]|1.14.13.61>>Oc1ccc2cccc(O)c2n1; Wherein, NC(=O)…[C@H]1O is the SMILES sequence of NAD+ (nicotinamide adenine dinucleotide), O=O is the SMILES sequence of oxygen molecule, Oc1ccc2ccccc2n1 is the SMILES sequence of reactant molecule 2-hydroxyquinoline, [H+] is the SMILES sequence of hydrogen ion, 1.14.13.61 is the EC number of the enzyme catalyzing the reaction, and Oc1ccc2cccc(O)c2n1 is the SMILES sequence of product molecule (2,8-dihydroxyquinoline).

[0046] S201-2: Preprocess the chemical reaction dataset by standardizing all SMILES molecules in each reaction sample to remove duplicate data and reaction samples that do not conform to chemical specifications (molecules that fail to be standardized) or lack reactant or product sequence information, so as to obtain standardized and complete chemical reaction sample data. Since the same molecule corresponds to multiple SMILES expressions, the Chem.MolFromSmiles and Chem.MolToSmiles tools in the RDKit library of Python are used to standardize the SMILES of all molecules in each reaction sample. Then, the pandas tool in Python is used to remove duplicate data and reaction samples that do not conform to chemical norms (molecules that failed the standardization process) or are missing reactant or product sequence information, so as to obtain standardized and complete chemical reaction sample data for subsequent BERT model pre-training.

[0047] S201-3: Preprocessing of the enzyme-catalyzed reaction dataset; Enzyme-catalyzed reaction samples lacking reactant or product sequence information and with enzyme EC numbers less than four digits were removed. For training the subsequent prediction model, each processed enzyme-catalyzed reaction sample was split into an input and an output portion. The input contained the SMILES sequence information of the substrate and product in the enzyme-catalyzed reaction, and the output was the enzyme EC number (tag information) corresponding to each reaction sample.

[0048] S202: Using the BERT model to extract sequence features of substrates and products in the reaction.

[0049] S202-1: Construct a BERT (Bidirectional Transformer Encoder) model using the rxnfp library in Python. This model utilizes Byte Pair Encoding (BPE) to segment all substrate and reactant SMILES sequences in the reaction. Each segmented term is mapped to a word ID using the SMILES vocabulary and input into the BERT embedding layer. The word embedding matrix maps discrete word IDs to fixed-dimensional continuous vector representations, and then adds them element-wise to the positional embeddings generated by absolute positional encoding and the fragment embeddings generated by fragment encoding to obtain the initial embedding representation representing the reaction SMILES sequences. ,in is the model dimension, and l is the length of the word segment sequence after word segmentation.

[0050] S202-2: After layer normalization and Dropout operations, the initial embedding representation is... The input is fed into L bidirectional Transformer encoder layers. In each layer, a multi-head self-attention sublayer models the dependencies between any two terms in the sequence, followed by a feedforward sublayer for non-linear transformation, outputting a context-aware sequence feature representation. Each sublayer employs residual connections and layer normalization operations to improve training stability and feature representation capabilities.

[0051] S202-3: Characteristics of the reaction sequence Perform average pooling to obtain sample sequence features of the reaction sequence. .

[0052] S203: Construct a reaction diagram for enzyme-catalyzed reactions.

[0053] S203-1: Further processing is performed on the enzyme-catalyzed reaction SMILES sequences (including substrates and products) obtained in step S101; some SMILES sequences in the enzyme-catalyzed reaction dataset contain polymer linkers *, which cannot be correctly resolved by chemical tools, thus affecting the extraction of reaction map features. Therefore, all * in each SMILES sequence are uniformly replaced with virtual atoms [Link].

[0054] For example, the SMILES sequence: After replacing the connector * in “*NC(=O)[C@H](Cc1c[nH]c2ccccc12)NC(*)=OO=O>>*NC(=O)[C@H](CC(=O)c1ccccc1NC=O)NC(*)=O” with the virtual atom [Link], we get: [Link]NC(=O)[C@H](Cc1c[nH]c2ccccc12)NC([Link])=OO=O>>[Link]NC(=O)[C@H](CC(=O)c1ccccc1NC=O)NC([Link])=O.

[0055] S203-2: Use the RXNMapper tool in the rxnmapper library of Python to perform atom mapping on the replaced reaction SMILES sequence and output the mapped reaction formula with atom numbers.

[0056] For example, the sequence obtained above becomes the following after atomic mapping: [Link]NC(=[O:3])[C@H:4]([CH2:5][c:6]1[c:7][nH:8][c:9]2[c:10][c:11][c:12][c:13][c:14]12)[N:15]C([Link])=[O:16].[O:17]=[O:18]> >[Link]NC(=[O:3])[C@H:4]([CH2:5][C:6](=[O:19])[c:7]1[c:8][c:9][c:10][c:11][c:12]1[N:13][C:14]=[O:20])[N:15]C([Link])=[O:16].

[0057] S203-3: Meanwhile, to avoid excessively large graph size due to excessively long molecular sequences, a molecular truncation strategy is introduced; the ReactionFromSmarts tool and Chem.GetNumAtoms tool in the RDKit library of Python are used to identify the reaction center and the total number of atoms in the molecules in the reaction; when the number of atoms in the reaction exceeds a preset threshold (100), the local structure near the reaction center is preserved and the far-end fragments are truncated to ensure the integrity of the reaction center region.

[0058] S203-4: Construct a co-molecular object to represent the overall structure of an enzyme-catalyzed reaction.

[0059] The Chem.MolFromSmiles tool from the RDKit library in Python is used to parse the SMILES sequences of substrates and products in an enzymatic reaction into molecular objects; the Chem.CombineMols tool is used to merge multiple molecular objects in the reaction into a single combined molecular object to uniformly represent all participating molecules in the reaction.

[0060] Each molecular object consists of atoms (nodes) and chemical bonds (edges); atomic features include element type, chiral marking, aromaticity, formal charge, etc.; chemical bond features include bond type, conjugation, and stereochemical properties, etc.

[0061] S203-5: Finally, feature encoding is performed on the nodes and edges in the joint molecular object to obtain the enzyme-catalyzed reaction graph.

[0062] For the joint molecular object, the node features of each atom are obtained using tools such as GetAtomicNum, GetDegree, and GetIsAromatic from the RDKit library in Python, and the edge features of each chemical bond are obtained using tools such as GetBondType, GetIsConjugated, and IsInRing.

[0063] The nodes and edges are feature-encoded using the one-hot encoding method to construct a reaction graph: ; in, Represents a set of nodes. This represents the set of edges. Also, Represents the initial node feature matrix. To merge the total number of atoms in the molecular diagram, Dimensions are the atomic features within a node. Represents the initial edge feature matrix. To count the number of edges in the merged molecular graph, is the dimension of the edge features.

[0064] S204: Extracting graph features of enzymatic reactions using graph isomorphic neural networks (GIN).

[0065] S204-1: The initial node feature matrix of the joint molecule. and the initial edge feature matrix Feature transformation through the embedding layer can be represented as follows: ; ; in, and These are the learnable weight matrices for nodes and edges, respectively; This represents the set of nodes corresponding to the initial node feature matrix; This represents the total number of nodes in the node set; This represents the set of edges corresponding to the initial edge feature matrix. This represents the total number of edges in the edge set; and These are the bias terms for nodes and edges, respectively. For the GIN model dimensions.

[0066] S204-2: Based on the connection relationships of the nodes in the graph and the feature representations of each node and edge, the feature representation vectors of the nodes are updated in K rounds using a recursive neighborhood aggregation mechanism.

[0067] In each round of message passing, a node aggregates the features of its neighboring nodes and the features of its connecting edges to iteratively update its own representation. In the GIN... Layer, i-th node The feature vector is updated as follows: ; in, , For nodes The set of neighboring nodes, and These are the nodes before and after the update. The feature representation vector, For the edge The feature representation vector, , , and This is the learnable parameter matrix.

[0068] After K rounds of message passing, the final matrix representing the characteristics of all nodes is obtained: .

[0069] S204-3: Perform global summation pooling on the node feature matrix, aggregate the features of all nodes into a graph-level feature vector, and perform parallel linear transformation to obtain the final feature representation of the molecular graph. , represented as: ; in, It is a learnable linear transformation weight matrix.

[0070] S205: By utilizing a bidirectional cross-attention mechanism composed of two symmetrical cross-attention branches, sequence and graph features of enzymatic reactions are fused to extract cross-modal interaction information as multimodal features.

[0071] S205-1: Extracting the reaction sequence features from step S202 The reaction graph features extracted in step S204 serve as a query. The fusion feature of branch one is calculated as a key and a value.

[0072] The calculation of the i-th attention head in branch one is as follows: ; The fused features are obtained by concatenating the outputs of all heads and performing a linear transformation. , represented as: .

[0073] S205-2: Characteristics of the reaction diagram As a query, response sequence features The fusion features of branch two are calculated as key and value.

[0074] The calculation of the i-th attention head in branch two is as follows: ; The fused features are obtained by concatenating the outputs of all heads and performing a linear transformation. , represented as: ; in, , and Let Q, K, and V be the linear transformation matrices for the i-th attention head, respectively. The dimension of each attention head vector, For the number of attention heads, This is the output transformation matrix.

[0075] S205-3: The fusion feature of splicing the two branches is used as the multimodal feature after fusing the response sequence and response map features, represented as: ; in, This refers to the multimodal features resulting from the fusion of reaction sequence and reaction map features.

[0076] S206: Output the predicted Level 4 EC number.

[0077] The fused features Input a multilayer perceptron and output the probability of predicting Level 4 EC numbers (a total of 5904 EC number categories). .

[0078] Among them, the multilayer perceptron includes layer normalization. Linear operations The ReLU activation function is followed by softmax activation. This process can be represented as: .

[0079] S207: Train and test the model using the reaction dataset.

[0080] S207-1: Using the chemical reaction dataset constructed and preprocessed in step S201, a BERT model is pre-trained based on the masked language model task using a self-supervised learning approach.

[0081] The model parameter configuration and pre-training parameter configuration are shown in Tables 1 and 2. This method does not rely on manually labeled words; it learns the conditional probability distribution of words in the SMILES sequence by randomly masking a subset of words under contextual conditions. For the masked position, the model predicts the original word based on the corresponding contextual representation vector, and uses the cross-entropy loss of the masked position as the optimization objective.

[0082] Table 1 BERT Model Hyperparameter Configuration

[0083] Table 2. Parameter configuration for pre-training

[0084] S207-2: Divide the enzyme-catalyzed reaction dataset processed in step S201 into a training set, a validation set, and a test set in a ratio of 8:1:1.

[0085] Using the training set and the cross-entropy function as the loss function, the model is trained based on the ideas of gradient descent and error backpropagation. The pre-trained BERT model and the graph isomorphic network in step S204 are used to extract response sequences and graph features, respectively. After feature fusion using the cross-attention mechanism in step S205, these features are fed into step S206 to predict EC numbers. The hyperparameter configurations of the graph isomorphic network and the cross-attention module are shown in Table 3. The cross-entropy loss function between the predicted and true values ​​is calculated as follows: ; Where N is the number of samples in the training batch. The actual value for the enzyme EC number. This represents the predicted value output by the model.

[0086] Table 3 Hyperparameter configurations of Graph Isomorphic Network (GIN) and Cross-Attention Module

[0087] The AdamW optimization algorithm was used to minimize the loss function. The initial parameters of the BERT model were pre-trained, while the parameters of the graph neural network were randomly initialized. During training, the model's performance on the validation set was observed, and hyperparameters were adjusted accordingly. Specifically, different initial learning rates were set for training, including 1e-3, 5e-4, and 1e-5, with 1e-5 being selected as the learning rate due to its better performance on the validation set. The batch size was also adjusted from 8 to 16, and larger batches showed more stable training. To prevent overfitting, the dropout rate was increased from 0.1 to 0.2, which improved the loss on the validation set. The model weights from the best training iteration were saved, and the saved model was tested using the test dataset. The parameter configurations during training are shown in Table 4.

[0088] Table 4 Training Parameter Configuration

[0089] Finally, the model was tested using the test set in the enzyme-catalyzed reaction dataset. Five evaluation metrics—Accuracy, Precision, Recall, F1 score, and Matthews correlation coefficient (MCC)—were used to assess the model's performance, and its predictive performance was compared with other deep learning-based models.

[0090] Reference Figure 3 The figure shown is a graph illustrating the accuracy variation of the method of the present invention on the training set, validation set, and test set; refer to Figure 4 The figure shown is a graph illustrating the accuracy variation of the method of the present invention on the training set, validation set, and test set; refer to... Figure 5 The figure shown is a graph illustrating the recall rate variation of the method of the present invention on the training set, validation set, and test set; refer to Figure 6 The figure shows the F1 score variation curves of the method of the present invention on the training set, validation set, and test set; refer to Figure 7The figure shows the Matthews correlation coefficient variation curves of the method of the present invention on the training set, validation set, and test set. The comparative models selected in this embodiment include the BEC-Pred model, which uses a single sequence model to predict enzyme EC numbers, and the single graph neural network (GNN) model constructed in this invention. All the above models were tested using the test set from the same enzyme-catalyzed reaction dataset, with the reaction SMILES sequence as input and the enzyme EC number as output. The performance comparison results of each model are shown in Table 5. It can be seen that the accuracy, precision, recall, F1 score, and Matthews correlation coefficient of the model proposed in this invention are 0.6849, 0.6775, 0.6849, 0.6775, and 0.6723, respectively. The performance of each indicator was improved by 6.7%, 3.4%, 6.7%, 6.4%, and 8.1% respectively compared to the BEC-Pred model (Qian W, Wang X, Kang Y, et al. A general model for predicting enzyme functions based on enzymatic reactions. Journal of Cheminformatics, 2024, 16(1): 38.).

[0091] Table 5 Prediction Performance of Different Models

[0092] Reference Figure 8 The figure shows a comparison of the performance indicators of the method of the present invention under different Top-k values; where the values ​​of k are 1, 3, 5, and 10, respectively. It can be seen that as the value of k increases, all performance indicators of the model show a significant upward trend. This result indicates that the prediction model constructed in this invention has good performance scalability and can significantly improve the overall performance of enzyme EC number prediction by appropriately broadening the candidate range, further verifying the effectiveness and practicality of the model.

[0093] The enzyme EC number prediction method described in this invention is based on the substrate SMILES sequence and product SMILES sequence of a sample. It uses a BERT model to extract sequence features and obtain sample sequence features. A reaction map of the sample is constructed using atom mapping, atom truncation, sequence parsing, and feature encoding. Graph features of the reaction map are extracted using a graph isomorphic neural network to obtain molecular graph features. The sample sequence features and molecular graph features are fused using bidirectional cross-attention for prediction, achieving end-to-end prediction of enzyme EC numbers. This method effectively overcomes the problems of high cost, low efficiency, and incomplete utilization of reaction information in traditional biological experimental methods and existing models, significantly improving the accuracy and reliability of enzyme EC number prediction. It provides important technical support for enzyme screening and modification, metabolic pathway modeling, and related bioengineering research.

[0094] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0095] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0096] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0097] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0098] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.

Claims

1. A method for predicting enzyme EC numbers, characterized in that, include: Obtain the sample to be predicted, which includes the substrate SMILES sequence and the product SMILES sequence; The sample to be predicted is input into the target BERT model. After word segmentation and word embedding of each SMILES sequence, the output is processed by multiple two-layer Transformer encoders in series, and then global average pooling is performed to obtain the sample sequence features of the sample to be predicted. Atom mapping is performed on the sample to be predicted to obtain the mapped reaction formula, and the reaction center and the total number of reaction atoms are identified so that the atom truncation strategy can be used to truncate the sample and obtain the truncated reaction formula. Each SMILES sequence in the truncated reaction formula is parsed into a molecular object containing atomic nodes and chemical bond edges, and all molecular objects are merged to obtain a joint molecular object. The atomic nodes and chemical bond edges in the joint molecular object are feature encoded to obtain the initial node feature matrix and the initial edge feature matrix, and the reaction map of the sample to be predicted is constructed. The reaction graph of the sample to be predicted is input into the target graph isomorphic neural network. Based on the recursive neighborhood aggregation mechanism, the target node aggregation features of each node are obtained, combined into the target node aggregation feature matrix, and global summation pooling and linear transformation are performed to obtain the molecular graph features of the sample to be predicted. A bidirectional cross-attention mechanism is used to fuse the sample sequence features and molecular graph features of the sample to be predicted to obtain multimodal features, which are then input into a multilayer perceptron to obtain the prediction probability of the enzyme EC number of the sample to be predicted.

2. The enzyme EC number prediction method according to claim 1, characterized in that, The sample to be predicted is input into the target BERT model. After word segmentation and word embedding of each SMILES sequence, the output is processed by multiple cascaded two-layer Transformer encoders, followed by global average pooling to obtain the sample sequence features of the sample to be predicted, including: After segmenting each SMILES sequence using the byte-pair encoding method, multiple tokens are obtained; The SMILES vocabulary is used to map each lexical element to a lexical ID. Using a word embedding matrix, each word ID is mapped to a continuous vector representation of a preset dimension; Based on the position of each word, position embedding vectors of each word are generated using absolute position encoding; based on whether each word belongs to a substrate or a product, fragment embedding vectors are generated for each word. The concatenated vector representation of each word is obtained by adding the continuous vector representation, positional embedding vector, and fragment embedding vector element by element; the concatenated vector representations of all words are stacked to obtain the initial embedding matrix. The initial embedding matrix is ​​passed through layer normalization and Dropout operations in sequence, and then through multiple cascaded Transform encoders. In each Transformer encoder, the input features are transformed by a multi-head self-attention sub-layer and a feedforward network sub-layer in sequence. The output of the last Transformer encoder is obtained as the context sequence feature matrix. The context sequence feature matrix is ​​averaged along the sequence length direction and aggregated to obtain the sample sequence features of the sample to be predicted.

3. The enzyme EC number prediction method according to claim 1, characterized in that, Atom mapping is performed on the sample to be predicted to obtain the mapped reaction formula, and the reaction center and the total number of reaction atoms are identified so that the atom truncation strategy can be used to truncate the reaction formula, including: After replacing the polymer connectors in the sample to be predicted with preset virtual atoms, perform atom mapping to obtain the mapping reaction formula; Identify and obtain the reaction centers and the total number of reaction atoms in the mapped reaction formula; By employing a molecular truncation strategy, atoms far from the reaction center are truncated when the total number of reaction atoms exceeds a preset threshold, until the total number of reaction atoms in the truncated reaction formula is less than the preset threshold, thus obtaining a truncated reaction formula.

4. The enzyme EC number prediction method according to claim 1, characterized in that, Feature encoding is performed on the atomic nodes and chemical bond edges in the joint molecular object to obtain the initial node feature matrix and the initial edge feature matrix. The reaction map of the sample to be predicted is then constructed, including: Traverse each atomic node in the joint molecular object, extract atomic features, perform one-hot encoding, and obtain the corresponding atomic feature vectors; stack all the atomic feature vectors in order to obtain the initial node feature matrix; the atomic features include element type, chiral label, aromaticity, and formal charge; The chemical bond edges in the joint molecular object are traversed, chemical bond features are extracted, one-hot encoding is performed, and the corresponding chemical bond feature vectors are obtained. All chemical bond feature vectors are stacked in order to obtain an initial edge feature matrix. The chemical bond features include bond type, conjugation, and stereochemical properties. The reaction graph of the sample to be predicted is composed of the initial node feature matrix and the initial edge feature matrix.

5. The enzyme EC number prediction method according to claim 1, characterized in that, The reaction graph of the sample to be predicted is input into a graph isomorphic neural network. Based on the recursive neighborhood aggregation mechanism, the target node aggregation features of each node are obtained, combined into a target node aggregation feature matrix, and then global summation pooling and linear transformation are performed to obtain the molecular graph features of the sample to be predicted, including: The reaction map of the sample to be predicted is input into the graph isomorphic neural network. After the embedding layer, the initial node feature matrix and the initial edge feature matrix are activated by the linear rectified function with leakage to obtain the node features and edge features of layer 0. Using a recursive neighborhood aggregation mechanism, based on the features of the nodes at layer 0, the features of each node and its neighboring nodes and connecting edges are aggregated to obtain the features of the nodes at layer 1. This iterative aggregation is repeated until the preset number of iterations is reached to obtain the aggregated features of the target nodes for each node. Based on the target node aggregation features of each node, a target node aggregation feature matrix is ​​formed, and global summation and pooling are performed to obtain graph-level feature vectors; A linear transformation is performed on the graph-level feature vectors to obtain the molecular graph features of the sample to be predicted.

6. The enzyme EC number prediction method according to claim 5, characterized in that, The response map of the sample to be predicted is input into a graph isomorphic neural network. After passing through the embedding layer, the initial node feature matrix and the initial edge feature matrix are activated by a leaky linear rectified function to obtain the zero-layer node features and zero-layer edge features, represented as: Node features at layer 0 , represented as: ; 0-layer edge features , represented as: ; in, and These are the learnable weight matrices for nodes and edges, respectively; This represents the set of nodes corresponding to the initial node feature matrix; This represents the total number of nodes in the node set; This represents the set of edges corresponding to the initial edge feature matrix. This represents the total number of edges in the edge set; and These are the bias terms for nodes and edges, respectively; The dimension of a graph isomorphic neural network model; The i-th node The node aggregation feature after the second update , represented as: ; in, , For nodes The set of neighboring nodes, and These are the nodes before and after the update. The feature representation vector, For the edge The feature representation vector; , , and This is the learnable parameter matrix.

7. The enzyme EC number prediction method according to claim 1, characterized in that, A bidirectional cross-attention mechanism is used to fuse the sample sequence features and molecular graph features of the sample to be predicted, thereby obtaining multimodal features, including: Using sample sequence features as queries and molecular graph features as keys and values, a cross-attention mechanism is used to extract features and obtain the first fusion feature. Using molecular graph features as queries and sample sequence features as keys and values, a cross-attention mechanism is used to extract features and obtain the second fusion feature. The first fusion feature and the second fusion feature are concatenated to obtain multimodal features.

8. The enzyme EC number prediction method according to claim 1, characterized in that, The process involves acquiring multimodal features, inputting them into a multilayer perceptron, and obtaining the predicted probability of the enzyme EC number of the sample to be predicted. This includes: inputting the multimodal features into the multilayer perceptron, sequentially passing them through layer normalization, linear operation, ReLU activation function, linear operation and Softmax activation function, and obtaining the predicted probability of the enzyme EC number of the sample to be predicted.

9. The enzyme EC number prediction method according to claim 1, characterized in that, Obtaining the target BERT model and the target graph isomorphic neural network includes: Multiple enzyme-catalyzed reaction samples containing substrate SMILES sequences, product SMILES sequences, and corresponding enzyme EC numbers were obtained and combined to form an enzyme-catalyzed reaction sample set. By using a pre-trained BERT model and an initial graph isomorphic neural network, the predicted probability of the enzyme EC number for each enzyme-catalyzed reaction sample is obtained. Based on the predicted probability and the actual number value of the enzyme EC number of each enzyme-catalyzed reaction sample, a cross-entropy loss function is constructed. The gradient descent optimization algorithm is used to train the pre-trained BERT model and the initial graph isomorphic neural network until the cross-entropy loss function converges, thus obtaining the target BERT model and the target graph isomorphic neural network.

10. The enzyme EC number prediction method according to claim 9, characterized in that, The pre-trained BERT model is obtained by training on a set of chemical reaction samples. The training process includes: Multiple chemical reaction samples containing substrate SMILES sequences and product SMILES sequences were obtained and combined to form a chemical reaction sample set; Using a masked language model, some words in a chemical reaction sample are randomly masked, and the initial BERT model is made to predict the masked words based on the context to obtain the predicted words. The initial BERT model is trained based on the cross-entropy loss between predicted words and actual masked words until the cross-entropy loss converges, thus obtaining a pre-trained BERT model.

Citation Information

Cited By

  • Enzyme function prediction method based on deep contrast learning

    CN122090963A

  • Complex peptide traceable structure coding method

    CN122201510A