Metagenome function annotation method and system based on heterogeneous graph network
By constructing a metagenomic heterogeneity map and combining a multi-head attention mechanism and a GIN encoder, the problems of coverage and accuracy in gene function annotation in existing technologies are solved, and high-precision gene function prediction is achieved.
Patent Information
- Application Number
- CN202511220994.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-29
- Publication Date
- 2025-12-05
AI Technical Summary
Existing metagenomic functional annotation methods are insufficient in mining gene features, making it difficult to fully reveal potential functional relationships between genes. Furthermore, they do not make full use of the overall structural information of the metagenomic genome, resulting in limited coverage and accuracy of functional annotation.
A metagene heterogeneity map is constructed, integrating contigs, sequences, and protein structures. Functional prediction is performed using a heterogeneity map network. Gene function classification is performed by combining multi-head attention mechanism and GIN encoder through differential message passing between contig nodes and gene nodes.
It significantly improves the coverage and accuracy of metagenomic functional annotation, making full use of the heterogeneous information in metagenomic data to achieve high-precision gene function prediction.
Smart Images

Figure CN121075426A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of biological information, and particularly relates to a metagenome function annotation method and system based on a heterogeneous graph network, which is used for function annotation of genes in a metagenome. BACKGROUND
[0002] A metagenome is a collection of genetic material from all microorganisms (including bacteria, viruses, archaea, and fungi) in a specific environment. These microbial communities form complex ecosystems that play an important role in maintaining environmental balance. Due to the limitations of traditional pure culture methods in studying complex microbial communities, metagenome analysis has become an effective means of studying microbial composition and function as a sequencing method without the need for isolation and culture. Among them, metagenome annotation is a key step aimed at identifying genes and predicting their functions, thereby revealing gene functions and metabolic pathways and helping to better understand the functional characteristics and ecological mechanisms of microbial communities.
[0003] Traditional metagenome function annotation mainly relies on homology or orthology alignment methods. Common practices are to use sequence alignment tools such as BLAST or DIAMOND to search for functional annotation information in existing databases, and to annotate genes as the most matching function in the database. However, this kind of method excessively relies on the existing prior knowledge in the database, and for sequences not included or missing in the database, it is often difficult to give effective functional annotation, and with the refinement of annotation granularity, the coverage of functional annotation will usually decrease significantly.
[0004] The rise of deep learning-based functional annotation methods has promoted the development of metagenome functional annotation research. This kind of method can mine the deep features of genes under relatively limited data conditions, thereby achieving a wider annotation coverage and providing more detailed annotation results. Generally, according to the different biological information used, the existing methods can be divided into: sequence-based models, protein structure-based models, and hybrid information models. Sequence-based models focus on learning effective feature representations from amino acid or nucleic acid sequences, however, many genes exhibit similar functions but different sequences, so it is difficult to distinguish them only by sequence information. Protein structure-based models usually treat proteins as a graph, where residues are treated as nodes, and node features are obtained through amino acid sequence pre-training models, and then graph neural network models are used to predict functions, however, for highly similar genes, this method still cannot make effective distinction. Hybrid information-based models have attempted to combine sequence and protein-protein interaction network information, treating protein-protein interaction networks as a graph, and each gene as a node, the features of which are extracted through amino acid sequence pre-training models and used as node embeddings, and finally, graph neural networks are used for function prediction, however, this kind of method still has the problem of insufficient information utilization, as it does not combine the more semantic information-rich protein three-dimensional structure.
[0005] In summary, the existing methods are insufficient in mining the characteristics of genes themselves and insufficient in utilizing the overall structure information of metagenome, which makes it difficult to fully reveal the potential functional correlation between genes, thereby limiting the coverage and accuracy of functional annotation. SUMMARY
[0006] In view of the deficiencies of the prior art, the technical problem to be solved by the present application is to provide a metagenome functional annotation method and system based on a heterogeneous graph network. The method mines and uses contig information in the metagenome in the metagenome functional annotation task, integrates contig, sequence, protein structure and gene into one, constructs a metagenome heterogeneous graph, and realizes high-precision prediction of metagenome function by using a differential message passing method.
[0007] The technical solution adopted by the present application to solve the technical problem is as follows:
[0008] In a first aspect, the present application provides a metagenome functional annotation method based on a heterogeneous graph network, which comprises the following contents:
[0009] Obtain human metagenome sequencing information and filter the data;
[0010] Construct a metagenome heterogeneous graph according to the internal information of the metagenome: express the composition of the metagenome as Set meta =(C,P), wherein C represents a contig set and P represents a gene set; model the two different entities of contig and gene as contig nodes and gene nodes respectively, and connect the contig nodes and the gene nodes through the belonging relationship, that is, if the gene node P i is located on the contig node C i , there will be a single-direction edge C i pointing to P i , and one contig node will connect multiple gene nodes; the relationship between the gene nodes is determined by sequence similarity, that is, if the sequence similarity between the gene node P i and the gene node P i is greater than a preset threshold, a non-directional edge is constructed between them; wherein the contig node features are represented by a k-mer frequency vector, and the gene node features are obtained by learning the features of the residue nodes output by the pre-trained model through a graph neural network;
[0011] If the contig node C i and the gene node P i have an edge The contig node feature is spliced to the gene node feature to obtain a gene node P i ;
[0012] The gene node after feature enhancement uses a multi-head attention mechanism to perform message passing between gene nodes to obtain a representation z' i ;
[0013] z' i is input into a classifier for gene function classification.
[0014] Further, the graph neural network adopts a GIN encoder, and a center loss is used to constrain the GIN encoder during the training process,
[0015]
[0016] where H i is a graph feature learned by the GIN encoder, and N represents the number of gene nodes. i represents a class center of a class to which the gene node P i belongs, and the initial value is a random vector.
[0017] Further, the class center of the class to which the gene node P i belongs is obtained by the following formula:
[0018]
[0019] where y i represents a class label of the gene node P i , n represents the number of genes under the same label, and N c represents the total number of classes.
[0020] Further, the aggregation process of the multi-head attention mechanism is as follows:
[0021] The attention coefficient calculation formula of the hth head between the gene node P i and the gene node P j is formula (6):
[0022]
[0023] where, represents the attention coefficient between the gene node P i and the gene node P j in the hth attention head; z i and zj representation of gene node P i and gene node P j characteristics after splicing contig characteristics respectively; σ is an activation function; ‖ is a splicing operation; represents the transpose of the learnable attention vector in the hth attention head; exp(·) is an exponential operation; represents the neighbor gene node set of gene node P i in the metagenome heterogeneous graph;
[0024] The message aggregation mechanism between gene nodes is represented by formula (7):
[0025]
[0026] wherein z' i represents the final learned representation of gene node P i , and M represents the number of attention heads.
[0027] In a second aspect, the present application provides a metagenome function annotation system based on a heterogeneous graph network, which comprises:
[0028] A metagenome acquisition and preprocessing module is configured to acquire metagenome sequencing information and perform data filtering to obtain a metagenome with appropriate length and no redundant sequences and low-value genes;
[0029] A metagenome heterogeneous graph is configured to construct a heterogeneous graph according to internal information of the metagenome with two different entities of contigs and genes, the heterogeneous graph having contig nodes and gene nodes, the contig nodes and the gene nodes being connected through an ownership relationship, and the gene nodes being connected through sequence similarity to determine whether there is an edge relationship;
[0030] A k-mer frequency vector calculation module is configured to calculate a k-mer frequency vector, the k-mer frequency vector representing contig node characteristics;
[0031] A gene node characteristic learning module is configured to calculate a residue contact map according to a protein structure of a gene node; to generate a residue node feature by using an amino acid sequence pre-training model ESM2; and to learn a graph embedding representation of the gene by using a graph neural network from the residue contact map and the residue node feature, as the final gene node feature of the gene;
[0032] A gene node characteristic enhancement module is configured to splice contig node characteristics to gene node characteristics to obtain an enhanced gene node P i if there is an edge between contig node C i and gene node P i ;
[0033] The message passing module uses a multi-head attention mechanism to perform message passing between gene nodes after feature enhancement, and obtains a representation z' that aggregates the information of the contig and all neighbor gene nodes in the metagenome heterogeneous graph i ;
[0034] The classification module is used for determining the gene function classification according to the representation output by the message passing module.
[0035] The loss calculation module uses a center loss and a cross-entropy loss to constrain the training process.
[0036] Further, the data filtering process is as follows:
[0037] (1) Length filtering: removing genes with an amino acid sequence length less than 80 or greater than 1022;
[0038] (2) Redundant sequence filtering: after length filtering, removing genes with highly similar amino acid sequences;
[0039] (3) Low-value gene filtering: removing genes with unknown functions or extremely low expression in the data set.
[0040] Compared with the prior art, the present application has the following beneficial effects:
[0041] 1. Breaking through the limitations of existing methods, comprehensively integrating metagenomic information. The present application fully utilizes the heterogeneous information naturally existing in metagenomic data, and innovatively models the contig-gene relationship and gene-gene similarity. This breaks through the limitations of existing methods that only rely on protein monomer information or insufficient information utilization, and significantly improves the adaptability and prediction performance of the model for metagenomic data by fusing local features at the protein level (referring to the amino acid sequence and protein structure of the gene) and global environmental information of the metagenome (referring to the relationship between contigs and genes, and genes and genes, i.e. two types of edges).
[0042] 2. Deep learning of gene features to achieve high-precision representation. The method based on mixed information usually uses amino acid sequence information and amino acid sequence pre-training models to directly obtain the feature embedding of the gene, often ignoring important structural information, while the present application comprehensively utilizes the information of amino acid sequence and protein structure, constructs a residue contact map from the protein structure, and obtains the residue features in the residue contact map through an amino acid sequence pre-training model, and then inputs them into a GIN encoder for gene node feature learning. Compared with the former, this method can more fully capture the deep semantic information contained in the sequence and structure, making the protein representation more accurate and complete, thereby providing high-quality input features for the downstream metagenomic function annotation task. BRIEF DESCRIPTION OF DRAWINGS
[0043] Figure 1 The overall flowchart of the present application is shown in the figure;
[0044] Figure 2 The structure diagram of the metagenome heterogeneous graph network model of the present application is shown in the figure; DETAILED DESCRIPTION
[0045] The specific embodiments are described below with reference to the accompanying drawings, which are only used to clearly and completely introduce the technical solutions of the present application, and do not limit the protection scope of the present application.
[0046] Example 1
[0047] The metagenome functional annotation method based on the heterogeneous graph network in this embodiment includes the following steps:
[0048] Step one: obtain public human metagenome sequencing information from the Mgnify database and filter the data. The specific process is as follows:
[0049] (1) Length filtering. Remove genes with amino acid sequence length less than 80 or greater than 1022. Short sequences are usually incomplete and difficult to provide effective functional features; long sequences not only significantly increase the computational overhead, but also may lead to decreased prediction accuracy.
[0050] (2) Redundant sequence filtering. After length filtering, there are still a large number of amino acid sequences with high similarity. These redundant genes usually have the same or similar functions in metagenome, and removing them can effectively reduce data redundancy and improve training efficiency. (3) Low-value gene filtering. Remove genes with unknown function or extremely low expression in the dataset. Since metagenome annotation aims to assign functional labels to genes, a large number of samples with no label or a small number of labeled genes have limited contribution to model training, and therefore need to be removed.
[0051] Step two: construct a metagenome heterogeneous graph according to the internal information of the metagenome.
[0052] The metagenome is composed of a large number of contigs and genes. The composition of the metagenome is represented as Set meta = (C, P), where C represents the contig set and P represents the gene set. Since contigs and genes are two different entities, they are modeled as contig nodes and gene nodes in the heterogeneous graph. Contig nodes and gene nodes are connected by membership relationship, i.e. if P i is located in C i , there will be a C i pointing to P icontig usually contains multiple genes, so a contig node will connect multiple gene nodes. The relationship between gene nodes is determined by sequence similarity, i.e. if the sequence similarity between gene nodes P i and P j is greater than a preset threshold, an undirected edge is constructed between them.
[0053] Step three: calculate the node features in the heterogeneous graph.
[0054] For different node types, the node features are initialized in different ways.
[0055] The contig node feature is represented by a k-mer frequency vector.
[0056] For gene nodes, the feature extraction process is more complex. A gene node feature learning module is introduced to effectively capture the intrinsic information of each gene. The processing process of the gene node feature learning module is as follows: first, a residue contact map is constructed according to the protein structure of the gene node; then, the residue node features are generated using the amino acid sequence pre-training model ESM2; finally, the graph embedding representation of the gene is learned through a graph neural network, which is used as the final gene node feature.
[0057] In this embodiment, the graph neural network is implemented using a graph isomorphism network (GIN) encoder, which has multiple layers of GIN and pooling operations. The graph embedding vector of each gene is obtained by pooling the encoded multiple layers of GIN, which is used as the initial feature representation of the gene, i.e. the gene node feature.
[0058] Step four: message passing.
[0059] Considering the existence of different types of nodes and edges in the heterogeneous graph, a differentiated message aggregation mechanism is adopted for different edge types, i.e. different message passing mechanisms are executed for different edge types.
[0060] Contig-gene relationship: since the genes on the same contig often have relevance in function, the feature splicing method can effectively fuse the contig node feature and the gene node feature;
[0061] Gene-gene relationship: an attention mechanism is introduced to calculate the attention coefficients based on the enhanced features of the genes spliced with contig node features, and the neighbor features are weighted and aggregated according to the learned attention coefficients, which improves the accuracy and robustness of information transmission. Finally, the fused node features are input into the classifier to realize the functional annotation of the metagenomic genes.
[0062] The information in the metagenome is abstracted into a heterogeneous graph, the composition of the heterogeneous graph, the node: contig, gene, and the edge: contig-gene, gene-gene. A one-way edge is constructed between contigs and genes in the heterogeneous graph, and the message passing uses the splicing method, which does not blur the semantic information of different nodes.
[0063] Step five, loss calculation
[0064] The loss function in the application is composed of two parts: one is the center loss, which is used to constrain the feature learning process of the gene node, so that the embedding vectors of genes in the same functional category in the feature space are more aggregated, thereby improving the intra-class compactness; the second is the cross-entropy loss, which is used to supervise the classification task, to ensure that the model can correctly distinguish different functional categories. The two are jointly optimized by weighted summation, to realize the synchronous improvement of feature representation quality and classification performance.
[0065] Embodiment 2
[0066] The embodiment of the application is based on a metagenome annotation system of a heterogeneous graph network, which comprises:
[0067] 1) Metagenome acquisition and preprocessing module: obtain public human metagenome sequencing information from Mgnify database and perform data filtering. Mgnify provides a large number of human metagenome sequences, but the original data often contains low-quality and redundant entries, so systematic filtering needs to be performed after downloading to ensure the quality of downstream modeling. The specific filtering process is as follows:
[0068] (1) Length filtering. First, filter the amino acid sequence by length, and remove protein sequences with a length less than 80 or greater than 1022—short sequences are usually incomplete, and long sequences can significantly increase the computational overhead and reduce the annotation accuracy;
[0069] (2) Redundant sequence filtering. Perform redundant clustering on the length-filtered sequences, and use the CD-HIT tool to remove highly similar sequence clusters to reduce data redundancy and reduce sample bias;
[0070] (3) Low-value gene filtering. Perform functional label annotation on the de-redundant gene sequences, and remove genes with no label and low functional expression. The application uses an annotation standard based on homologous protein clusters: use the DIAMOND tool to align the sequences to the COG2024 database to obtain authoritative and consistent homologous cluster functional annotations, thereby providing a high-quality labeled dataset for subsequent model training.
[0071] 2) Metagenome heterogeneous graph:
[0072] A metagenome is composed of many contigs and genes, and the composition of the metagenome can be represented as Set meta= (C, P), where C denotes the set of contigs, and P denotes the set of genes, the metagenome is constructed into a heterogeneous graph, in which there are two types of nodes: contig nodes and gene nodes, C i denotes the i-th contig node in the metagenome, P i denotes the i-th gene node in the metagenome. The contig nodes and the gene nodes are connected by the membership relation, that is, if P i is located in C i , then there is a directed edge from C i to P i .
[0073]
[0074] The edges between the gene nodes are undirected edges, which are connected according to the amino acid sequence similarity of the gene nodes, and the threshold is set to 0.5.
[0075]
[0076] For different node types, the present application performs different initialization feature methods.
[0077] 3) k-mer frequency vector calculation module:
[0078] The features of the contig nodes are represented by k-mer frequency vectors. For a given contig node C i and a positive integer k, the k-mer of C i is all the substrings of length k in C i . For any positive integer k, there are 4 k different substrings, and in a sequence of length d (d ≥ k), there can be at most min{4 k , d-k+1} unique substrings. For any fixed k, the k-mer distribution of the sequence can be represented as a frequency vector. In this embodiment, the features of the contig nodes are represented by 4-mer frequency vectors, and the i-th contig node feature is represented as The feature dimension is 1*256.
[0079] 4) Gene node feature learning module:
[0080] For the feature representation problem of gene nodes, the application uses amino acid sequence and protein structure information to propose a feature construction scheme based on graph embedding. Although the amino acid sequence pre-training model can extract rich sequence semantic information contained in the gene nodes, it lacks the representation ability of structure information, and the protein structure usually contains more rich functional and spatial information. In order to obtain the protein structure information, the application uses the efficient and fast protein structure prediction tool ESM-Fold to predict the three-dimensional structure of the target protein and obtain its spatial coordinate data. Then, according to the predicted protein spatial structure, a residue contact graph is constructed: each amino acid residue is regarded as a node, if the Euclidean distance between the center carbon atoms C α of two residues is less than a set threshold , an edge is created between the corresponding two residue nodes, and the edge weight is 1 by default, and the adjacency matrix of the gene node P i is represented as
[0081] The features of the residue nodes are obtained by using the pre-training model ESM2 to extract the features of the residue nodes, and the output is the residue-level feature matrix of the gene. The residue-level feature matrix of the gene node P i can be represented as , wherein N represents the number of residues in the gene node P i , the number of residues in a gene is equal to the number of amino acids and the length of the amino acid sequence; and 640 is the fixed dimension output by the pre-training model ESM2.
[0082] The graph representation of the gene node P i is In order to learn and extract more expressive features of the gene from the graph, the application uses a GIN encoder to learn protein-level features, the GIN encoder includes a multilayer perceptron for updating the features of the residue nodes, a message passing mechanism for capturing neighborhood information, and a pooling concatenation layer. Its aggregation function ensures that different graph structures produce unique embeddings. The update rule of the lth layer GIN is defined as:
[0083]
[0084] , wherein represents the feature of the vth residue node of the lth layer, represents the neighbor node set of the residue node v, and MLP l represents the lth nonlinear layer. In order to obtain a comprehensive graph-level representation, the node features of all message passing layers of the GIN are pooled and concatenated to obtain the graph embedding vector of the gene node, that is, the graph feature H i learned by the GIN encoder: i
[0085]
[0086] The mean pooling operation is used here in the embodiment, denotes the gene node P i The length of the amino acid sequence, l denotes the number of GIN layers of the GIN encoder, and the final feature aggregates the residual node features to generate the representation of the entire gene node graph. Concat(·) denotes the concatenation operation, which concatenates the feature vectors of each layer. H i denotes the gene P i The final learned graph embedding is a vector that integrates the entire protein structure and sequence information.
[0087] There are two different types of nodes in the metagenomic heterogeneous graph: contig nodes C i and gene nodes P i , and and two different edge relationships, and the traditional message aggregation mechanism of graph neural networks is easy to cause semantic confusion between different node types. The present application performs message aggregation for different node types and edge relationships.
[0088] 5) Gene node feature enhancement module:
[0089] For the edge between the contig node C i and the gene node P i Considering that the functions of genes on a contig tend to be of the same category, and the contig node features and gene node features are two types of semantic information, a concatenation strategy is used to obtain the enhanced feature z i of the gene node:
[0090]
[0091] where H i is the graph feature learned by the GIN encoder for the gene node P i , and is the frequency vector feature of the contig node C i .
[0092] 6) Message passing module: After feature enhancement, the gene node uses a multi-head attention mechanism to pass messages between gene nodes, and finally obtains a representation z' i that aggregates the information of the contig and all neighboring gene nodes in the metagenomic heterogeneous graph. Specifically:
[0093] For the edge between the gene node P i and the gene node P j The present application adopts multi-head attention mechanism to aggregate information. The hth head is calculated as follows: i and the attention coefficient between gene nodes P j is calculated as follows:
[0094]
[0095] wherein, represents the attention coefficient between gene nodes P i and P j in the hth attention head, z i and z j represent the representation of gene nodes P i and P j after concatenating the gene node features and contig node features, σ represents an activation function, and || is a concatenation operation. represents the transpose of the learnable attention vector in the hth attention head, and exp(·) is an exponential operation. represents the set of neighbor gene nodes of gene node P i in the metagenomic heterogeneous graph.
[0096] After calculating the attention coefficients between gene nodes, the message aggregation mechanism between gene nodes is as follows:
[0097]
[0098] wherein, z' i represents the final learned representation of gene node P i , which aggregates the information of the contig and all neighbor genes in the metagenomic heterogeneous graph. M represents the number of attention heads, and the operation of taking the mean is used for different attention heads.
[0099] 7) Classification module, finally z' i is input into the classifier for functional classification task.
[0100] The above-mentioned metagenomic heterogeneous graph, gene node feature learning module, gene node feature enhancement module, message passing module, and classification module jointly constitute the metagenomic heterogeneous graph network model. During model training, a center loss is introduced to constrain the GIN encoder, which can make the representations of similar genes more similar and the model training more stable. At the same time, the metagenomic heterogeneous graph network model uses a cross-entropy loss function to guide the classification. The total loss function can be represented as:
[0101]
[0102] wherein, is a constant used to control the weight of cross-entropy loss;
[0103]
[0104] In formula (11), y i represents the class label of the gene node P i , n represents the number of genes under the same label, N c represents the total number of classes, represents the class center of the class to which the gene node P i belongs, and the initial value is a random vector. In formula (9), ||. represents the square of the 2-norm of a matrix or a vector. In formula (10), y ij is a sign function, which is 1 if the class of the gene node P i is y j , and 0 otherwise. q ij is the probability that the model predicts that the gene node P i belongs to the class y j , and N represents the number of gene nodes.
[0105] Example 3
[0106] The macrogenomic function annotation task is actually a classification task, that is, to predict the function of the genes in the macrogenome. In order to verify the effectiveness of the method of the present application, the present application uses the macrogenomic data in the Mgnify database to compare between models, and the statistics of the data used and the data set division are shown in Table 1.
[0107] Table 1 Statistics and division of macrogenomic data set
[0108]
[0109] In order to highlight the advantages and innovations of the present application, the present application is compared with sequence-based models: DeepGOCNN, DeepFam, protein structure-based models: DeepFRI, Struct2GO, and hybrid information models: HNetGO, and the four evaluation indexes of Accuracy, Precision, Recall and F1-score are used for model evaluation.
[0110] Table 2 Performance of models on macrogenomic data set
[0111]
[0112] As can be seen from Table 2, compared with the sequence-based model and the structure-based model, the model proposed in the application achieves excellent performance in the four evaluation indicators on the metagenomic dataset, and compared with the suboptimal model Struct2GO, the accuracy, precision, recall and F1-score of the functional annotation of the application are respectively 11.17%, 10.22%, 11.75% and 8.56% higher, which shows that the application has excellent performance in metagenomic functional annotation. The performance of the model based only on sequence information (such as DeepGOCNN, DeepFam) on the four indicators is obviously low, and the main reason is that the amino acid sequence has certain conservatism in the evolution process, and it is difficult to capture the implicit high-level structure relationship between sequences and the functional association across genes by simply relying on sequence information for modeling, thereby limiting the generalization ability and prediction accuracy of the model. The model based on protein structure information (such as DeepFRI, Struct2GO) has a significant improvement in performance compared with the pure sequence model, but still does not reach a high prediction accuracy, which is due to the limited coverage of protein structure data, especially in metagenomic data, a large number of sequences lack high-quality structure information; at the same time, a single structure feature cannot comprehensively reflect the functional role of the protein in the metagenomic ecosystem, resulting in limited prediction effect. The mixed information model HNetGO combines sequence features and protein interaction information, thereby improving the comprehensiveness and accuracy of functional prediction to some extent, however, its adaptability to metagenomic data still has deficiencies, the main reason is that the structure information of the gene itself is not fully considered. In contrast, the metagenomic heterogeneous graph network model of the application not only integrates sequence and structure information, but also regards the metagenome as a whole as a heterogeneous information network, and integrates the relationship between contigs and genes and the similarity relationship between genes from a global perspective, which not only effectively alleviates the performance bottleneck caused by conservatism in single information source prediction, but also significantly improves the richness of feature expression and the modeling ability of the model for complex relationships, and finally achieves significant performance improvement in the classification task.
[0113] The design of introducing various biological priori knowledge (including sequence, structure, metagenomic topological relationship, etc.) in the model of the application is reasonable and effective, and at the same time, it also shows that different types of priori information have complementarity in the functional prediction task.
[0114] The unmentioned part of the application is applicable to the prior art.
Claims
1. A method for functional annotation of metagenome based on heterogeneous graph network, characterized in that, The annotation method comprises the following contents: Obtaining human metagenomic sequencing information and performing data filtering; According to the macro gene internal information, a macro genome heterogeneous graph is constructed: the composition of the macro genome is expressed as Set meta =(C,P), where C represents a contig set and P represents a gene set; two different entities of contig and gene are respectively modeled as contig nodes and gene nodes, and the contig nodes and the gene nodes are connected through the belonging relationship, that is, if the gene node P i is located on the contig node C i , there will be a one-way edge C i pointing to P i , and one contig node is connected to multiple gene nodes; the sequence similarity between the gene nodes is used to determine whether there is an edge relationship, that is, if the sequence similarity between the gene node P i and the gene node P j is greater than a preset threshold, an undirected edge is constructed between the two; wherein the contig node features are represented by a k-mer frequency vector, and the gene node features are learned by a graph neural network through the residue contact map of the protein structure and the features of the residue nodes output by the pre-trained model; If contig node C i and gene node P i The edges between Then, the contig node features are concatenated to the gene node features to obtain the feature-enhanced gene node P. i ; After the feature enhancement, the gene node uses multi-head attention mechanism to carry out message passing between the gene nodes, and obtains the representation z' which aggregates the information of the contig and all neighbor gene nodes in the metagenome heterogeneous graph i ; z' is the z-score of the gene i Input into a classifier for gene function classification.
2. The annotation method of claim 1, wherein, The graph neural network adopts a GIN encoder, and a center loss is adopted in a training process to constrain the GIN encoder where H i is the gene node P i graph features learned by the GIN encoder, and N denotes the number of gene nodes. is the gene node P i the class center of the belonging class, which is initialized as a random vector.
3. The annotation method of claim 1, wherein, Gene node P i Class center of the class By the following formula: wherein y i represents the class label of the gene node P i , n represents the number of genes under the same label, and N c represents the total number of classes.
4. The annotation method of claim 1, wherein, The aggregation process of the multi-head attention mechanism is that the hth head calculates the attention coefficient between the gene node P i and the gene node P j according to formula (6): wherein, represents the attention coefficient between gene node P i and gene node P j ; z i and z j represents the representation of gene node P i and gene node P j after respectively concatenating contig features; σ is an activation function; ‖ is a concatenation operation; represents the transpose of the learnable attention vector in the hth attention head; exp(·) is an exponential operation; represents the set of neighbor gene nodes of gene node P i in the metagenomic heterogeneous graph; The message aggregation mechanism between gene nodes is represented by formula (7): where z i represents the gene node P i the final learned representation, M represents the number of attention heads.
5. A metagenome functional annotation system based on a heterogeneous graph network, characterized by, The system comprises: A metagenome acquisition and preprocessing module, configured to obtain metagenomic sequencing information and perform data filtering to obtain metagenome of suitable length and non-redundant sequences and low-value genes; A metagenome heterogeneous graph, configured to construct a heterogeneous graph according to internal information of the metagenome, the heterogeneous graph having contig nodes and gene nodes, the contig nodes and the gene nodes being connected through an affiliation relationship, and the gene nodes being connected through sequence similarity to determine whether there is an edge relationship between the gene nodes; A k-mer frequency vector calculation module, configured to calculate a k-mer frequency vector, the k-mer frequency vector representing a contig node feature; A gene node feature learning module, configured to calculate a residue contact map according to a protein structure of the gene node, to generate a feature of a residue node by using an amino acid sequence pre-training model ESM2, and to learn a graph embedding representation of the gene by using a graph neural network based on the residue contact map and the feature of the residue node, as a final gene node feature; If contig node C i and gene node P i have edge between them, then contig node features are spliced to gene node features to obtain gene node P i with enhanced features. The message passing module uses a multi-head attention mechanism to pass messages between gene nodes after feature enhancement, obtaining a representation z' that aggregates information from the contig and all neighboring gene nodes in the metagenomic heterogeneity graph. i ; A classification module, configured to determine a gene function classification according to a representation output by the message passing module; A loss calculation module, configured to constrain a training process by using a center loss and a cross-entropy loss.
6. The annotation system of claim 5, wherein, The data filtering process is as follows: (1) Length filtering: removing genes with an amino acid sequence length less than 80 or greater than 1022; (2) Redundant sequence filtering: removing genes with highly similar amino acid sequences after length filtering; (3) Low-value gene filtering: removing genes with unknown functions or extremely low expression in the data set.