Bacterial phenotype prediction method based on bacterial DNA

By constructing a heterogeneous graph and performing semantic training and multi-level aggregation, the problem of low efficiency in traditional bacterial resistance prediction is solved, achieving more efficient and accurate bacterial resistance prediction.

CN120412723BActive Publication Date: 2025-12-02SHANGHAI JIAOTONG UNIV SCHOOL OF MEDICINE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510551592.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-12-02
Estimated Expiration
2045-04-29

AI Technical Summary

Technical Problem

Traditional methods for predicting bacterial resistance are inefficient, time-consuming, and cannot effectively predict bacterial resistance.

Method used

A heterogeneous graph is constructed, and mutation semantic embedding information is generated through semantic training. After multi-level aggregation processing, it is input into the drug resistance prediction model, and drug resistance is predicted by utilizing the semantic information and correlation between mutations.

Benefits of technology

It improves the accuracy and efficiency of bacterial resistance prediction, can more accurately represent the similarity and correlation between mutations, and enhances the interpretability of prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120412723B_ABST
    Figure CN120412723B_ABST
Patent Text Reader

Abstract

This application relates to a method, apparatus, computer device, computer-readable storage medium, and computer program product for bacterial phenotypic prediction based on bacterial DNA, which can be used in the field of bioinformatics. The method includes: constructing a heterogeneous graph; the heterogeneous graph includes nodes and the connections between nodes; performing semantic training processing on mutation embedding information based on the heterogeneous graph to obtain mutation semantic embedding information of the mutation embedding information; determining the target mutation semantic embedding information corresponding to the mutation information in the input sample based on the mutation semantic embedding information; performing aggregation processing on the target mutation semantic embedding information to obtain aggregated feature information of the target mutation semantic embedding information; inputting the aggregated feature information into a preset drug resistance prediction model for drug resistance prediction processing to obtain the drug resistance prediction result of the input sample against anti-tuberculosis drugs. This method can improve the efficiency of drug resistance prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of bioinformatics, and in particular to a method, apparatus, computer device, computer-readable storage medium, and computer program product for predicting bacterial phenotypes based on bacterial DNA. Background Technology

[0002] With the rapid development of gene sequencing technology, obtaining bacterial genome data has become much more convenient. Based on a large amount of bacterial genome data, researchers have begun to explore how to predict bacterial phenotypic characteristics from DNA sequence information. Among these, bacterial drug resistance prediction, as an important branch of bacterial phenotypic prediction, is of great significance for clinical treatment and public health control. Therefore, how to efficiently predict bacterial drug resistance has become an important research direction.

[0003] Traditional techniques typically predict bacterial resistance through laboratory culture and drug susceptibility testing; however, this method requires a long experimental time, resulting in low efficiency in resistance prediction. Summary of the Invention

[0004] Therefore, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium, and computer program product based on bacterial DNA for predicting bacterial phenotypes, which can improve the efficiency of drug resistance prediction, in order to address the above-mentioned technical problems.

[0005] Firstly, this application provides a method for predicting bacterial phenotypes based on bacterial DNA. The method includes:

[0006] Construct a heterogeneous graph; the heterogeneous graph includes nodes and the connections between the nodes; the nodes include mutation nodes, location nodes, gene nodes, mutation type nodes, and strain nodes; the connections represent the semantic relationships between the nodes;

[0007] Based on the heterogeneous graph, semantic training processing is performed on the mutation embedding information to obtain the mutation semantic embedding information of the mutation embedding information.

[0008] Based on the mutation semantic embedding information, determine the target mutation semantic embedding information corresponding to the mutation information in the input sample;

[0009] The target mutation semantic embedding information is aggregated to obtain aggregated feature information of the target mutation semantic embedding information;

[0010] The aggregated feature information is input into a preset drug resistance prediction model for drug resistance prediction processing to obtain the drug resistance prediction results of the input sample against tuberculosis drugs.

[0011] In one embodiment, the aggregation processing of the target mutation semantic embedding information to obtain aggregated feature information of the target mutation semantic embedding information includes:

[0012] The target mutation semantic embedding information is subjected to multi-level aggregation processing to obtain the multi-level aggregated features of the target mutation semantic embedding information;

[0013] The multi-level aggregation features are used as the aggregation feature information.

[0014] In one embodiment, the multi-level aggregation processing of the target mutation semantic embedding information to obtain the multi-level aggregated features of the target mutation semantic embedding information includes:

[0015] Early aggregation processing is performed on the target mutation semantic embedding information to obtain the first aggregated feature of the target mutation semantic embedding information;

[0016] The first aggregation feature is subjected to intermediate aggregation processing to obtain the multi-level aggregation feature.

[0017] In one embodiment, the early aggregation processing of the target mutation semantic embedding information to obtain a first aggregated feature of the target mutation semantic embedding information includes:

[0018] The target mutation semantic embedding information is aggregated by embedding pooling to obtain the first aggregated feature;

[0019] The intermediate aggregation process of the first aggregation feature to obtain the multi-level aggregation feature includes:

[0020] The first aggregated feature is aggregated using a preset encoder to obtain the multi-level aggregated feature.

[0021] In one embodiment, after inputting the aggregated feature information into a preset drug resistance prediction model for drug resistance prediction processing to obtain the drug resistance prediction result of the input sample against tuberculosis drugs, the method further includes:

[0022] Based on the contribution of the target mutation semantic embedding information to the drug resistance prediction result, the key mutation information corresponding to the drug resistance prediction result is determined;

[0023] Based on the key mutation information, interpretive information for the drug resistance prediction results is generated.

[0024] In one embodiment, the step of inputting the aggregated feature information into a preset drug resistance prediction model for drug resistance prediction processing to obtain the drug resistance prediction result of the input sample against tuberculosis drugs includes:

[0025] The aggregated feature information is input into the drug resistance prediction model for drug resistance prediction processing to obtain the predicted value of the input sample's resistance to the anti-tuberculosis drug;

[0026] Based on the predicted value and the preset threshold, the drug resistance classification result of the input sample is determined as the drug resistance prediction result.

[0027] Secondly, this application also provides a bacterial phenotype prediction device based on bacterial DNA. The device includes:

[0028] A node construction module is used to construct a heterogeneous graph; the heterogeneous graph includes nodes and the connection relationships between the nodes; the nodes include mutation nodes, location nodes, gene nodes, mutation type nodes, and strain nodes; the connection relationships represent the semantic relationships between the nodes;

[0029] The information processing module is used to perform semantic training processing on the mutation embedding information based on the heterogeneous graph to obtain the mutation semantic embedding information of the mutation embedding information;

[0030] The information determination module is used to determine the target mutation semantic embedding information corresponding to the mutation information in the input sample based on the mutation semantic embedding information.

[0031] The information aggregation module is used to aggregate the target mutation semantic embedding information to obtain aggregated feature information of the target mutation semantic embedding information;

[0032] The information input module is used to input the aggregated feature information into a preset drug resistance prediction model for drug resistance prediction processing, so as to obtain the drug resistance prediction result of the input sample against tuberculosis drugs.

[0033] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0034] Construct a heterogeneous graph; the heterogeneous graph includes nodes and the connections between the nodes; the nodes include mutation nodes, location nodes, gene nodes, mutation type nodes, and strain nodes; the connections represent the semantic relationships between the nodes;

[0035] Based on the heterogeneous graph, semantic training processing is performed on the mutation embedding information to obtain the mutation semantic embedding information of the mutation embedding information.

[0036] Based on the mutation semantic embedding information, determine the target mutation semantic embedding information corresponding to the mutation information in the input sample;

[0037] The target mutation semantic embedding information is aggregated to obtain aggregated feature information of the target mutation semantic embedding information;

[0038] The aggregated feature information is input into a preset drug resistance prediction model for drug resistance prediction processing to obtain the drug resistance prediction results of the input sample against tuberculosis drugs.

[0039] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0040] Construct a heterogeneous graph; the heterogeneous graph includes nodes and the connections between the nodes; the nodes include mutation nodes, location nodes, gene nodes, mutation type nodes, and strain nodes; the connections represent the semantic relationships between the nodes;

[0041] Based on the heterogeneous graph, semantic training processing is performed on the mutation embedding information to obtain the mutation semantic embedding information of the mutation embedding information.

[0042] Based on the mutation semantic embedding information, determine the target mutation semantic embedding information corresponding to the mutation information in the input sample;

[0043] The target mutation semantic embedding information is aggregated to obtain aggregated feature information of the target mutation semantic embedding information;

[0044] The aggregated feature information is input into a preset drug resistance prediction model for drug resistance prediction processing to obtain the drug resistance prediction results of the input sample against tuberculosis drugs.

[0045] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0046] Construct a heterogeneous graph; the heterogeneous graph includes nodes and the connections between the nodes; the nodes include mutation nodes, location nodes, gene nodes, mutation type nodes, and strain nodes; the connections represent the semantic relationships between the nodes;

[0047] Based on the heterogeneous graph, semantic training processing is performed on the mutation embedding information to obtain the mutation semantic embedding information of the mutation embedding information.

[0048] Based on the mutation semantic embedding information, determine the target mutation semantic embedding information corresponding to the mutation information in the input sample;

[0049] The target mutation semantic embedding information is aggregated to obtain aggregated feature information of the target mutation semantic embedding information;

[0050] The aggregated feature information is input into a preset drug resistance prediction model for drug resistance prediction processing to obtain the drug resistance prediction results of the input sample against tuberculosis drugs.

[0051] The aforementioned bacterial phenotype prediction method, apparatus, computer equipment, computer-readable storage medium, and computer program product based on bacterial DNA construct a heterogeneous graph. The heterogeneous graph includes nodes and the connections between them. The nodes include mutation nodes, location nodes, gene nodes, mutation type nodes, and strain nodes. The connections represent the semantic relationships between the nodes. Based on the heterogeneous graph, semantic training processing is performed on the mutation embedding information to obtain mutation semantic embedding information. Based on the mutation semantic embedding information, target mutation semantic embedding information corresponding to the mutation information in the input sample is determined. The target mutation semantic embedding information is aggregated to obtain aggregated feature information. The aggregated feature information is input into a preset drug resistance prediction model for drug resistance prediction processing to obtain the drug resistance prediction result of the input sample against tuberculosis drugs. This scheme effectively captures the semantic relationships between nodes by constructing a heterogeneous graph containing mutation nodes, location nodes, gene nodes, mutation type nodes, and strain nodes, overcoming the limitation of existing technologies that treat each mutation as an independent feature. Through semantic training based on the heterogeneous graph, mutation embeddings containing rich semantic information are generated, thereby more accurately representing the similarity and correlation between mutations. Aggregation processing is used to integrate the semantic embedding information of the target mutation into representative features, effectively utilizing the interaction information between mutations. Finally, the aggregated features are input into a pre-set drug resistance prediction model, which can fully utilize the semantic information and correlation of mutations, thereby effectively improving the accuracy and efficiency of drug resistance prediction. Attached Figure Description

[0052] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0053] Figure 1 This is a flowchart illustrating a bacterial phenotype prediction method based on bacterial DNA in one embodiment.

[0054] Figure 2 This is a flowchart illustrating the steps of the aggregation process in one embodiment;

[0055] Figure 3 This is a schematic diagram of the model structure in one embodiment;

[0056] Figure 4 This is a structural block diagram of a bacterial phenotype prediction device based on bacterial DNA in one embodiment;

[0057] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0058] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0059] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0060] In one exemplary embodiment, such as Figure 1 As shown, a bacterial phenotype prediction method based on bacterial DNA is provided. This embodiment illustrates the application of this method to a terminal. It is understood that this method can also be applied to a server, or to a system including both a terminal and a server, and is implemented through interaction between the terminal and the server. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, etc.; the server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. In this embodiment, the method includes the following steps:

[0061] Step S101: Construct a heterogeneous graph; the heterogeneous graph includes nodes and the connections between nodes; the nodes include mutation nodes, location nodes, gene nodes, mutation type nodes and strain nodes; the connections represent the semantic relationships between nodes.

[0062] Step S102: Based on the heterogeneous graph, perform semantic training processing on the mutation embedding information to obtain the mutation semantic embedding information.

[0063] Step S103: Determine the target mutation semantic embedding information corresponding to the mutation information in the input sample based on the mutation semantic embedding information.

[0064] Step S104: Aggregate the target mutation semantic embedding information to obtain aggregated feature information of the target mutation semantic embedding information.

[0065] Step S105: Input the aggregated feature information into the preset drug resistance prediction model for drug resistance prediction processing to obtain the drug resistance prediction results of the input sample against tuberculosis drugs.

[0066] Among them, bacterial phenotype can be a characteristic or property of bacteria, such as bacterial drug resistance.

[0067] DNA stands for deoxyribonucleic acid, and a gene is a nucleotide sequence in a DNA molecule that contains specific genetic information.

[0068] Heterogeneous graphs can be a graph structure containing various types of nodes and edges to represent complex relational networks. For example, heterogeneous graphs can include five types of nodes (mutation nodes, location nodes, gene nodes, mutation type nodes, and strain nodes) and four types of edges (mutation-location, mutation-gene, mutation-synonym / non-synonym, and mutation-strain).

[0069] In a heterogeneous graph, a node can be a basic building block representing a specific entity or object. For example, a node can be a mutation node, a location node, a gene node, a mutation type node, or a strain node.

[0070] Here, a mutation node can be a node that represents a mutation observed in the target gene. For example, a mutation node can be a specific gene mutation named katG_S315T, katG_S315N, embB_L262L, etc.

[0071] In this context, a position node can be a node that represents the specific genetic location of the mutation within a gene. For example, a position node can represent the specific site of the mutation within a gene.

[0072] In this context, a gene node can be a node representing a specific target gene in Mycobacterium tuberculosis. For example, a gene node could be a specific gene in Mycobacterium tuberculosis such as embB, katG, or embA (gene name).

[0073] Among them, mutation type nodes can be nodes that represent the type of nucleotide change in the coding region, including synonymous mutation nodes and nonsynonymous mutation nodes. For example, mutation type nodes can be synonymous mutation nodes or nonsynonymous mutation nodes.

[0074] In this context, a strain node can be a node representing a bacterial strain sample in the dataset. For example, a strain node can be a bacterial isolate or a sample.

[0075] In this context, connectivity can represent the associations or connection methods between different nodes in a heterogeneous graph. For example, connectivity can be mutation-location relationship, mutation-gene relationship, mutation-synonymous / non-synonymous relationship, or mutation-strain relationship.

[0076] Semantic relationships can represent the connections between nodes, reflecting their biological or functional interactions. For example, semantic relationships can be relationships between mutations on the same gene, or between mutations at the same site.

[0077] Mutation embedding information can be a data representation of mutations as a low-dimensional continuous vector space, used to capture the semantic relationships between mutations. For example, mutation embedding information can be a mutation vector representation learned from a heterogeneous graph using the metapath2vec algorithm.

[0078] Semantic training can be a process of training semantic embeddings of mutations based on heterogeneous graph structures to better represent the semantic information of mutations. For example, semantic training can use the metapath2vec algorithm, which optimizes the embedding space by bringing similar nodes (positive sample pairs) closer together and pushing dissimilar nodes (negative sample pairs) further apart.

[0079] The mutation semantic embedding information can be the mutation embedding information after semantic training, which contains the semantic information of the mutation. For example, the mutation semantic embedding information can be a learned vector representation containing mutation attributes (such as gene, site, and other features).

[0080] The input sample can be bacteria, such as a Mycobacterium tuberculosis sample or a drug-resistant tuberculosis sample that needs to be predicted for drug resistance. For example, the input sample can be a Mycobacterium tuberculosis strain containing a specific set of mutations.

[0081] The mutation information can be gene mutation data contained in the input sample. For example, the mutation information can be gene mutations such as katG_S315T and embB_G406A in the input sample.

[0082] The target mutation semantic embedding information can be the mutation semantic embedding information corresponding to the mutation information in the input sample, determined based on the mutation semantic embedding information. For example, the target mutation semantic embedding information can be the semantic embedding vector corresponding to a specific mutation (such as katG_S315T) in the input sample.

[0083] Aggregation processing can be a process of summarizing or integrating the semantic embedding information of the target mutation. For example, aggregation processing can be an early aggregation of mutation embeddings using embedding pooling, and / or an intermediate aggregation using a Transformer (a type of encoder) architecture as an intermediate aggregator.

[0084] In this context, aggregated feature information can be feature information obtained after aggregation processing, representing the comprehensive features of all mutations in the input sample. For example, aggregated feature information can be the overall feature representation of the sample obtained by aggregation through embedding pooling methods or the Transformer architecture.

[0085] The drug resistance prediction model can be a model used to predict the resistance of Mycobacterium tuberculosis to anti-tuberculosis drugs. For example, the drug resistance prediction model can be a multilayer perceptron (MLP) head or other classifiers used to map aggregated feature information to drug resistance prediction results.

[0086] In this context, drug resistance prediction processing can be the process of inputting aggregated feature information into a pre-defined drug resistance prediction model for prediction. For example, drug resistance prediction processing can be the process of inputting aggregated feature information into a multilayer sensing head for classification.

[0087] The drug resistance prediction result can be the model's prediction of the input sample's resistance to a specific anti-tuberculosis drug. For example, the drug resistance prediction result can be "Resistant" or "Susceptible," indicating whether the input sample is resistant to a specific anti-tuberculosis drug.

[0088] Alternatively, the terminal can predict drug resistance in drug-resistant tuberculosis bacteria by constructing a heterogeneous graph. In this process, the terminal first constructs a heterogeneous graph containing various node types and node connections. Nodes in the heterogeneous graph can include mutation nodes (such as specific gene mutations like katG_S315T, katG_S315N, and embB_L262L), location nodes (such as embA_262 and katG_315, representing specific sites of mutations in genes), gene nodes (such as specific genes in Mycobacterium tuberculosis like embB, katG, and embA), mutation type nodes (including synonymous mutation nodes and non-synonymous mutation nodes, representing mutations that do not change amino acids and mutations that change amino acids, respectively), and strain nodes (representing bacterial isolates or samples in the dataset). Connections include four types of edges: mutation-position, mutation-gene, mutation-synonymous / non-synonymous, and mutation-isolate. These connections represent the semantic relationships between different nodes. Subsequently, the terminal uses the metapath2vec algorithm to perform semantic training on the mutation embedding information based on the constructed heterogeneous graph. By bringing similar nodes (positive sample pairs) closer together and pushing dissimilar nodes (negative sample pairs) further apart, the embedding space is optimized to obtain mutation semantic embedding information containing mutation semantic information. Next, based on the obtained mutation semantic embedding information, the terminal determines the target mutation semantic embedding information corresponding to the mutation information (such as katG_S315T, embB_G406A gene mutations) contained in the input sample (such as Mycobacterium tuberculosis samples for drug resistance prediction). Then, the terminal performs aggregation processing on the target mutation semantic embedding information, which can be performed using embedding pooling for early aggregation and / or using the Transformer architecture as an intermediate aggregator for mid-term aggregation, to obtain aggregated feature information representing the overall features of the input sample. Finally, the terminal inputs the aggregated feature information into a preset drug resistance prediction model (such as a multilayer sensing head or other classifier) ​​for drug resistance prediction processing, and obtains the drug resistance prediction results (such as drug resistance or susceptibility) of the input sample against anti-tuberculosis drugs (such as rifampin, isoniazid, ethambutol, etc.).

[0089] In the aforementioned bacterial phenotype prediction method based on bacterial DNA, a heterogeneous graph is constructed. The heterogeneous graph includes nodes and connections between nodes. Nodes include mutation nodes, location nodes, gene nodes, mutation type nodes, and strain nodes. Connections represent semantic relationships between nodes. Based on the heterogeneous graph, semantic training processing is performed on the mutation embedding information to obtain mutation semantic embedding information. Based on the mutation semantic embedding information, the target mutation semantic embedding information corresponding to the mutation information in the input sample is determined. The target mutation semantic embedding information is aggregated to obtain aggregated feature information. The aggregated feature information is input into a preset drug resistance prediction model for drug resistance prediction processing to obtain the drug resistance prediction result of the input sample against tuberculosis drugs. This scheme effectively captures the semantic relationships between nodes by constructing a heterogeneous graph containing mutation nodes, location nodes, gene nodes, mutation type nodes, and strain nodes, overcoming the limitation of existing technologies that treat each mutation as an independent feature. Through semantic training based on the heterogeneous graph, mutation embeddings containing rich semantic information are generated, thereby more accurately representing the similarity and correlation between mutations. Aggregation processing is used to integrate the semantic embedding information of the target mutation into representative features, effectively utilizing the interaction information between mutations. Finally, the aggregated features are input into a pre-set drug resistance prediction model, which can fully utilize the semantic information and correlation of mutations, thereby effectively improving the accuracy and efficiency of drug resistance prediction.

[0090] In one exemplary embodiment, reference is made to Figure 2 The semantic embedding information of the target mutation is aggregated to obtain aggregated feature information of the semantic embedding information of the target mutation, which specifically includes the following:

[0091] Step S201: Perform multi-level aggregation processing on the target mutation semantic embedding information to obtain the multi-level aggregated features of the target mutation semantic embedding information;

[0092] Step S202: Use the multi-level aggregated features as aggregated feature information.

[0093] Multi-level aggregation processing can involve performing multi-level, multi-stage aggregation operations on the semantic embedding information of the target mutation to better capture the semantic relationships and interactions between mutations. For example, multi-level aggregation processing can include early aggregation (aggregating mutation embeddings using embedding pooling) and mid-level aggregation (using the Transformer architecture as an intermediate aggregator).

[0094] Among them, multi-level aggregated features can be feature information obtained after multi-level aggregated processing, which includes a comprehensive representation of mutation semantic information after multiple levels of aggregation. For example, multi-level aggregated features can be feature representations obtained by early aggregation through embedding pooling methods (such as summation pooling, average pooling, max pooling) and mid-term aggregation through the Transformer architecture.

[0095] Early aggregation can be the first aggregation stage in a multi-level aggregation process, using simple and efficient embedding pooling methods to aggregate mutation embeddings. For example, early aggregation can use methods such as sum pooling, mean pooling, or max pooling to integrate the semantic embedding information of multiple mutations into a unified feature representation.

[0096] Intermediate aggregation can be the second aggregation stage in a multi-level aggregation process, employing a more complex Transformer architecture as the aggregator to enhance the model's ability to capture semantic relationships between mutations. For example, intermediate aggregation can use a Transformer encoder that includes components such as self-attention layers, layer normalization, and feedforward networks to model the relationships between mutations through an attention mechanism.

[0097] Embedding pooling (embedding pooling method) is a technique for aggregating embedded vectors to reduce data dimensionality and extract key features. For example, embedding pooling methods can include summation pooling (adding all embedded vectors), average pooling (calculating the average of all embedded vectors), and max pooling (selecting the maximum value in each dimension).

[0098] Optionally, the terminal can employ a multi-level aggregation process when aggregating the semantic embedding information of the target mutation. Specifically, the terminal first performs early aggregation on the semantic embedding information of the target mutation, using embedding pooling to aggregate all mutation semantic embedding information in the input sample. This embedding pooling method can include sum pooling, mean pooling, or max pooling. Next, the terminal performs middle aggregation on the results of the early aggregation. Specifically, the terminal uses a Transformer architecture as an intermediate aggregator. This Transformer architecture includes components such as a self-attention layer, layer normalization, and a feedforward network. By modeling the relationships between mutations through the self-attention mechanism, the model's ability to capture mutation semantic relationships is enhanced, and higher interpretability is provided. Finally, the terminal combines the multi-level aggregated features obtained from the early and middle aggregation processes as the aggregated feature information of the semantic embedding information of the target mutation, which is used for subsequent drug resistance prediction.

[0099] The technical solution provided in this embodiment performs multi-level aggregation processing on the semantic embedding information of the target mutation. At the same time, it utilizes the simple and efficient characteristics of early aggregation and the complex relationship modeling capability of mid-term aggregation, which is conducive to comprehensively capturing the semantic relationships and interactions between mutations from different levels. This enhances the model's ability to perceive the combined effects of mutations, thereby providing richer and more expressive feature representations and improving the accuracy and interpretability of drug resistance prediction.

[0100] In an exemplary embodiment, multi-level aggregation processing is performed on the target mutation semantic embedding information to obtain multi-level aggregated features of the target mutation semantic embedding information. Specifically, this includes: performing early aggregation processing on the target mutation semantic embedding information to obtain a first aggregated feature of the target mutation semantic embedding information; and performing mid-term aggregation processing on the first aggregated feature to obtain multi-level aggregated features.

[0101] Early aggregation processing can be the first stage in a multi-level aggregation process, used to perform preliminary aggregation of the target mutation semantic embedding information. For example, early aggregation processing can be the process of aggregating all mutation semantic embedding information in the input sample using embedding pooling methods (such as summation pooling, average pooling, or max pooling).

[0102] The first aggregated feature can be the feature information obtained after early aggregated processing, which is the preliminary aggregated result of the target mutation semantic embedding information.

[0103] Intermediate aggregation processing can be a step that further processes the first aggregation features to better capture the semantic relationships and interactions between mutations.

[0104] Optionally, when the terminal performs multi-level aggregation processing on the target mutation semantic embedding information, it can adopt a two-stage processing method, namely early aggregation processing and mid-term aggregation processing, so as to achieve multi-level fusion of mutation semantic information. Specifically, the terminal first performs early aggregation processing on the target mutation semantic embedding information, that is, it uses an embedding pooling method to aggregate all mutation semantic embedding vectors in the input sample. This pooling method can be one of sum pooling, mean pooling, or max pooling. In this simple and efficient way, the terminal integrates multiple mutation semantic embedding vectors into a first aggregated feature. Then, the terminal performs intermediate aggregation processing on the first aggregated feature, that is, it uses a Transformer architecture as an intermediate aggregator. The Transformer architecture includes components such as a self-attention layer, layer normalization, and feed forward network. Through the self-attention mechanism, it models the relationship between different mutations, enhances the model's ability to capture mutation semantic relationships, and provides higher interpretability, resulting in richer and more in-depth multi-level aggregated features. Finally, the terminal uses the multi-level aggregated features as aggregated feature information.

[0105] The technical solution provided in this embodiment divides the aggregation process into two stages: early aggregation and mid-stage aggregation. This allows for the simultaneous use of a simple and efficient embedding pooling method to initially integrate mutation information, and the adoption of a Transformer architecture with a self-attention mechanism to capture deeper relationships. This improves the richness of feature representation and enables the model to capture mutation combination effects more accurately.

[0106] In an exemplary embodiment, early aggregation processing is performed on the target mutation semantic embedding information to obtain a first aggregated feature of the target mutation semantic embedding information. Specifically, this includes: performing aggregation processing on the target mutation semantic embedding information through embedding pooling to obtain a first aggregated feature; and performing mid-term aggregation processing on the first aggregated feature to obtain a multi-level aggregated feature. Specifically, this includes: performing aggregation processing on the first aggregated feature through a preset encoder to obtain a multi-level aggregated feature.

[0107] The preset encoder can be a pre-defined encoder architecture used for intermediate aggregation processing of the first aggregated features. For example, the preset encoder can be a Transformer encoder, which includes components such as a self-attention layer, layer normalization, and feed forward network, and can model the relationship between mutations through the self-attention mechanism.

[0108] Optionally, when performing multi-level aggregation processing, the terminal can use specific aggregation techniques to implement early aggregation processing and mid-stage aggregation processing respectively. Specifically, the terminal first performs early aggregation processing on the semantic embedding information of the target mutation through embedding pooling. This embedding pooling method includes one of three methods: sum pooling, mean pooling, or max pooling. For example, the terminal can use sum pooling to simply add all the semantic embedding vectors of mutations in the input sample to form a unified vector representation as the first aggregated feature. This method has low computational cost and high efficiency. Then, the terminal performs intermediate aggregation processing on the first aggregated feature through a preset encoder. This preset encoder is a Transformer encoder, which includes core components such as a self-attention layer, layer normalization, and a feedforward network. The terminal models the relationship between different mutations through the self-attention mechanism in the Transformer encoder, and can calculate attention weights for different mutations to identify the key mutations that contribute the most to the prediction results. At the same time, the Transformer encoder performs nonlinear transformation on the first aggregated feature through layer normalization and the feedforward network to generate multi-level aggregated features containing more complex relationship information.

[0109] The technical solution provided in this embodiment combines early aggregation processing using embedded pooling methods (such as summation pooling, average pooling, or max pooling) with mid-term aggregation processing using a preset encoder (such as Transformer). This approach helps to accurately capture the complex semantic relationships between mutations while maintaining efficiency, thereby facilitating the construction of expressive multi-level aggregated feature representations and significantly improving the interpretability and prediction accuracy of subsequent models.

[0110] In an exemplary embodiment, after inputting the aggregated feature information into a preset drug resistance prediction model for drug resistance prediction processing to obtain the drug resistance prediction result of the input sample against tuberculosis drugs, the following steps are also included: determining the key mutation information corresponding to the drug resistance prediction result based on the degree of contribution of the target mutation semantic embedding information to the drug resistance prediction result; and generating explanatory information of the drug resistance prediction result based on the key mutation information.

[0111] The contribution level can be considered as the strength or weight of the target mutation semantic embedding information on the drug resistance prediction result, representing the importance of a certain mutation to the final prediction result. For example, the contribution level can be calculated through the self-attention weights in the Transformer encoder. For example, for isoniazid (INH) resistance prediction, the contribution level of the katG_S315T (mutation name) mutation can be as high as 70%, while for ethambutol (EMB) resistance prediction, the contribution level of the embA_C-12T (mutation name) mutation is about 20%.

[0112] Key mutation information can be mutation data that has a decisive impact on the drug resistance prediction results, and is a set of mutations with a high degree of contribution. For example, key mutation information can be a set of mutations selected by the system according to their degree of contribution, such as katG_S315T contributing the most to the prediction of isoniazid (INH) resistance, and embA_C-12T contributing the most to the prediction of ethambutol (EMB) resistance.

[0113] The explanatory information can be text, data, or visualizations that provide evidence and explanation for the drug resistance prediction results, enhancing the interpretability and credibility of the model. For example, the explanatory information can include detailed descriptions of key mutations, numerical displays of their contribution, correlation analyses between mutations, and evidence support based on medical literature, helping clinicians understand the mechanisms behind the prediction results.

[0114] Optionally, after inputting the aggregated feature information into a preset drug resistance prediction model to obtain the drug resistance prediction results for the input sample against tuberculosis drugs, the terminal can further improve the interpretability and clinical application value of the model. Specifically, the terminal first determines the key mutation information corresponding to the drug resistance prediction results based on the contribution of the target mutation semantic embedding information to the drug resistance prediction results. This contribution calculation is based on the self-attention mechanism in the Transformer encoder, which quantifies the influence of each mutation on the final prediction result by analyzing the weights obtained by different mutations in the attention layer. Then, based on the determined key mutation information, the terminal generates explanatory information for the drug resistance prediction results. This explanatory information includes a detailed description of the key mutations, a numerical display of the contribution of each mutation, a correlation analysis between mutations, and evidence support based on medical literature, presented in the form of visual charts or text, enabling clinicians to understand the mechanism behind the prediction results.

[0115] The technical solution provided in this embodiment determines key mutation information by analyzing the contribution of target mutation semantic embedding information to drug resistance prediction results, and generates explanatory information based on this. This helps to reveal the decision-making logic and mechanism behind the model prediction, thereby improving the interpretability and credibility of the prediction results.

[0116] In an exemplary embodiment, aggregated feature information is input into a preset drug resistance prediction model for drug resistance prediction processing to obtain the drug resistance prediction result of the input sample against tuberculosis drugs. Specifically, this includes the following: inputting aggregated feature information into a drug resistance prediction model for drug resistance prediction processing to obtain a predicted value of the input sample's drug resistance against tuberculosis drugs; and determining the drug resistance classification result of the input sample based on the predicted value and a preset threshold, which is used as the drug resistance prediction result.

[0117] The predicted value can refer to the probability or score of an input sample developing resistance to anti-tuberculosis drugs, indicating the likelihood of the input sample exhibiting resistance. For example, the predicted value can be a value between 0 and 1 calculated by a pre-defined resistance prediction model. For instance, for isoniazid (INH) resistance prediction, the predicted value for a sample could be 0.99, indicating that the model is highly confident that the sample is resistant to INH.

[0118] The preset threshold can be a critical value used to convert the predicted value into a drug resistance classification result. It is used to determine whether the input sample has drug resistance by comparing it with the predicted value. For example, the preset threshold can be 0.5. When the predicted value is greater than 0.5, the sample is judged to be drug resistant; otherwise, it is judged to be susceptible.

[0119] The drug resistance classification result can be the final judgment on whether the input sample has developed resistance to anti-tuberculosis drugs, and it can be a binary classification result. For example, the drug resistance classification result can be one of two categories: drug-resistant or susceptible.

[0120] Optionally, the terminal directly inputs the obtained aggregated feature information into the drug resistance prediction model, which can be a deep neural network or a Transformer model structure with a multilayer perceptron (MLP) head classification head. After processing the aggregated feature information, the prediction model outputs a prediction value between 0 and 1, which represents the probability of the input sample developing drug resistance to anti-tuberculosis drugs. Subsequently, the terminal determines the final drug resistance classification result of the input sample by comparing the obtained prediction value with a preset threshold. When the prediction value is greater than the preset threshold, the terminal determines the input sample as drug resistant; otherwise, it determines it as susceptible.

[0121] The technical solution provided in this embodiment obtains predicted values ​​by inputting aggregated feature information into a preset drug resistance prediction model, and determines the drug resistance classification results by combining preset thresholds. This facilitates the transition from model output probability values ​​to actual clinical decisions, thereby providing more definitive diagnostic results in practical application scenarios.

[0122] The following application example illustrates the bacterial phenotype prediction method based on bacterial DNA provided in this application. This application example demonstrates the application of this method to a terminal.

[0123] This technical solution belongs to the field of tuberculosis (TB) diagnosis and treatment, specifically focusing on technological innovation in drug susceptibility testing (DST). TB is a disease with an extremely high mortality rate worldwide. With the increasing prevalence of antimicrobial resistance (AMR), TB treatment faces severe challenges. Mycobacterium tuberculosis (MTB) is the main pathogen of TB, and its drug resistance is a particularly prominent issue. Rapid and accurate drug susceptibility testing is crucial for the diagnosis and treatment of TB patients.

[0124] Currently, the gold standard for drug susceptibility testing is based on bacterial culture methods, which, while accurate, are time-consuming, taking up to six weeks and failing to meet the need for timely treatment. Rapid molecular detection technologies (such as the Mycobacterium tuberculosis / rifampicin resistance detection system) provide rapid results by detecting specific mutations in the Mycobacterium tuberculosis genome, but they cannot cover complex resistance mechanisms and unknown genomic variations, resulting in limited accuracy. In recent years, the reduction in the cost of whole-genome sequencing (WGS) has opened up new possibilities for drug susceptibility testing. By analyzing sequencing data and combining it with advanced algorithms, drug resistance can be predicted more accurately.

[0125] Currently, drug susceptibility prediction methods based on whole-genome sequencing data predict phenotypic drug resistance by analyzing mutations (such as single nucleotide polymorphisms, SNPs) in the Mycobacterium tuberculosis genome. If any mutation in a Mycobacterium tuberculosis isolate matches a drug-resistant mutation listed in the World Health Organization's catalogue, and these mutations have been identified as drug resistance markers, the isolate is predicted to be drug-resistant; otherwise, it is classified as susceptible. However, many mutations cannot be easily classified as drug-resistant or susceptible (e.g., the nature of some mutations remains uncertain based on existing evidence). Furthermore, this one-to-one association between mutations and drug resistance is insufficient for drug resistance prediction, especially for drugs that have been studied less extensively.

[0126] The main problems with existing technologies include:

[0127] 1. Ignoring genomic background: Existing methods treat each mutation as an independent feature without considering the location of the mutation in the genome and its association with other mutations.

[0128] 2. Lack of semantic relationship modeling: Semantic relationships between mutations (such as mutations in the same gene or at the same location may have similar drug resistance effects) are not effectively captured.

[0129] 3. Insufficient interpretability: Many deep learning models lack interpretability for their predictions and cannot provide specific mechanisms by which mutations affect drug resistance.

[0130] These issues limit the clinical application of existing technologies, particularly in terms of accuracy and reliability when dealing with complex drug resistance mechanisms and unknown genomic variations.

[0131] This technical solution proposes an antimicrobial resistance prediction model based on semantic mutation embedding (AIRFRAME), the core invention points of which include:

[0132] 1. Construct a heterogeneous graph to represent mutations and their attributes: Represent mutations and their related attributes as nodes in a graph, and capture the semantic relationships between mutations through the graph structure.

[0133] 2. Pre-trained mutation semantic embedding: The semantic embedding of mutations is trained based on graph structure to better represent the semantic information of mutations.

[0134] 3. Multi-level aggregation method: Early aggregation: Employs embedding pooling to aggregate mutation embeddings, a simple and efficient method. Mid-stage aggregation: Employs the Transformer architecture as an intermediate aggregator to enhance the model's ability to capture mutation semantic relationships and provide higher interpretability.

[0135] 4. The model's built-in architecture provides better interpretability for drug resistance prediction results, which is beneficial for finding characteristic patterns or target combinations at the gene and mutation levels related to drug resistance.

[0136] The model consists of three parts: (1) constructing a heterogeneous graph; (2) pre-training mutation embedding representations; and (3) aggregated embedding representations and classification.

[0137] refer to Figure 3 , Figure 3 The model's three main components are demonstrated: constructing a heterogeneous graph, pre-training mutant embedding representations, and aggregated embedding representations and classification, including:

[0138] Gene: The diagram shows specific genes such as embA and katG;

[0139] Nonsynonymous mutations.

[0140] katG_S315T (a mutation of serine at position 315 of the katG gene to threonine).

[0141] katG_S315N (a mutation at serine position 315 of the katG gene to asparagine).

[0142] Sample;

[0143] Synonymous mutations;

[0144] Synonymous or Nonsynonymous;

[0145] embA_L262L (the leucine at position 262 of the embA gene is mutated to leucine).

[0146] Bacteria Isolates

[0147] Mutations;

[0148] Position (location / mutation site);

[0149] embA_262 (position 262 of the embA gene);

[0150] katG_315 (position 315 of the katG gene);

[0151] Encode Node to embedding (vector);

[0152] Distance Function: δ

[0153] Positive: I+ (positive sample: I+);

[0154] Minimize δ(Ia, I+) (Minimize the distance between anchored samples and positive samples);

[0155] Anchor: Ia (anchor sample: Ia);

[0156] Maximize δ(Ia, I-) (Maximize the distance between anchored samples and negative samples);

[0157] Negative: I- (Negative sample: I-);

[0158] Initialize Embedding;

[0159] Class (category);

[0160] Resistant (drug resistance);

[0161] Susceptible;

[0162] MLP Head (Multi-Layer Sensor Head);

[0163] Multihead;

[0164] Feed Forward (Feedforward Network)

[0165] Layer Normalization;

[0166] Transformer Encoder (Transformer encoder);

[0167] Linear layer;

[0168] Concat (layer concatenation);

[0169] Self-attention Layer

[0170] Query (query vector);

[0171] Key (key vector);

[0172] Value (numerical vector);

[0173] W Query (Query weight matrix);

[0174] W Key (Key weight matrix);

[0175] W Value (Value weight matrix);

[0176] [CLS] (Classification Embedding Vector);

[0177] [CLS]: classification embedding;

[0178] Embedding Layer

[0179] Sample Input

[0180] katG_S315T (a mutation of serine at position 315 of the katG gene to threonine).

[0181] embA_L262L (the leucine at position 262 of the embA gene is mutated to leucine).

[0182] katG_S315N (a mutation at serine position 315 of the katG gene to asparagine).

[0183] Embeddings (embedded vectors).

[0184] The detailed steps are as follows:

[0185] (1) Constructing a heterogeneous graph:

[0186] When constructing the heterogeneous graph, five types of nodes and four types of edges were defined. Node types include mutations, positions (specific locations of genomic bases), genes, synonyms / non-synonyms (indicating whether nucleotide changes alter amino acids), and isolates (samples). The four types of edges are: mutation-position, mutation-gene, mutation-synonym / non-synonym, and mutation-isolate. Embedding pre-training is an unsupervised training process and does not include phenotypic information.

[0187] The following provides a detailed description of each type of node:

[0188] Mutation: Each node represents a mutation observed in the target gene.

[0189] Position: Each position node represents the specific genetic location of the mutation in the gene.

[0190] Gene: Each node corresponds to a specific target gene in Mycobacterium tuberculosis. This study contains a total of 23 gene nodes. A gene node connects to all mutation nodes present in that gene.

[0191] Synonymous / Non-synonymous mutations: Changes in nucleotides in the coding region can lead to synonymous mutations (which do not change amino acids) or non-synonymous mutations (which change amino acids).

[0192] Isolate: Each node represents a bacterial strain sample in the dataset. If a strain contains a specific mutation, the strain node will be connected to the corresponding mutation node to capture the co-occurrence information of the mutation.

[0193] (2) Pre-trained mutation embedding representation:

[0194] This algorithm optimizes the embedding space by bringing similar nodes (positive sample pairs) closer together and pushing dissimilar nodes (negative sample pairs) further apart. In a heterogeneous graph G=(V,E), the node type is T. v The edge type is T E A metapath P is defined as a sequence of node types connected by a specific edge type, denoted as P = (T1, T2, ..., T...). l ), where T i ⊂T vAnd each consecutive pair of (T) i T i+1 ) corresponds to T E One type of edge in the graph. A meta-path-guided random walk traverses the graph, generating a sequence of nodes (v1, v2, ..., v) based on the pattern of P. l These sequences encode structural information of the graph, thereby facilitating the embedding process. Table 1 lists the specific meta-paths designed for mutation embedding. The algorithm then utilizes a skip-gram model to optimize the probability of predicting the context of a given node.

[0195] Table 1 (Metapath used in pre-trained mutation embedding vectors)

[0196]

[0197] Among them, MetaPath; Mut; Position; Gene; Syno; Isolate; Description; Genetic position of mutations; Genes where mutations occur; Synonymous or other mutation categories; Coexistence of mutations in isolates.

[0198] (3) Aggregate embedding characterization and classification:

[0199] To represent an isolate by mutation, a pooling method is used to aggregate the embeddings of individual mutations. Given a mutation label t i Its embedding is represented as E[t] iSeveral pooling techniques were considered to combine these embeddings, including sum pooling, mean pooling, and max pooling. The resulting pooled embeddings represent a segregator. Then, two classifiers were used: (1) a fully connected binary neural network (NN) classifier, which outputs probabilities via a sigmoid (activation function). The model was trained using binary cross-entropy loss. (2) BERT (Bidirectional Encoder Representations from Transformers, pre-trained natural language processing model) was used as the classifier for the backbone model. For binary classification tasks, BERT was extended with a classification head. The input to BERT consists of a series of labels, usually starting with the [CLS] (classification embedding vector) label, which serves as an aggregate representation of the entire sequence. BERT processes the input sequence and generates a context-sensitive representation for each label. The output corresponding to the [CLS] label is denoted as h. cls Used for task classification. Hidden state h cls Logits (logistic regression) are calculated through a simple feedforward layer, and the predicted probabilities for the classification task are output through a sigmoid activation function. Two methods using different classifiers are named ARIFRAME-NN and AIRFRAME-BERT (two antimicrobial resistance prediction models based on semantic mutation embedding).

[0200] Overall, the technical effects can be summarized as follows: (1) Combining heterogeneous graph embedding technology with the Transformer method for the antimicrobial drug resistance prediction task improves the performance index of drug resistance prediction. In addition, the model is transferable and applicable to the prediction of other antimicrobial drug resistance. (2) Capturing mutation semantic information: Through heterogeneous graphs and semantic embedding, the semantic relationships between mutations are effectively captured, improving the prediction accuracy. (3) High interpretability: The model can identify specific mutations related to drug resistance and provide individualized prediction results, enhancing its application value in clinical practice. Through the above innovations, the model solves the shortcomings of existing technologies in mutation semantic modeling, genomic background capture and interpretability, providing a more accurate and practical solution for tuberculosis drug resistance prediction.

[0201] For quantitative results, two rounds of 10-fold cross-validation were performed, dividing the dataset into 20 parts. In each part, 80% of the data was allocated to the training set, 10% to the validation set, and 10% to the test set. The model was trained on the training set, hyperparameters were optimized using the validation set, and performance was evaluated on the test set. Hyperparameter tuning was performed using Bayesian optimization, initially with 10 random search iterations followed by 5 additional iterations, aimed at optimizing the AUROC (Area Under the Receiver Operating Characteristic) score on the validation set. The prediction threshold was selected by maximizing the sensitivity + specificity - 1 value on the validation set. The statistical significance of performance differences across different data splits was evaluated using a two-tailed p-value.

[0202] Model performance was evaluated using several key metrics: sensitivity, specificity, F1 score, AUROC, AUPRC (area under the precision-recall curve), and MCC (Matthews correlation coefficient), each providing a different perspective. Sensitivity and specificity are key metrics for clinical DST (drug sensitivity testing) methods, while AUROC is the primary metric used to compare binary classification models. The following summarizes the AUROC results of different models across multiple drugs. AUROC provides a comprehensive performance measure across all thresholds. Compared to the baseline NN (neural network) model, AIRFRAME-BERT (a BERT-based variant of the AIRFRAME model) showed statistically significant improvements on 3 out of 11 drugs (p<0.05). In particular, AIRFRAME-BERT improved performance by 2.2% on PZA, 0.8% on SM, and 0.5% on EMB. The AIRFRAME-NN model demonstrated greater improvement, achieving statistically significant gains on 7 out of 11 drugs, including a 0.4% improvement in RIF, a 0.9% improvement in EMB, a 1.7% improvement in PZA, a 0.9% improvement in SM, a 2.0% improvement in AK, a 1.8% improvement in KAN, and a 1.3% improvement in MOX. Compared to other leading models, AIRFRAME-NN (a neural network-based variant of the AIRFRAME model) achieved the highest mean AUROC on 4 drugs, with improvements of 0.6% in EMB, 1.0% in PZA, 0.6% in SM, and 1.3% in MOX (p<0.05). AIRFRAME-BERT improved PZA by 1.5% compared to the second-best model (p<0.05). Although these improvements seem small, they are particularly significant given that baseline performance already exceeded 95%. For other drugs, no statistically significant differences were observed (p≥0.05), indicating that the model performance in this application example was comparable to the baseline. Among them, Drug is a drug; DeepAMR (deep antimicrobial resistance) is one of the contrasting models, a deep drug resistance prediction model; WDNN (wide and deep neural network) is another contrasting model, a wide + deep neural network; and CNNGWP (Convolutional neural network for Genome-WidePrediction) is a third contrasting model, a convolutional neural network gene prediction model.The four first-line drugs are rifampicin (RIF), isoniazid (INH), ethambutol (EMB), pyrazinamide (PZA), streptomycin (SM), ofloxacin (OFX), capreomycin (CAP), amikacin (AK), kanamycin (KAN), moxifloxacin (MOX), and ciprofloxacin (CIP). The explanation is as follows: Four first-line drugs: rifampicin (RIF), isoniazid (INH), ethambutol (EMB), and pyrazinamide (PZA); and seven second-line drugs: streptomycin (SM), ofloxacin (OFX), capreomycin (CAP), amikacin (AK), kanamycin (KAN), moxifloxacin (MOX), and ciprofloxacin (CIP).

[0203] F1 scores of different models on multiple drugs: Compared with the baseline NN model, AIRFRAME-BERT showed statistically significant improvements on 8 out of 11 drugs (p<0.05). Specifically, AIRFRAME-BERT improved the F1 score by 1.1% on RIF, 1.2% on INH, 3.8% on PZA, 1.2% on SM, 5.0% on OFX, 9.3% on CAP, 6.5% on AK, and 6.1% on MOX. Similarly, AIRFRAME-NN showed significant improvements on 3 drugs, with F1 scores improving by 1.5% (EMB), 2.5% (PZA), and 2.7% (AK), respectively. Compared to other top-performing models, AIRFRAME-BERT achieved the highest average F1 score across nine drugs, with significant improvements including a 0.8% increase in RIF, a 0.8% increase in INH, a 1.0% increase in EMB, a 1.9% increase in PZA, a 1.0% increase in SM, a 3.1% increase in OFX, a 3.4% increase in CAP, a 1.3% increase in AK, and a 4.4% increase in MOX (p<0.05). AIRFRAME-NN also showed significant improvements on two drugs, a 0.9% increase in EMB and a 1.7% increase in MOX. Although these improvements may seem small, given the already strong baseline performance of the model, these enhancements demonstrate the continued performance improvement across multiple drugs in this application example.

[0204] Qualitative results include: (1) overall feature ranking; (2) interpretability of individual sample features; (3) visualization of mutation embeddings; and (4) ablation experiments.

[0205] (1) Overall Feature Ranking: Among the top-ranked mutations identified from the trained BERT model: First, the robustness of the model was assessed by determining whether the top-ranked mutations were consistent with existing research findings. Second, given the model's excellent performance on certain drugs according to specific evaluation metrics, the identified features provide a focused subset of mutations for further research into potential drug resistance associations. These feature importance scores are derived from the attention mechanism between various mutations and classification markers in the BERT model, which uses a single-layer Transformer encoder. In studies of all identified drug resistance-related mutations: First, most of the top-ranked mutations have been confirmed to be associated with drug resistance, demonstrating the interpretability and robustness of the model in this application example. Second, for drugs with sufficient sample size, the most significant mutations are often concentrated in one or two specific genes. This observation is consistent with the co-occurrence of drug resistance, i.e., resistance to one drug (such as INH) is often associated with resistance to another drug (such as RIF). Notably, the major mutation katG_S315T leading to INH resistance was not found in most other drugs, and most of the extracted mutations were associated with genes previously linked to resistance. This result stems from the fact that the pre-trained mutation embeddings included mutation attributes, particularly gene and site features, thereby reducing the impact of resistance co-occurrence.

[0206] (2) Interpretability of Individual Sample Features: In one example where the model predicted resistance to EMB, the Transformer encoder layer identified the mutation embA_C-12T as the most important feature, contributing approximately 20% of the predictions, followed by embB_G406A and other mutations. The uncalibrated model ultimately yielded a resistance probability of approximately 0.94, indicating that the model was highly confident that the sample was resistant to EMB. In another sample predicted to be resistant to INH, the BERT model considered the mutation katG_S315T as the primary feature, accounting for approximately 70% of the model's decision. The predicted output was 0.99, indicating that the model was highly confident that the sample was resistant to INH. By showing these key mutations to clinicians, the model can help develop more informed treatment plans. Furthermore, this approach provides the possibility of designing interactive systems where clinicians can exclude certain irrelevant mutations and rerun the predictions to optimize the analysis.

[0207] (3) Visualization of mutation embeddings: Mutations are typically clustered based on their associated genes, as gene information is one of the four attributes included in the embedding. As expected, mutations occurring at the same site exhibit more similar embeddings. This visualization confirms that the pre-trained mutation embeddings effectively capture the expected information and structure. The results show that the hidden outputs generated by BERT can be broadly categorized into drug resistance and susceptibility, with only a few samples being misclassified. These misclassifications warrant further investigation to potentially improve the model's performance.

[0208] (4) Ablation Experiments: In the ablation study, different pre-trained embedding configurations of AIRFRAME-BERT and embedding pooling strategies of AIRFRAME-NN were evaluated. AIRFRAME-BERT (unpre-trained) refers to a model where the BERT embedding layers are not initialized using pre-trained mutant embeddings. AIRFRAME-BERT (unfrozen) allows the embedding layers to be fine-tuned during training, while AIRFRAME-BERT (frozen) uses the standard settings, i.e., the embedding layers are fixed. For the AIRFRAME-NN variant, max pooling and average pooling strategies were tested to compare with the standard summation pooling method. For the AIRFRAME-BERT model, AIRFRAME-BERT (frozen) showed a statistically significant improvement in AUROC score compared to AIRFRAME-BERT (unpre-trained) (p<0.05), with EMB improving by 0.3%, PZA by 1.2%, and SM by 0.6%. In terms of F1 scores, AIRFRAME-BERT (frozen) also outperformed AIRFRAME-BERT (unpre-trained) on RIF (1.0% improvement), INH (1.0% improvement), PZA (5.7% improvement), and SM (1.3% improvement). No statistically significant differences were observed for other drugs, indicating that AIRFRAME-BERT (frozen) performed comparably to AIRFRAME-BERT (unpre-trained) on most drugs. These results highlight the advantages of using pre-trained mutant embeddings, suggesting that performance improvements do not solely stem from more complex network architectures. When comparing AIRFRAME-BERT (frozen) with AIRFRAME-BERT (unfrozen), only one statistically significant result was found: AIRFRAME-BERT (unfrozen) improved the F1 score of KAN by 3.1%. Overall, the two models performed similarly on other drugs, indicating that freezing the embeddings did not significantly impact performance in this context. Regarding embedding pooling strategies, AIRFRAME-NN (summation) and AIRFRAME-NN (average) achieved the highest AUROC and F1 scores. Statistically significant differences were observed on AUROC (p<0.05). AIRFRAME-NN (sum) outperformed AIRFRAME-NN (maximum) in PZA (0.2% improvement) and MOX (1.7% improvement), while AIRFRAME-NN (sum) outperformed AIRFRAME-NN (mean) in MOX (1.1% improvement). However, AIRFRAME-NN (mean) slightly outperformed AIRFRAME-NN (sum) in SM (0.2% decrease). Regarding F1 scores, AIRFRAME-NN (sum) significantly outperformed AIRFRAME-NN (maximum) in MOX (4.9% improvement), with no other significant differences.These results indicate that summation pooling and average pooling are slightly better than max pooling, while there is no significant difference between summation pooling and average pooling.

[0209] The terms are explained below:

[0210] Mutation: A heritable variation in the genome, usually referring to a change in the DNA sequence, which may lead to changes in protein function.

[0211] Embedding: A technique that maps high-dimensional data (such as words or mutations) to a low-dimensional continuous vector space to capture semantic relationships between data.

[0212] Heterogeneous Graph: A graph structure containing multiple types of nodes and edges, used to represent complex relational networks.

[0213] Transformer: A deep learning model based on self-attention mechanism, widely used in natural language processing and other sequence modeling tasks.

[0214] Attention mechanism: a technique used to capture the relationships between different parts of input data, often used in Transformer models.

[0215] AUROC (Area Under the Receiver Operating Characteristic Curve): The area under the receiver operating characteristic curve is used to evaluate the performance of a binary classification model across all thresholds.

[0216] F1 Score: The harmonic mean of precision and recall, used to evaluate the balanced performance of a classification model.

[0217] t-SNE (t-Distributed Stochastic Neighbor Embedding): A dimensionality reduction technique used to visualize high-dimensional data in two- or three-dimensional space while preserving the local relationships between data points.

[0218] PCA (Principal Component Analysis): A dimensionality reduction technique that projects high-dimensional data into a low-dimensional space through linear transformation, preserving the main variance of the data.

[0219] Ablation Study: By removing or modifying certain components of a model, the impact on overall performance is evaluated to understand the importance of each component.

[0220] Pooling: An operation used to reduce the dimensionality of data. Common methods include max pooling, average pooling, and summation pooling.

[0221] Pre-training: Before training a model on a specific task, it is first trained on a large amount of data to learn a general feature representation.

[0222] Fine-tuning: Based on the pre-trained model, further training is performed for a specific task to optimize the model performance.

[0223] Drug resistance: Pathogens (such as bacteria and viruses) develop resistance to drugs, leading to reduced or ineffective drug efficacy.

[0224] Gene: A segment of DNA sequence that encodes a specific functional protein or RNA; it is the basic unit of genetic information.

[0225] Locus: A specific location on a chromosome where a gene is located, often used to describe where a mutation occurs.

[0226] Co-occurrence: The phenomenon that two or more events or features appear simultaneously in the same dataset.

[0227] The technical solution provided in this application example effectively captures the semantic relationships between nodes by constructing a heterogeneous graph containing mutation nodes, location nodes, gene nodes, mutation type nodes, and strain nodes, thus overcoming the limitation of existing technologies that treat each mutation as an independent feature. Through semantic training based on the heterogeneous graph, mutation embeddings containing rich semantic information are generated, thereby more accurately representing the similarity and correlation between mutations. Aggregation processing is used to integrate the semantic embedding information of the target mutation into representative features, effectively utilizing the interaction information between mutations. Finally, the aggregated features are input into a preset drug resistance prediction model, which can fully utilize the semantic information and correlation of mutations, thereby effectively improving the accuracy and efficiency of drug resistance prediction.

[0228] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0229] Based on the same inventive concept, this application also provides a bacterial DNA-based bacterial phenotype prediction device for implementing the aforementioned bacterial DNA-based bacterial phenotype prediction method. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more embodiments of the bacterial DNA-based bacterial phenotype prediction device provided below can be found in the limitations of the bacterial DNA-based bacterial phenotype prediction method described above, and will not be repeated here.

[0230] In one exemplary embodiment, such as Figure 4 As shown, a bacterial phenotype prediction device based on bacterial DNA is provided. This bacterial phenotype prediction device 400 may include:

[0231] Node construction module 401 is used to construct a heterogeneous graph; the heterogeneous graph includes nodes and the connections between nodes; the nodes include mutation nodes, location nodes, gene nodes, mutation type nodes, and strain nodes; the connections represent the semantic relationships between nodes;

[0232] The information processing module 402 is used to perform semantic training processing on the mutation embedding information based on the heterogeneous graph to obtain the mutation semantic embedding information of the mutation embedding information.

[0233] The information determination module 403 is used to determine the target mutation semantic embedding information corresponding to the mutation information in the input sample based on the mutation semantic embedding information;

[0234] The information aggregation module 404 is used to aggregate the semantic embedding information of the target mutation to obtain the aggregated feature information of the semantic embedding information of the target mutation.

[0235] The information input module 405 is used to input aggregated feature information into a preset drug resistance prediction model for drug resistance prediction processing, and obtain the drug resistance prediction results of the input sample against tuberculosis drugs.

[0236] In an exemplary embodiment, the information aggregation module 404 is further configured to perform multi-level aggregation processing on the target mutation semantic embedding information to obtain multi-level aggregated features of the target mutation semantic embedding information; and use the multi-level aggregated features as aggregated feature information.

[0237] In an exemplary embodiment, the information aggregation module 404 is further configured to perform early aggregation processing on the target mutation semantic embedding information to obtain a first aggregation feature of the target mutation semantic embedding information; and perform mid-term aggregation processing on the first aggregation feature to obtain multi-level aggregation features.

[0238] In an exemplary embodiment, the information aggregation module 404 is further configured to aggregate the target mutation semantic embedding information through embedding pooling to obtain a first aggregated feature; and to aggregate the first aggregated feature through a preset encoder to obtain a multi-level aggregated feature.

[0239] In an exemplary embodiment, the device 400 further includes: an information generation module, configured to determine key mutation information corresponding to the drug resistance prediction result based on the degree of contribution of the target mutation semantic embedding information to the drug resistance prediction result; and to generate explanatory information of the drug resistance prediction result based on the key mutation information.

[0240] In an exemplary embodiment, the information input module 405 is further configured to input aggregated feature information into the drug resistance prediction model for drug resistance prediction processing, to obtain a predicted value of the input sample’s resistance to anti-tuberculosis drugs; and to determine the drug resistance classification result of the input sample based on the predicted value and a preset threshold, as the drug resistance prediction result.

[0241] The modules in the aforementioned bacterial DNA-based bacterial phenotype prediction device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.

[0242] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 5As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a bacterial phenotypic prediction method based on bacterial DNA. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0243] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0244] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0245] In one exemplary embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above-described method embodiments.

[0246] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0247] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0248] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0249] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A bacterial phenotype prediction method based on bacterial DNA, characterized in that, The method includes: Construct a heterogeneous graph; the heterogeneous graph includes nodes and the connections between the nodes; the nodes include mutation nodes, location nodes, gene nodes, mutation type nodes, and strain nodes; the connections represent the semantic relationships between the nodes; Based on the heterogeneous graph, semantic training processing is performed on the mutation embedding information to obtain the mutation semantic embedding information of the mutation embedding information. Based on the mutation semantic embedding information, determine the target mutation semantic embedding information corresponding to the mutation information in the input sample; The target mutation semantic embedding information is aggregated by embedding pooling to obtain the first aggregated feature of the target mutation semantic embedding information; By using a preset encoder, the first aggregated feature is aggregated to obtain the multi-level aggregated feature of the target mutation semantic embedding information; The multi-level aggregated features are used as aggregated feature information of the target mutation semantic embedding information; The aggregated feature information is input into a preset drug resistance prediction model for drug resistance prediction processing to obtain the drug resistance prediction results of the input sample against tuberculosis drugs.

2. The method according to claim 1, characterized in that, The heterogeneous graph includes five types of nodes and four types of edges.

3. The method according to claim 1, characterized in that, The connectivity relationships include mutation-position relationships.

4. The method according to claim 1, characterized in that, The connections include mutation-gene relationships.

5. The method according to claim 1, characterized in that, After inputting the aggregated feature information into a preset drug resistance prediction model for drug resistance prediction processing to obtain the drug resistance prediction results of the input sample against tuberculosis drugs, the method further includes: Based on the contribution of the target mutation semantic embedding information to the drug resistance prediction result, the key mutation information corresponding to the drug resistance prediction result is determined; Based on the key mutation information, interpretive information for the drug resistance prediction results is generated.

6. The method according to any one of claims 1 to 5, characterized in that, The step of inputting the aggregated feature information into a preset drug resistance prediction model for drug resistance prediction processing, to obtain the drug resistance prediction result of the input sample against tuberculosis drugs, includes: The aggregated feature information is input into the drug resistance prediction model for drug resistance prediction processing to obtain the predicted value of the input sample's resistance to the anti-tuberculosis drug; Based on the predicted value and the preset threshold, the drug resistance classification result of the input sample is determined as the drug resistance prediction result.

7. A bacterial phenotype prediction device based on bacterial DNA, characterized in that, The device includes: A node construction module is used to construct a heterogeneous graph; the heterogeneous graph includes nodes and the connection relationships between the nodes; the nodes include mutation nodes, location nodes, gene nodes, mutation type nodes, and strain nodes; the connection relationships represent the semantic relationships between the nodes; The information processing module is used to perform semantic training processing on the mutation embedding information based on the heterogeneous graph to obtain the mutation semantic embedding information of the mutation embedding information; The information determination module is used to determine the target mutation semantic embedding information corresponding to the mutation information in the input sample based on the mutation semantic embedding information. The information aggregation module is used to aggregate the target mutation semantic embedding information through embedding pooling to obtain a first aggregated feature of the target mutation semantic embedding information; to aggregate the first aggregated feature through a preset encoder to obtain a multi-level aggregated feature of the target mutation semantic embedding information; and to use the multi-level aggregated feature as the aggregated feature information of the target mutation semantic embedding information. The information input module is used to input the aggregated feature information into a preset drug resistance prediction model for drug resistance prediction processing, so as to obtain the drug resistance prediction result of the input sample against tuberculosis drugs.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Mycobacterium tuberculosis drug resistance prediction method and device based on hierarchical attention neural network

    CN114582429A

  • Heterogeneous node sequence representation-based drug-disease association prediction method and system

    CN119274691A