Phenotype prediction and phenotype prediction model training method

By constructing a weighted graph based on protein sequences and inputting it into a phenotypic prediction model, the problem of inaccurate microbial phenotypic prediction in existing technologies is solved, and higher accuracy in phenotypic prediction is achieved, especially in the prediction of microbial drug resistance, toxicity, and pathogenicity.

CN121459933BActive Publication Date: 2026-07-03SHANGHAI JIAOTONG UNIV SCHOOL OF MEDICINE

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI JIAOTONG UNIV SCHOOL OF MEDICINE
Filing Date
2025-10-27
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing microbial phenotypic prediction technologies that combine whole-genome sequencing with artificial intelligence suffer from inaccurate prediction results, mainly due to the complex preprocessing and comparison of WGS data and the need for manual feature processing.

Method used

By obtaining the protein sequence of the test sample, its spatial structure features and amino acid node features are estimated, a weighted graph is constructed, and it is input into a trained phenotypic prediction model. The prediction is made directly using the original protein sequence from whole-genome sequencing, taking into account the spatial structure and amino acid node features of the protein sequence.

Benefits of technology

It improves the accuracy of phenotypic prediction results, especially the prediction of microbial resistance, toxicity and pathogenicity, reduces human intervention and enhances the accuracy of prediction models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121459933B_ABST
    Figure CN121459933B_ABST
Patent Text Reader

Abstract

This application relates to a phenotypic prediction and phenotypic prediction model training method. The method includes: acquiring the protein sequence of a test sample; estimating the spatial structure features and amino acid node features of the protein sequence; the amino acid node features reflecting the amino acids contained in the protein sequence, and the spatial structure features reflecting the spatial positions of the amino acids in the protein sequence; determining a weighted graph of the protein sequence based on the spatial structure features and the amino acid node features; and inputting the weighted graph into a trained phenotypic prediction model to obtain the phenotypic prediction result of the test sample. This method can improve the accuracy of the phenotypic prediction results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of bioinformatics technology, and in particular to a phenotypic prediction and phenotypic prediction model training method. Background Technology

[0002] Microbial phenotyping prediction includes predicting the drug resistance, toxicity, and pathogenicity of bacteria such as Mycobacterium tuberculosis (MTB), Escherichia coli, Klebsiella pneumoniae, and Staphylococcus aureus. Among them, drug resistance refers to the adaptive resistance of microorganisms to antimicrobial drugs, toxicity reflects the ability of microorganisms to produce harmful substances, and pathogenicity characterizes the likelihood of microorganisms causing diseases in the host. The accuracy of phenotyping prediction is directly related to the rational use of antibiotics and public health safety.

[0003] Whole-genome sequencing (WGS) can provide more comprehensive microbial information at the gene level. Theoretically, combining WGS with artificial intelligence (AI) can more accurately predict microbial phenotypes. Current phenotype prediction technologies compare the WGS results of a sample with a reference genome to obtain mutation features in the genome (e.g., single nucleotide polymorphisms, nucleotide insertions and deletions, etc.). Some mutation sites are then processed and input into the model for prediction. However, this method requires complex preprocessing and comparison of WGS data, and the feature processing steps require human intervention. These processes can easily lead to inaccurate model prediction results.

[0004] Therefore, current phenotypic prediction techniques suffer from inaccurate prediction results. Summary of the Invention

[0005] Therefore, it is necessary to provide a more accurate method, apparatus, computer device, computer-readable storage medium, and computer program product for phenotypic prediction, phenotypic prediction model training, and to address the aforementioned technical problems.

[0006] Firstly, this application provides a phenotypic prediction method, including:

[0007] Obtain the protein sequence of the sample to be tested;

[0008] Estimate the spatial structure features and amino acid node features of the protein sequence; the amino acid node features reflect the amino acids contained in the protein sequence, and the spatial structure features reflect the spatial positions of the amino acids in the protein sequence;

[0009] Based on the spatial structure features and the amino acid node features, a weighted graph of the protein sequence is determined;

[0010] The weighted graph is input into the trained phenotypic prediction model to obtain the phenotypic prediction results of the detected samples.

[0011] Secondly, this application also provides a method for training a phenotypic prediction model, including:

[0012] Obtain the protein sequences of the training samples and the corresponding standard phenotypes of the training samples;

[0013] Estimate the spatial structure features and amino acid node features of the protein sequence; the amino acid node features reflect the amino acids contained in the protein sequence, and the spatial structure features reflect the spatial positions of the amino acids in the protein sequence;

[0014] Based on the spatial structure features and the amino acid node features, a weighted graph of the protein sequence is determined;

[0015] The weighted graph is input into the phenotypic prediction model to be trained to obtain the predicted phenotype output by the phenotypic prediction model to be trained.

[0016] The phenotypic prediction model to be trained is trained based on the cross-entropy between the predicted phenotypic and the standard phenotypic to obtain a trained phenotypic prediction model.

[0017] Thirdly, this application also provides a phenotypic prediction device, comprising:

[0018] The first acquisition module is used to acquire the protein sequence of the test sample;

[0019] The first estimation module is used to estimate the spatial structure features and amino acid node features of the protein sequence; the amino acid node features reflect the amino acids contained in the protein sequence, and the spatial structure features reflect the spatial positions of the amino acids in the protein sequence.

[0020] The first generation module is used to determine a weighted graph of the protein sequence based on the spatial structure features and the amino acid node features;

[0021] The first prediction module is used to input the weighted graph into the trained phenotypic prediction model to obtain the phenotypic prediction result of the detected sample.

[0022] Fourthly, this application also provides a phenotypic prediction model training device, comprising:

[0023] The second acquisition module is used to acquire the protein sequence of the training sample and the standard phenotype corresponding to the training sample;

[0024] The second estimation module is used to estimate the spatial structure features and amino acid node features of the protein sequence; the amino acid node features reflect the amino acids contained in the protein sequence, and the spatial structure features reflect the spatial positions of the amino acids in the protein sequence.

[0025] The second generation module is used to determine a weighted graph of the protein sequence based on the spatial structure features and the amino acid node features;

[0026] The second prediction module is used to input the weighted graph into the phenotypic prediction model to be trained, and obtain the predicted phenotype output by the phenotypic prediction model to be trained.

[0027] The model training module is used to train the phenotypic prediction model to be trained based on the cross-entropy between the predicted phenotypic and the standard phenotypic, so as to obtain the trained phenotypic prediction model.

[0028] Fifthly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in any of the first aspects above, or to implement the steps of the method described in any of the second aspects above.

[0029] Sixthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any of the first aspects above, or implements the steps of the method described in any of the second aspects above.

[0030] In a seventh aspect, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in any of the first aspects above, or implements the steps of the method described in any of the second aspects above.

[0031] The aforementioned phenotypic prediction, phenotypic prediction model training methods, devices, computer equipment, computer-readable storage media, and computer program products acquire the protein sequence of the test sample, estimate the spatial structure features and amino acid node features of the protein sequence. Amino acid node features reflect the amino acids contained in the protein sequence, while spatial structure features reflect the spatial positions of amino acids within the protein sequence. Based on the spatial structure features and amino acid node features, a weighted graph of the protein sequence is determined. This weighted graph is then input into the trained phenotypic prediction model to obtain the phenotypic prediction result of the test sample. This method can directly utilize the original protein sequence from whole-genome sequencing for prediction, rather than only targeting mutation sites in the genome. It also considers both the spatial structure features and amino acid node features of the protein sequence, providing richer information for the phenotypic prediction model and improving the accuracy of the phenotypic prediction results. Attached Figure Description

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

[0033] Figure 1 This is a flowchart illustrating a phenotypic prediction method in one embodiment;

[0034] Figure 2 This is a schematic diagram of the StrucGAT-DRTB model in one embodiment;

[0035] Figure 3 This is a flowchart illustrating a phenotypic prediction model training method in one embodiment;

[0036] Figure 4 This is a graph showing the AUROC and AUPRC results of comparing the StrucGAT-DRTB model with the best model in one embodiment.

[0037] Figure 5 This is a graph showing the AUROC and AUPRC results of comparing the StrucGAT-DRTB model with a sequence-based input model in one embodiment.

[0038] Figure 6 This is a graph showing the comparison between the fine-tuned AUROC and AUPRC models and the original model in one embodiment.

[0039] Figure 7 This is a flowchart illustrating the phenotypic prediction method in another embodiment;

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

[0041] 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.

[0042] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.

[0043] In one exemplary embodiment, such as Figure 1 As shown, a phenotypic prediction method is provided. Taking the application of this method to a terminal as an example, the method includes the following steps S102 to S108. Wherein:

[0044] Step S102: Obtain the protein sequence of the test sample.

[0045] The test sample can be the object of phenotypic prediction, such as a microbial strain. The protein sequence can be a sequence composed of amino acids.

[0046] Optionally, whole-genome sequencing can be performed on the test sample to obtain whole-genome sequencing data. The terminal then determines multiple protein sequences from the test sample based on this data. Taking MTB phenotypic prediction as an example, samples can be collected from tuberculosis patients, MTB strains can be isolated from the isolated samples, and whole-genome sequencing can be performed on the MTB strains to obtain whole-genome sequencing data. Based on this data, 31 protein sequences can be selected. It is understood that the rules for selecting protein sequences can be manually set or automatically generated by the terminal; this application does not impose any restrictions on this.

[0047] Step S104: Estimate the spatial structure features and amino acid node features of the protein sequence; amino acid node features reflect the amino acids contained in the protein sequence, and spatial structure features reflect the spatial positions of amino acids in the protein sequence.

[0048] Spatial structure features can be characteristic data reflecting the spatial structure of a protein sequence, such as the three-dimensional coordinates of amino acid atoms. Amino acid node features can be, but are not limited to, vector representations of the individual amino acids contained in the protein sequence.

[0049] Optionally, the terminal can estimate the spatial structural features of each protein sequence based on a pre-trained structure prediction model. It can also estimate the random vectors of each amino acid in each protein sequence to obtain amino acid node features. For example, a pre-trained protein structure prediction model can be used to predict the spatial structure of each protein sequence, obtaining its spatial structural features. This model can be, but is not limited to, an Evolutionary Scale Modeling Fold (ESMFold) model. Using ESMFold, the structure of 31 protein sequences can be predicted in batches, generating a Protein Data Bank (PDB) file. The PDB file can record the three-dimensional coordinates of all atoms in each amino acid of each protein sequence. Furthermore, for the 21 amino acids, a random vector corresponding to each amino acid can be pre-determined, and a one-hot encoding can be used to index the random vector corresponding to each amino acid. This forms a dictionary of random vectors indexed by one-hot encoding. For each protein sequence, the one-hot encoding corresponding to each amino acid can be determined. The random vector is searched in the random vector dictionary according to the one-hot encoding, and the found random vector is used as the amino acid node feature of the corresponding amino acid. The one-hot encoding can be a 21-dimensional vector.

[0050] Step S106: Determine the weighted graph of the protein sequence based on spatial structure features and amino acid node features.

[0051] The weighted graph can be, but is not limited to, an attention-weighted graph.

[0052] Optionally, the terminal can construct nodes for each protein sequence based on spatial structural features, and obtain node feature vectors (node ​​embeddings) based on amino acid node features. It can also determine whether nodes are connected by edges based on the presence or absence of peptide bonds between amino acids in the protein sequence and the spatial distance between amino acids, as well as the weight of the edges when they are connected. Based on the nodes, node feature vectors, edges, and edge weights, a weighted graph of the protein sequence is obtained. For example, a weighted graph can be constructed for a single protein sequence. Nodes in the weighted graph are formed based on spatial structural characteristics. Each node in the weighted graph... Representing each amino acid and each edge in the protein sequence Connecting two distinct nodes, the random vector corresponding to each amino acid in the protein sequence is used as the node's feature vector. The weighted graph can have two types of edges: one is the peptide bond between adjacent amino acid residues in the protein sequence, with a weight of 1; the other is the edge between two amino acids that are close to each other in the spatial coordinates predicted by the ESMFold model, i.e., the spatial distance is less than a specified value. The edge corresponding to the amino acid residue pair can be set with a weight between 0 and 1. It can be understood that when the edge weight is set to 0, it means that there is no edge connection between the nodes.

[0053] Step S108: Input the weighted graph into the trained phenotypic prediction model to obtain the phenotypic prediction results of the detected samples.

[0054] The phenotypic prediction model can be implemented, but is not limited to, through a graph attention network. The phenotypic prediction result can be the phenotype of the test sample obtained through the phenotypic prediction model, such as the drug resistance, toxicity, and pathogenicity of the test sample to multiple drugs.

[0055] Optionally, after obtaining the weighted map corresponding to each protein sequence, the terminal can input multiple weighted maps corresponding to multiple protein sequences of the test sample into the trained phenotypic prediction model. The trained phenotypic prediction model directly predicts the phenotype of the test sample, which is then used as the phenotypic prediction result.

[0056] This will be illustrated using the prediction of MTB resistance. Figure 2 A schematic diagram of a Structure-aware Graph Attention Network for Mycobacterium Tuberculosis Antibiotic Resistance Prediction (StrucGAT-DRTB) is provided, based on... Figure 2After obtaining 31 weighted graphs corresponding to 31 protein sequences, these 31 weighted graphs can be input into a pre-trained StrucGAT-DRTB model. The StrucGAT-DRTB model can contain 31 proprietary Graph Attention Network (GAT) blocks and 1 shared GAT block. The proprietary GAT blocks and the shared GAT block can update the weighted graphs based on a learnable self-attention mechanism, outputting graph representation vectors. The proprietary GAT blocks update each weighted graph separately, while the shared GAT block can update all 31 weighted graphs using the interaction information between them. The output graph representation vectors are then processed through stacking, fusion, etc., and fed into a classifier. The classifier outputs the predicted drug resistance results of the MTB strains for multiple drugs. It is understandable that other phenotypes of microorganisms, such as virulence and pathogenicity, can also be expressed through proteins. Therefore, the above-mentioned StrucGAT-DRTB model is also applicable to the prediction of other phenotypes of microorganisms. It is only necessary to change the labels to the gold standard of the corresponding phenotype during the model training process. This application does not limit the specific phenotypes to which the phenotype prediction model is applicable.

[0057] The aforementioned phenotypic prediction method obtains the protein sequence of the test sample, estimates the spatial structure features and amino acid node features of the protein sequence. The amino acid node features reflect the amino acids contained in the protein sequence, while the spatial structure features reflect the spatial positions of the amino acids in the protein sequence. Based on the spatial structure features and amino acid node features, a weighted graph of the protein sequence is determined. The weighted graph is then input into a trained phenotypic prediction model to obtain the phenotypic prediction results of the test sample. This method can directly utilize the original protein sequence from whole-genome sequencing for prediction, rather than only targeting mutation sites in the genome. It also considers both the spatial structure features and amino acid node features of the protein sequence, providing richer information for the phenotypic prediction model and improving the accuracy of the phenotypic prediction results.

[0058] In an exemplary embodiment, step S106 may specifically include: encoding the positions of amino acids in the protein sequence to obtain the amino acid position features of the protein sequence; the amino acid position features reflect the arrangement positions of amino acids in the protein sequence; and obtaining a weighted graph based on the spatial structure features, amino acid node features, and amino acid position features.

[0059] Among them, amino acid position features can be, but are not limited to, a vector representation of the arrangement of amino acids in the protein sequence.

[0060] Optionally, the terminal can perform position encoding based on the arrangement of amino acids in the protein sequence to obtain the amino acid position features corresponding to the amino acids. After constructing nodes based on spatial structure features, the terminal can also obtain node feature vectors based on amino acid position features and amino acid node features, and use the node feature vectors as node feature vectors in the weighted graph to form a weighted graph.

[0061] In practical applications, let the coding dimension of positional coding be... The position index of amino acids in the protein sequence is ,right Position encoding yields:

[0062] .

[0063] in, The obtained amino acid position characteristics; A function representing position encoding; Represents the encoding dimension Index on ; , For even-numbered positions in the encoding dimension, This represents odd-numbered positions in the encoding dimension. The random vector corresponding to each amino acid in the protein sequence (i.e., the amino acid node feature) is then mapped to the corresponding... The amino acid position features are added together to obtain the node feature vector corresponding to each node in the weighted graph.

[0064] In this embodiment, amino acids in the protein sequence are encoded at their positions to obtain the amino acid position features of the protein sequence. Based on the spatial structure features, amino acid node features, and amino acid position features, a weighted graph is obtained. The weighted graph can be constructed using the types, spatial positions, and sequences of amino acids in the protein sequence, so that the weighted graph carries richer information about the protein sequence and more accurately reflects the characteristics of the protein sequence. Based on this weighted graph, phenotype prediction can be performed, which can improve the accuracy of phenotype prediction results.

[0065] In an exemplary embodiment, the step of obtaining a weighted graph based on spatial structure features, amino acid node features, and amino acid position features may specifically include: determining nodes in the weighted graph based on spatial structure features; obtaining node feature vectors based on amino acid node features and amino acid position features; determining edges and edge weights in the weighted graph when there is a peptide bond between two amino acids in the protein sequence, or when the spatial distance between two amino acids in the protein sequence is less than a preset threshold; and obtaining the weighted graph based on nodes, node feature vectors, edges, and edge weights.

[0066] In this weighted graph, nodes correspond to amino acids in the amino acid sequence. The node feature vector is the feature vector corresponding to the node in the weighted graph. Spatial distance refers to the distance between amino acids. Spatial distance between atoms. Preset threshold refers to a pre-defined distance threshold. Edge weight refers to the weight of an edge.

[0067] Optionally, the terminal can determine each node of the weighted graph based on the spatial structural features of the protein sequence, add the amino acid node features to the amino acid position features to obtain the node feature vector corresponding to each node, and also determine whether there is an edge between nodes and the edge weight when there is an edge based on whether there is a peptide bond connecting any two amino acids in the protein sequence, and the spatial distance between any two amino acids when there is no peptide bond. Finally, a weighted graph corresponding to the protein sequence is formed based on the nodes, node feature vectors, edges, and edge weights. Specifically, if there is a peptide bond connecting two amino acids, it can be determined that there is an edge between the nodes corresponding to these two amino acids, and the edge weight is 1; if there is no peptide bond connecting two amino acids, but the spatial distance between these two amino acids is less than a preset threshold, it can also be determined that there is an edge between the nodes corresponding to these two amino acids, and the edge weight is between 0 and 1; if there is no peptide bond connecting two amino acids, and the spatial distance between these two amino acids is greater than or equal to the preset threshold, it can be determined that there is no edge connecting the nodes corresponding to these two amino acids, and theoretically, the corresponding edge weight can be set to 0.

[0068] For example, definition For a set of nodes, Construct a weighted graph for the set of edges. Each node in the weighted graph Representing each amino acid and each edge in the protein sequence Connect two different amino acids, and combine the random vector corresponding to the amino acid (i.e., the amino acid node feature) with the feature obtained through position encoding. (i.e., amino acid position features) are added together to obtain the node feature vector corresponding to each node. Two types of edges are set: one type represents a peptide bond connection between adjacent amino acid residues in the protein sequence; the other type represents that two amino acids are close to each other in the spatial structure predicted by the ESMFold model. For example, it can connect edges with a spatial distance of less than a specified value. The amino acid residue pairs are used to calculate the edge weights using the following formula. :

[0069] .

[0070] in, and They represent the first The and the first One amino acid The spatial position of the atom; Representing vectors and The Euclidean distance between them; It is the specified distance threshold.

[0071] In this embodiment, nodes in the weighted graph are determined based on spatial structural features, and node feature vectors are obtained based on amino acid node features and amino acid position features. When there is a peptide bond between two amino acids in the protein sequence, or when the spatial distance between two amino acids in the protein sequence is less than a preset threshold, the edges and edge weights in the weighted graph are determined. Based on the nodes, node feature vectors, edges, and edge weights, the weighted graph is obtained. The weighted graph can carry information reflecting the types, spatial positions, and order of amino acids in the protein sequence, thereby predicting phenotypes and improving the accuracy of phenotype prediction results.

[0072] In an exemplary embodiment, the protein sequence includes multiple sequences, and the trained phenotypic prediction model includes a first unit and a second unit. The first unit is a graph neural network unit specific to each protein sequence, and the second unit is a graph neural network unit shared by different protein sequences. The above step S108 may specifically include: inputting the weighted graph into the first unit and the second unit to obtain a first vector and a second vector, respectively; stacking the first vector into a first matrix and stacking the second vector into a second matrix; determining the fusion matrix of the first matrix and the second matrix; classifying the fusion matrix to obtain the phenotypic prediction result.

[0073] The first unit can be a proprietary GAT block. The second unit can be a shared GAT block. The first vector can be a graph representation vector output by the proprietary GAT block. The second vector can be a graph representation vector output by the shared GAT block. The first matrix can be a matrix formed by stacking multiple first vectors. The second matrix can be a matrix formed by stacking multiple second vectors. The fusion matrix can be a matrix obtained by data fusion.

[0074] Optionally, there can be multiple protein sequences, and multiple weighted maps are also obtained based on the protein sequences. Each weighted map is input into a first unit and a second unit, respectively. The first unit outputs a first vector, and the second unit outputs a second vector. The multiple first vectors corresponding to the multiple weighted maps are stacked into a first matrix, and the multiple second vectors corresponding to the multiple weighted maps are stacked into a second matrix. The fusion matrix obtained by fusing the first matrix and the second matrix is ​​input into the classifier to obtain the phenotypic prediction results of multiple protein sequences.

[0075] For example, see reference. Figure 2The StrucGAT-DRTB model is input with 31 weighted graphs corresponding to 31 protein sequences. The StrucGAT-DRTB model contains 31 proprietary GAT blocks (first unit) and 1 shared GAT block (second unit). Each proprietary GAT block outputs a graph representation vector (first vector). The shared GAT block generates 31 graph representation vectors (second vector) using the interaction information between the 31 weighted graphs. Assuming each graph representation vector has a dimension of Embedding_dim, the 31 first vectors are stacked to obtain a 31-dimensional graph representation vector. The matrix of Embedding_dim (the first matrix), and 31 second vectors stacked together to obtain another 31. The first matrix (the second matrix) of Embedding_dim is fused with the second matrix by positional multiplication or multi-head self-attention mechanism. The resulting fused matrix is ​​then input into the classifier. Based on the soft output (logits) of the classifier, the phenotypic prediction results of 31 protein sequences can be obtained.

[0076] It should be noted that in the above embodiments, the first matrix and the second matrix may not need to be fused. That is, only the first matrix or only the second matrix can be input into the classifier to obtain the phenotypic prediction result. Moreover, the first matrix does not necessarily have to be a stack of all the first vectors, and the second matrix does not necessarily have to be a stack of all the second vectors. In other words, from the total of 62 graph representation vectors output by the proprietary GAT block and the shared GAT block, any number of graph representation vectors can be selected for stacking and / or fusion, and this application does not impose any restrictions on this.

[0077] In this embodiment, by inputting the weighted graphs into the first unit and the second unit, a first vector and a second vector are obtained respectively. The first vectors are stacked into a first matrix, and the second vectors are stacked into a second matrix. The fusion matrix of the first matrix and the second matrix is ​​determined. The fusion matrix is ​​classified to obtain the phenotypic prediction result. The feature update can be performed on each weighted graph by using a proprietary GAT, and the feature update can be performed on the interaction between multiple weighted graphs by using a shared GAT, thereby improving the accuracy of the prediction result.

[0078] In an exemplary embodiment, the step of determining the fusion matrix of the first matrix and the second matrix may specifically include: obtaining the fusion matrix based on the product of the first matrix and the second matrix; or, determining the fusion matrix of the first matrix and the second matrix based on a multi-head self-attention mechanism.

[0079] Optionally, the terminal can multiply the first matrix and the second matrix bitwise to obtain a fusion matrix, or it can treat the first matrix and the second matrix as a sequence and input them into the multi-head self-attention layer, and average the output of the multi-head self-attention layer to obtain a fusion matrix.

[0080] For example, fusion strategies can include positional multiplication fusion and multi-head self-attention mechanisms. For positional multiplication fusion, a one-dimensional convolutional layer can be used to extract features from the result of positional multiplication of two matrices, outputting a vector with the same dimension as the graph representation, which is then input into the subsequent classification layer to predict the classification probability. The StrucGAT-DRTB model using this fusion strategy can be denoted as StrucGAT-DRTB based on matrix multiplication (matmul), i.e., the StrucGAT-DRTB (matmul) model. Employing a multi-head self-attention strategy can enhance the interpretability of the model. The two matrices are treated as inputs in the form of sequences, where each graph representation vector is a token. First, a "[CLS]" token is added to the beginning (position 0) of each of the two sequences as an aggregate representation of the entire sequence to be learned. Then, both sequences are input into the multi-head self-attention layer, and the outputs of the two "[CLS]" tokens are averaged before being fed into the classification layer. The StrucGAT-DRTB model using this fusion strategy can be denoted as StrucGAT-DRTB based on the multi-head attention mechanism (MHA), i.e., the StrucGAT-DRTB (MHA) model.

[0081] In this embodiment, the feature updates of the proprietary GAT and the feature updates of the shared GAT can be fused by obtaining the fusion matrix based on the product of the first matrix and the second matrix, or by determining the fusion matrix of the first matrix and the second matrix based on the multi-head self-attention mechanism, thereby improving the accuracy of the prediction results.

[0082] In one exemplary embodiment, such as Figure 3 As shown, a method for training a phenotypic prediction model is provided. Taking the application of this method to a terminal as an example, the method includes the following steps S201 to S205. Wherein:

[0083] Step S201: Obtain the protein sequence of the training sample and the standard phenotype corresponding to the training sample;

[0084] Step S202: Estimate the spatial structure features and amino acid node features of the protein sequence; amino acid node features reflect the amino acids contained in the protein sequence, and spatial structure features reflect the spatial positions of amino acids in the protein sequence.

[0085] Step S203: Determine the weighted graph of the protein sequence based on spatial structure features and amino acid node features;

[0086] Step S204: Input the weighted graph into the phenotypic prediction model to be trained to obtain the predicted phenotype output by the phenotypic prediction model to be trained.

[0087] Step S205: Train the phenotype prediction model to be trained based on the cross-entropy between the predicted phenotype and the standard phenotype to obtain the trained phenotype prediction model.

[0088] The training samples can be multiple bacterial strains used to train the phenotypic prediction model. The standard phenotype can be the gold standard for the phenotype of the bacterial strains; for example, when predicting drug resistance, the results of phenotypic drug susceptibility testing (pDST) can be used as the standard phenotype. The predicted phenotype can be the phenotypic prediction results of the phenotypic prediction model to be trained. The phenotypic prediction model to be trained can be the StrucGAT-DRTB model in the aforementioned examples.

[0089] Optionally, during the training phase of the phenotypic prediction model, the terminal can acquire protein sequences of multiple training samples and the standard phenotype corresponding to each training sample, estimate the spatial structural features and amino acid node features of the protein sequences, and also estimate the amino acid position features of the protein sequences. Nodes are determined based on the spatial structural features, and the sum of the amino acid node features and amino acid position features is used as the node feature vector. When there is a peptide bond connecting two amino acids in the protein sequence or the spatial distance is less than a preset threshold, edges and corresponding edge weights are obtained. A weighted graph corresponding to the protein sequence is obtained based on the nodes, node feature vectors, edges, and edge weights. The weighted graph is input into the phenotypic prediction model to be trained to obtain the predicted phenotype output by the phenotypic prediction model to be trained. The phenotypic prediction model to be trained is trained based on the cross-entropy between the predicted phenotype and the standard phenotype until a preset convergence condition is met, for example, the cross-entropy is minimized. The final phenotypic prediction model to be trained is used as the trained phenotypic prediction model. The trained phenotypic prediction model can be used to execute the phenotypic prediction method in any of the aforementioned embodiments.

[0090] Since the construction of the weighted graph and the specific structure of the phenotypic prediction model have been described in detail in the previous embodiments, they will not be repeated here.

[0091] In this embodiment, by acquiring the protein sequence of the training sample and the corresponding standard phenotype, the spatial structure features and amino acid node features of the protein sequence are estimated. Based on the spatial structure features and amino acid node features, a weighted graph of the protein sequence is determined. The weighted graph is input into the phenotype prediction model to be trained, and the predicted phenotype output by the phenotype prediction model to be trained is obtained. Based on the cross-entropy between the predicted phenotype and the standard phenotype, the phenotype prediction model to be trained is trained to obtain a trained phenotype prediction model. This model can be used for phenotype prediction. This model considers both the spatial structure features and amino acid node features of the protein sequence, which can improve the accuracy of phenotype prediction results.

[0092] To facilitate a deeper understanding of the embodiments of this application by those skilled in the art, a specific example will be used for illustration below.

[0093] When predicting drug resistance, traditional whole-genome sequencing-based resistance prediction models focus on variations in DNA and the proteins or RNA sequences encoded by DNA. However, research shows that the molecular mechanisms of drug resistance often involve mutations in target protein genes, which alter the 3D structure and function of proteins, thereby reducing the efficacy of antibiotics. Therefore, previous whole-genome sequencing-based drug resistance prediction models cannot fully capture the complex relationship between changes in protein function and drug resistance phenotypes.

[0094] This application proposes a structure-aware graph attention network (StrucGAT-DRTB) model for predicting antibiotic resistance in Mycobacterium tuberculosis. This model uses protein sequences encoded by WGS data as input, combined with protein structures predicted by the ESMFold model to form graphs. A neural network with multiple graph neural network (GAT) units captures resistance information from the protein sequences and their structures, and multiple genes (proteins) are fused through a multi-head attention mechanism to achieve highly accurate resistance prediction. Results show that StrucGAT-DRTB performs similarly to existing mutation-based State of the Art (SOTA) models. Using the raw protein sequences from whole-genome sequencing as input, it does not rely on manual feature extraction and exhibits stronger extrapolation performance compared to traditional mutation-based prediction models. Compared to other sequence-input-based models, StrucGAT-DRTB achieves more accurate resistance prediction. It can be understood that the StrucGAT-DRTB model is a resistance prediction model that simultaneously utilizes protein sequence and predicted structural information.

[0095] The detailed architecture of StrucGAT-DRTB is as follows: Figure 2 As shown, its main processing flow is as follows:

[0096] Step S301 involves constructing a graph from protein sequences, which mainly includes three steps: sequence embedding, protein structure prediction based on ESMFold, and graph construction.

[0097] In the original protein sequence, 21 amino acids are represented by different letters (including 20 amino acids and one unknown residue type represented by "X"). After One-Hot encoding, each amino acid in the sequence becomes a 21-dimensional vector.

[0098] This application uses the ESMFold model to predict the spatial structure of each protein. ESMFold is a protein folding prediction model based entirely on the Transformer architecture, which has a speed advantage in large-scale protein structure prediction. Experiments show that predicting the structure of a 600-byte protein using a single NVIDIA A100 80G GPU is 10 times faster than another protein structure prediction model, Alphafold 2. Therefore, ESMFold can be used to generate structure predictions for all proteins in batches. These results are saved as PDB files, which include the 3D coordinates of all atoms in different amino acids.

[0099] Furthermore, this application constructs a weighted graph. Each node in the weighted graph Represents each amino acid in a protein, and each edge Connect two distinct amino acids. The vertices (nodes) are characterized by vectors previously obtained through One-Hot encoding. Consider setting two types of edges, each representing a different meaning: one is a peptide bond between adjacent amino acid residues in the original protein sequence; the other is an "adjacent" edge constructed between two amino acids that are close to each other in predicted spatial coordinates. This application connects edges with spatial distances less than a specified value. The amino acid residue pairs are used to calculate the edge weights using the following formula. :

[0100] .

[0101] in and They represent the first The and the first One amino acid The spatial position of the atom, and This represents the Euclidean distance between vectors. This refers to the distance threshold specified above. Based on relevant research, this application will use [this threshold] in experiments. Set to 8 Å (angstroms). Weights during model training. It can be used as the initial value for attention weights.

[0102] Step S302, Embeddings. Since protein sequences are ordered, and the constructed graph doesn't reflect this, an embedding layer with position embeddings (PEs) can be included at the beginning of the neural network. Refer to the PE settings in the Transformer architecture for details. Specifically, each node vector is encoded as... Dimension (i.e., encoding dimension), and the first dimension in each input sequence (i.e., graph). The position encoding of each position (referring to the position of an amino acid residue at that vertex in the original protein sequence) for:

[0103] .

[0104] in It will produce the first A function that outputs a position vector at each position. Represents the encoding dimension The first One position.

[0105] Then, PEs are added element-by-element to the encoded node features to obtain the final node embedding.

[0106] Step S303, Multi-unit Graph Attention Neural Network Architecture. In the multi-unit attention graph neural network, each sample input is... Composed of several protein sequences, these sequences will be processed through a series of independent Each protein is processed through a GAT module. That is, each protein will be processed through a unique GAT unit and a shared GAT unit, such as... Figure 2 As shown. Each GAT module consists of multiple stacked GATv2 and Batch Normalization (BatchNorm) layers. The GATv2 layers use a graph attention algorithm. Unlike Graph Convolutional Networks (GCNs), which aggregate features from neighboring nodes using fixed weights determined by the degree of each node, GATv2 uses weights based on a learnable self-attention mechanism. Its attention function is defined as:

[0107] ;

[0108] .

[0109] in It is a node Neighbors It is a node The hidden representation, , These are parameters that need to be learned. This represents vector concatenation. GATv2 uses normalized attention coefficients to calculate a weighted average of the transformed features of neighboring nodes, as... New representation:

[0110] .

[0111] in It is an activation function.

[0112] After each GAT block, the updated graph for each protein is further processed by a global average pooling layer to obtain a representation of the graph:

[0113] .

[0114] in It is the number of nodes in the graph.

[0115] Subsequently, all graph representation vectors passed through the GAT layer are stacked to form two matrices (composed of graph representations from all unique GAT units and those from shared GAT units, respectively). Two strategies for fusing these representations are considered: positional multiplication fusion and multi-head self-attention. For the positional multiplication fusion strategy, a one-dimensional convolutional layer can be used to extract features from the result of the positional multiplication of the two matrices, outputting a vector with the same dimension as the graph representation, which is then fed into the subsequent classification head to predict classification probabilities. The multi-head self-attention strategy enhances the model's interpretability: the two matrices can be treated as sequential inputs, where each graph representation vector is a token. First, a "[CLS]" token is added at the very beginning (position 0) of each sequence as an aggregated representation of the entire sequence to be learned. Then, both sequences are fed into the multi-head self-attention layer, and the outputs of the two "[CLS]" tokens are averaged before being fed into the classification layer.

[0116] It should be noted that the above-mentioned StrucGAT-DRTB model can be extended to predict other microbial phenotypes such as virulence and pathogenicity. This application does not limit the specific phenotypes to which the StrucGAT-DRTB model is applicable.

[0117] The datasets used for model training, validation, and testing were derived from the Comprehensive Resistance Prediction for Tuberculosis: an International Consortium (CRyPTIC) dataset, which consists of 10,886 MTB strains with whole-genome sequencing data and phenotypic testing results. The raw sequencing data were compared with the Mycobacterium tuberculosis reference genome H37Rv (GenBank NC_00096292) and underwent quality control and preprocessing; details of the methods are not elaborated here.

[0118] Phenotypic testing was conducted on nine drugs, including three first-line drugs: isoniazid (INH), rifampicin (RIF), and ethambutol (EMB), and six second-line drugs: moxifloxacin (MXF), levofloxacin (LEV), amikacin (AMI), kanamycin (KAN), ethionamide (ETH), and rifabutin (RFB). Specific phenotypic testing methods and the critical concentrations used for each drug are not detailed here. The resistance samples and their proportions for each drug are shown in Table 1.

[0119] Table 1. Total number of drugs and resistance levels and proportions for the nine drugs.

[0120]

[0121] 1. Comparison of the performance of the StrucGAT-DRTB model with the baseline model.

[0122] Logistic Regression (LR) and Wide and Deep Neural Networks (WDNN) are currently the best models for first- and second-line drugs in predicting MTB resistance. This application compares the StrucGAT-DRTB model with them, and also considers Random Forest (RF). The results of the Area Under the Receiver Operating Characteristic Curve (AUROC) and the Area Under the Precision-Recall Curve (AUPRC) of the five models (including LR, RF, WDNN, and two StrucGAT-DRTB models: StrucGAT-DRTB (MHA) and StrucGAT-DRTB (matmul)) are compared as follows: Figure 4 As shown.

[0123] The results showed that all five models exhibited good classification performance on three first-line drugs (INH, RIF, and EMB), with all models achieving an AUROC exceeding 0.9. For INH and RIF, all models achieved an AUPRC exceeding 0.85. The StrucGAT-DRTB model's AUPRC on EMB was slightly lower than the three comparative models. For second-line drugs other than ETH, all models achieved an AUROC exceeding 0.85. The StrucGAT-DRTB model significantly outperformed the comparative models on MXF and LEV, with a mean AUROC of 0.96 and a mean AUPRC of 0.85, compared to the comparative models' mean AUROC and AUPRC of only 0.88 and 0.65, respectively. For AMI and KAN, the comparative models performed relatively better, achieving AUROC and AUPRC of 0.93 and 0.82, respectively. All models achieve very high AUROC and AUPRC scores for RFB resistance identification, but perform poorly on ETH.

[0124] It can be observed that StrucGAT achieves or approaches the classification performance of state-of-the-art (SOTA) models for most first-line drugs, outperforms SOTA models for MXF and LEV (two second-line drugs), but underperforms SOTA models for some second-line drugs. However, the StrucGAT-DRTB model, based on sequence input, does not rely on manual feature extraction, while SOTA models are all based on feature-extracted inputs, relying on existing knowledge and cumbersome data preprocessing, thus limiting their extrapolation capabilities.

[0125] 2. The StrucGAT-DRTB model outperformed other sequence-based models.

[0126] To compare the performance of sequence-input-based models, two models directly based on sequence input were constructed in the experiment: the ESM classifier (Evolutionary Scale Model Classifier, denoted as ESM-Classifier) ​​series models (ESM-Classifier-35M, ESM-Classifier-8M, ESM-Classifier-tuned-8M) and the ESM image (Evolutionary Scale Model Image, denoted as ESM-image) model. Both used the same 31 sequenced protein sequences as the StrucGAT-DRTB model as input. The former used a pre-trained protein big language model (ESM-2) for fine-tuning, while the latter used protein structures predicted by the ESMMFold model to construct images for further classification. Their AUROC and AUPRC comparison results are as follows: Figure 5 As shown.

[0127] For INH, RIF, and RFB, the StrucGAT-DRTB and ESM-image models significantly outperformed the other three models, with AUROC exceeding 0.90 and AUPRC exceeding 0.6. However, in identifying resistance to other drugs, the StrucGAT-DRTB model showed significantly higher AUROC and AUPRC values ​​than the ESM-classifier series models, while the ESM-image model's performance fell between that of the ESM-classifier model and StrucGAT-DRTB.

[0128] 3. StrucGAT-DRTB has good adaptability.

[0129] Existing tuberculosis prediction models all screen input protein fragments based on existing knowledge and evidence (usually the WHO-defined list of tuberculosis drug resistance). In this experiment, the 31 tier 1 genes currently identified by the WHO were used as input to the model. However, the WHO drug resistance list is updated regularly based on newly discovered evidence of drug resistance associations. It is very important that the model can flexibly and cost-effectively adapt to changes in the input sequence. Since StrucGAT-DRTB uses sequence-based input, it tested the performance changes of the model after fine-tuning it on the existing model to cope with changes in the input sequence.

[0130] Specifically, in the 2023 WHO catalog, the number of primary genes for all first- and second-line drugs was reduced from 31 to 22, a change compared to the older version used in the main experiments of this application. This application masked the removed genes ('Rv1258c', 'ahpC', 'clpC1', 'embA', 'embC', 'mmpL5', 'mmpS5', 'panD', 'whiB7'), froze the parameters in the corresponding GAT blocks and embedding layers, and fine-tuned the model on the fold 0 split of the dataset. The main experimental results are shown in [link to main experimental results]. Figure 6 .

[0131] It can be observed that after fine-tuning, the AUROC on AMI increased from 0.80 to 0.86, while the AUPRC decreased, and the performance on other drugs remained largely unchanged. Furthermore, the number of fine-tuning epochs for each drug task did not exceed 12. This indicates that the model in this application can adapt to a reduction in the number of input sequences after small-scale fine-tuning.

[0132] Meanwhile, as research into drug resistance in Mycobacterium tuberculosis continues, more gene loci associated with DR may be discovered. Therefore, the WHO or other evidence-based catalogs of drug resistance-related genes may expand. Thus, ensuring that the model in this application can effectively handle the protein inputs of these newly discovered drug resistance-related genes is crucial.

[0133] In this section, experiments were conducted on two drugs, KAN and ETH, and their second-tier (tier 2) related genes from the WHO drug resistance association gene catalog were added to the model input: bacA, ccsA, Rv2477c, whiB6, and ethR, ndh, Rv0565c, Rv3083. The parameters corresponding to the currently included genes in the embedding layer and GAT block were frozen, and the model was fine-tuned on the fold 0 split of the dataset. The results show that the AUROC value for KAN drug resistance classification improved from 0.72 to 0.80, and the AUPRC value improved from 0.28 to 0.36, while the AUROC value for ETH drug resistance classification remained at 0.81, and the AUPRC value remained at 0.52. This indicates that the model can adapt to an increase in the number of input sequences after small-scale fine-tuning and may utilize drug resistance association information in the added sequences to improve prediction accuracy.

[0134] It should be noted that, Figure 2 The middle image can be generated from other more advanced protein sequence prediction models, such as Alphafold2. Of course, a standardized API for protein sequence prediction models is needed for batch processing.

[0135] In one exemplary embodiment, such as Figure 7 As shown, a phenotypic prediction method is provided, which includes the following steps:

[0136] Step S401: Obtain the protein sequence of the test sample;

[0137] Step S402: Estimate the spatial structure features and amino acid node features of the protein sequence, and encode the positions of the amino acids in the protein sequence to obtain the amino acid position features of the protein sequence.

[0138] Step S403: Determine the nodes in the weighted graph based on the spatial structure features, and obtain the node feature vector based on the amino acid node features and amino acid position features;

[0139] Step S404: If there is a peptide bond between two amino acids in the protein sequence, or if the spatial distance between two amino acids in the protein sequence is less than a preset threshold, determine the edges and edge weights in the weighted graph.

[0140] Step S405: Obtain the weighted graph based on nodes, node feature vectors, edges, and edge weights;

[0141] Step S406: Input the weighted graph into the trained phenotypic prediction model to obtain the phenotypic prediction result; the trained phenotypic prediction model includes graph neural network units specific to each protein sequence, as well as graph neural network units shared by different protein sequences.

[0142] Optionally, the terminal can acquire multiple protein sequences of the test sample. For each protein sequence, its spatial structure features are determined using a protein structure prediction model. Amino acid node features are found in the protein sequence based on one-hot encoding. The amino acids in the protein sequence are then positionally encoded to obtain their positional features. Nodes are then determined based on the spatial structure features. The amino acid node features and amino acid positional features are added together to obtain a node feature vector. When there is a peptide bond connecting two amino acids in the protein sequence or the spatial distance between two amino acids is less than a preset threshold, an edge between nodes is obtained, and the edge weight is determined. Then, a weighted graph corresponding to each protein sequence is obtained based on the nodes, node feature vectors, edges, and edge weights. The terminal can input multiple weighted graphs corresponding to multiple protein sequences into a trained phenotypic prediction model to directly obtain the phenotypic prediction results of the test sample for multiple drugs. The trained phenotypic prediction model can contain multiple proprietary GAT blocks and one shared GAT block, which update each weighted graph and update the weighted graph using the interactions between weighted graphs.

[0143] Since the terminal processing procedure has been described in detail in the foregoing embodiments, it will not be repeated here.

[0144] The aforementioned phenotypic prediction method obtains the protein sequence of the test sample, estimates the spatial structure features and amino acid node features of the protein sequence, and encodes the positions of amino acids in the protein sequence to obtain the amino acid position features. Based on the spatial structure features, nodes in the weighted graph are determined, and node feature vectors are obtained based on the amino acid node features and amino acid position features. If there is a peptide bond connecting two amino acids in the protein sequence, or if the spatial distance between two amino acids in the protein sequence is less than a preset threshold, the edges and edge weights in the weighted graph are determined. Based on the nodes, node feature vectors, edges, and edge weights, the weighted graph is obtained. The weighted graph is then input into a trained phenotypic prediction model to obtain the phenotypic prediction result. This method can directly utilize the original protein sequence from whole-genome sequencing for prediction, rather than only targeting mutation sites in the genome. It also considers both the spatial structure features and amino acid node features of the protein sequence, providing richer information for the phenotypic prediction model and improving the accuracy of the phenotypic prediction results.

[0145] 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 in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0146] Based on the same inventive concept, this application also provides a phenotypic prediction and phenotypic prediction model training apparatus for implementing the above-mentioned phenotypic prediction and phenotypic prediction model training methods. The solution provided by this apparatus is similar to the solution described in the above-described methods. Therefore, the specific limitations of one or more embodiments of the phenotypic prediction and phenotypic prediction model training apparatus provided below can be found in the limitations of the phenotypic prediction and phenotypic prediction model training methods described above, and will not be repeated here.

[0147] In an exemplary embodiment, a phenotypic prediction apparatus is provided, comprising: a first acquisition module, a first estimation module, a first generation module, and a first prediction module, wherein:

[0148] The first acquisition module is used to acquire the protein sequence of the test sample;

[0149] The first estimation module is used to estimate the spatial structure features and amino acid node features of the protein sequence; the amino acid node features reflect the amino acids contained in the protein sequence, and the spatial structure features reflect the spatial positions of the amino acids in the protein sequence.

[0150] The first generation module is used to determine a weighted graph of the protein sequence based on the spatial structure features and the amino acid node features;

[0151] The first prediction module is used to input the weighted graph into the trained phenotypic prediction model to obtain the phenotypic prediction result of the detected sample.

[0152] In an exemplary embodiment, the first generation module is further configured to perform position encoding on the amino acids in the protein sequence to obtain amino acid position features of the protein sequence; the amino acid position features reflect the arrangement position of the amino acids in the protein sequence; and the weighted graph is obtained based on the spatial structure features, the amino acid node features, and the amino acid position features.

[0153] In an exemplary embodiment, the first generation module is further configured to determine nodes in the weighted graph based on the spatial structure features, obtain node feature vectors based on the amino acid node features and the amino acid position features; determine edges and edge weights in the weighted graph when there is a peptide bond between two amino acids in the protein sequence, or when the spatial distance between two amino acids in the protein sequence is less than a preset threshold; and obtain the weighted graph based on the nodes, the node feature vectors, the edges, and the edge weights.

[0154] In an exemplary embodiment, the first prediction module is further configured to input the weighted graph into the first unit and the second unit to obtain a first vector and a second vector, respectively; stack the first vector into a first matrix and stack the second vector into a second matrix; determine the fusion matrix of the first matrix and the second matrix; classify the fusion matrix to obtain the phenotypic prediction result.

[0155] In an exemplary embodiment, the first prediction module is further configured to obtain the fusion matrix based on the product of the first matrix and the second matrix; or, based on a multi-head self-attention mechanism, determine the fusion matrix of the first matrix and the second matrix.

[0156] In an exemplary embodiment, a phenotypic prediction model training apparatus is provided, comprising: a second acquisition module, a second estimation module, a second generation module, a second prediction module, and a model training module, wherein:

[0157] The second acquisition module is used to acquire the protein sequence of the training sample and the standard phenotype corresponding to the training sample;

[0158] The second estimation module is used to estimate the spatial structure features and amino acid node features of the protein sequence; the amino acid node features reflect the amino acids contained in the protein sequence, and the spatial structure features reflect the spatial positions of the amino acids in the protein sequence.

[0159] The second generation module is used to determine a weighted graph of the protein sequence based on the spatial structure features and the amino acid node features;

[0160] The second prediction module is used to input the weighted graph into the phenotypic prediction model to be trained, and obtain the predicted phenotype output by the phenotypic prediction model to be trained.

[0161] The model training module is used to train the phenotypic prediction model to be trained based on the cross-entropy between the predicted phenotypic and the standard phenotypic, so as to obtain the trained phenotypic prediction model.

[0162] The modules in the aforementioned phenotypic prediction and phenotypic prediction model training 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.

[0163] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 8As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface 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 interface. 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 interface is 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, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a phenotypic prediction and phenotypic prediction model training method. The display unit is used to form a visually visible image and can be a display screen, projection device, or 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.

[0164] Those skilled in the art will understand that Figure 8 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.

[0165] 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.

[0166] 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.

[0167] 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.

[0168] 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.

[0169] Those skilled in the art will understand that all or part of the processes in the methods of 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, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory 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, artificial intelligence (AI) processors, etc., and are not limited to these.

[0170] 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 application.

[0171] 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 phenotypic prediction method, characterized in that, The method includes: Obtain the protein sequence of the sample to be tested; Estimate the spatial structure features and amino acid node features of the protein sequence; the amino acid node features reflect the amino acids contained in the protein sequence, and the spatial structure features reflect the spatial positions of the amino acids in the protein sequence; Determining a weighted graph of the protein sequence based on the spatial structure features and the amino acid node features further includes: determining nodes in the weighted graph based on the spatial structure features; obtaining node feature vectors based on the amino acid node features and amino acid position features; determining edges and edge weights in the weighted graph when there is a peptide bond connection between two amino acids in the protein sequence, or when the spatial distance between two amino acids in the protein sequence is less than a preset threshold; and obtaining the weighted graph based on the nodes, the node feature vectors, the edges, and the edge weights. The weighted graph is input into the first and second units of the trained phenotypic prediction model to obtain the first vector and the second vector, respectively; the protein sequence includes multiple sequences, the first unit is a graph neural network unit specific to each protein sequence, the second unit is a graph neural network unit shared by different protein sequences, and the phenotypic prediction model is StrucGAT-DRTB. Stack the first vectors into a first matrix, and stack the second vectors into a second matrix; Determine the fusion matrix of the first matrix and the second matrix, classify the fusion matrix, and obtain the phenotypic prediction result of the detected sample.

2. The method according to claim 1, characterized in that, The step of determining the weighted graph of the protein sequence based on the spatial structure features and the amino acid node features includes: The amino acids in the protein sequence are positionally encoded to obtain the amino acid position features of the protein sequence; the amino acid position features reflect the arrangement of the amino acids in the protein sequence.

3. The method according to claim 1, characterized in that, Determining the fusion matrix of the first matrix and the second matrix includes: The fusion matrix is ​​obtained by multiplying the first matrix and the second matrix; or, The fusion matrix of the first matrix and the second matrix is ​​determined based on the multi-head self-attention mechanism.

4. A method for training a phenotypic prediction model, characterized in that, The method includes: Obtain the protein sequences of the training samples and the corresponding standard phenotypes of the training samples; Estimate the spatial structure features and amino acid node features of the protein sequence; the amino acid node features reflect the amino acids contained in the protein sequence, and the spatial structure features reflect the spatial positions of the amino acids in the protein sequence; Determining a weighted graph of the protein sequence based on the spatial structure features and the amino acid node features further includes: determining nodes in the weighted graph based on the spatial structure features; obtaining node feature vectors based on the amino acid node features and amino acid position features; determining edges and edge weights in the weighted graph when there is a peptide bond connection between two amino acids in the protein sequence, or when the spatial distance between two amino acids in the protein sequence is less than a preset threshold; and obtaining the weighted graph based on the nodes, the node feature vectors, the edges, and the edge weights. The weighted graph is input into the first and second units of the phenotypic prediction model to be trained, and a first vector and a second vector are obtained respectively; the protein sequence includes multiple sequences, the first unit is a graph neural network unit specific to each protein sequence, the second unit is a graph neural network unit shared by different protein sequences, and the phenotypic prediction model is StrucGAT-DRTB. Stack the first vectors into a first matrix, and stack the second vectors into a second matrix; Determine the fusion matrix of the first matrix and the second matrix, classify the fusion matrix, and obtain the predicted phenotype output by the phenotype prediction model to be trained; The phenotypic prediction model to be trained is trained based on the cross-entropy between the predicted phenotypic and the standard phenotypic to obtain a trained phenotypic prediction model.

5. A phenotypic prediction device, characterized in that, The device includes: The first acquisition module is used to acquire the protein sequence of the test sample; The first estimation module is used to estimate the spatial structure features and amino acid node features of the protein sequence; the amino acid node features reflect the amino acids contained in the protein sequence, and the spatial structure features reflect the spatial positions of the amino acids in the protein sequence. The first generation module is used to determine a weighted graph of the protein sequence based on the spatial structure features and the amino acid node features; The first generation module is further configured to determine the nodes in the weighted graph based on the spatial structure features, obtain the node feature vector based on the amino acid node features and amino acid position features, determine the edges and edge weights in the weighted graph when there is a peptide bond between two amino acids in the protein sequence or when the spatial distance between two amino acids in the protein sequence is less than a preset threshold, and obtain the weighted graph based on the nodes, the node feature vectors, the edges and the edge weights. The first prediction module is used to input the weighted graph into the first and second units of the trained phenotypic prediction model to obtain a first vector and a second vector, respectively. The first vector is stacked into a first matrix, and the second vector is stacked into a second matrix. The fusion matrix of the first matrix and the second matrix is ​​determined, and the fusion matrix is ​​classified to obtain the phenotypic prediction result of the detected sample. The protein sequence includes multiple sequences. The first unit is a graph neural network unit specific to each protein sequence, and the second unit is a graph neural network unit shared by different protein sequences. The phenotypic prediction model is StrucGAT-DRTB.

6. The apparatus according to claim 5, characterized in that, The first generation module is further configured to perform position encoding on the amino acids in the protein sequence to obtain the amino acid position features of the protein sequence; the amino acid position features reflect the arrangement position of the amino acids in the protein sequence.

7. The apparatus according to claim 5, characterized in that, The first prediction module is further configured to obtain the fusion matrix based on the product of the first matrix and the second matrix; or, based on a multi-head self-attention mechanism, determine the fusion matrix of the first matrix and the second matrix.

8. A phenotypic prediction model training device, characterized in that, The device includes: The second acquisition module is used to acquire the protein sequence of the training sample and the standard phenotype corresponding to the training sample; The second estimation module is used to estimate the spatial structure features and amino acid node features of the protein sequence; the amino acid node features reflect the amino acids contained in the protein sequence, and the spatial structure features reflect the spatial positions of the amino acids in the protein sequence. The second generation module is used to determine a weighted graph of the protein sequence based on the spatial structure features and the amino acid node features; The second generation module is further configured to determine the nodes in the weighted graph based on the spatial structure features, obtain the node feature vector based on the amino acid node features and amino acid position features, determine the edges and edge weights in the weighted graph when there is a peptide bond between two amino acids in the protein sequence or when the spatial distance between two amino acids in the protein sequence is less than a preset threshold, and obtain the weighted graph based on the nodes, the node feature vectors, the edges and the edge weights. The second prediction module is used to input the weighted graph into the first and second units of the phenotypic prediction model to be trained, obtain a first vector and a second vector respectively, stack the first vector into a first matrix, stack the second vector into a second matrix, determine the fusion matrix of the first matrix and the second matrix, classify the fusion matrix, and obtain the predicted phenotype output by the phenotypic prediction model to be trained; the protein sequence includes multiple sequences, the first unit is a graph neural network unit specific to each protein sequence, the second unit is a graph neural network unit shared by different protein sequences, and the phenotypic prediction model is StrucGAT-DRTB; The model training module is used to train the phenotypic prediction model to be trained based on the cross-entropy between the predicted phenotypic and the standard phenotypic, so as to obtain the trained phenotypic prediction model.

9. 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 4.

10. 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 4.