A method, device, equipment and medium for classifying metagenomic data

Through multi-level classification hierarchical model and convolution feature extraction, the multi-classification and interpretability problems of metagenomic data classification in the prior art are solved, and accurate classification of metagenomic data and high-precision species characteristics are achieved.

CN118645149BActive Publication Date: 2024-11-08ACADEMY OF MILITARY MEDICAL SCIENCES
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411124021.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2024-11-08
Estimated Expiration
2044-08-16

AI Technical Summary

Technical Problem

The existing metagenomic data classification methods based on deep learning have shortcomings in multi-classification and interpretability, making it difficult to accurately realize multi-level classification of biological sequences, and have poor interpretation of semantic relationships of biological sequence data.

Method used

Using multiple parallel connected classification hierarchical models, including classification hierarchies of boundaries, phylums, genus, or species, they are classified by slicing the base sequence and using the trained classification model to combine shared convolutional layers and One-dimensional convolution feature extraction increases the biological interpretability of the model.

Benefits of technology

Accurate multi-classification of metagenomic data, can determine the boundaries, phylums, classes, orders, families, genus or species of base sequences, improve classification accuracy and interpretability, and from short and disordered data Obtain effective information about species.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118645149B_ABST
    Figure CN118645149B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and medium for classifying metagenomic data, and relates to the technical field of biological sequence classification. The trained classification model includes multiple classification layers connected in parallel, each classification layer corresponds to a classification level, and different classification layers correspond to different classification levels, and the classification levels are kingdom, phylum, class, order, family, genus or species. When classifying metagenomic data, for each base sequence, the base sequence is segmented to obtain multiple segmented sequences. The segmented sequences are used as inputs, and the classification results of the segmented sequences are determined using the trained classification model. The classification results of the base sequences are determined based on the classification results of all segmented sequences corresponding to the base sequences, so that the accurate classification of the base sequences at multiple classification levels can be completed simultaneously, and the categories of the base sequences in kingdom, phylum, class, order, family, genus or species can be determined, and the interpretability is strong.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of biological sequence classification, and in particular to a metagenomic data classification method, device, equipment and medium. Background Art

[0002] Metagenome is defined as the sum of all the genetic material of all microorganisms in a certain environment. Metagenome includes not only the genetic properties of microbial communities, but also the complex relationships between these microorganisms. Metagenomics is the study of genome sequences (i.e., metagenomic data) obtained directly from the environment using metagenomic sequencing technology. Instead of culturing the microorganisms in the metagenomic samples, metagenomic sequencing technology directly extracts DNA (deoxyribonucleic acid) from the metagenomic samples, and then assembles and splices to obtain the genome sequences of all microorganisms in the metagenomic samples. This method can effectively avoid contamination from the outside during the cultivation process. Metagenomic technology has become an increasingly popular research field in the past decade. In projects studying various environments such as seawater, acid mine drainage and the human body, metagenomic technology allows researchers to create a picture of microbial life in the environment without isolating and culturing individual microorganisms. Combined with the ability to rapidly sequence DNA, metagenomic technology can generate a large number of sequence sequences to describe these previously invisible worlds. Many large-scale metagenomic assembly efforts have reconstructed thousands of new, uncultured species from metagenomic samples, greatly expanding the known diversity of microbial communities in specific habitats (such as the human intestine).

[0003] In metagenomics research, it is necessary to obtain the genetic information of microorganisms. Since metagenomic data is obtained directly from the environment, metagenomic data usually contains multiple microorganisms, each of which contains a large number of sequencing sequences, while the number of microorganisms and species relationships are unknown. Therefore, metagenomics research first needs to separate sequencing sequences of different species relationships and aggregate sequencing sequences of the same species relationship, that is, the metagenomic packing problem (also known as metagenomic data classification). Metagenomic data classification plays a vital role in metagenomic analysis. Only by correctly and reasonably classifying can subsequent species abundance analysis, functional analysis, new species discovery and other studies be carried out. However, the amount of metagenomic data is large, the types are numerous, and it is difficult to classify. In particular, the emergence of high-throughput sequencing technology has made sequencing faster and cheaper, while generating a large number of fragmented reads (i.e., base sequences, also known as short-read sequence data). These reads are often short in length, and it is impossible to directly obtain the source of these reads, let alone the source species of these reads. This has brought unprecedented challenges to the problem of metagenomic data classification. How to obtain effective information about species from these short, disordered reads and restore the relevant characteristics of species has become an important research issue in the field of bioinformatics.

[0004] For most metagenomic samples, the species, genera and even phyla present in the metagenomic samples are largely unknown at the time of sequencing. The goal of sequencing is to determine the species relationship of this microorganism as accurately as possible. Many species have some detectable similarities with known species, and this similarity can be detected by sensitive alignment algorithms. The most famous such algorithm is the BLAST program (Basic Local Alignment Search Tool), which can find the sequence with the highest similarity to the sequence to be classified in a large genome sequence database in order to classify the sequence to be classified. Although the BLAST program is not designed for the problem of metagenomic data classification, it is easily adapted to this problem and it is one of the best methods available.

[0005] However, the essence of the above method is to establish a large genome sequence database containing sequences of multiple species, and match the sequence to be classified with each sequence in the large genome sequence database to complete the classification process, which is time-consuming. In order to solve this problem, a classification method based on deep learning has been proposed. Deep learning is an advanced machine learning algorithm that uses deep artificial neural networks to learn features from inputs and predict outputs. In related issues such as virus and bacteriophage sequence recognition, the classification method based on deep learning has made major breakthroughs, and the classification efficiency has been significantly improved.

[0006] However, in the field of metagenomic data classification, the application of deep learning-based classification methods is relatively limited. Existing deep learning-based classification methods include biological sequence classification methods based on CNN (Convolutional Neural Network) and LSTM (Long Short Term Memory). The above methods only perform simple binary or ternary classification on biological sequences. For multi-classification or even more comprehensive classification on metagenomic data, the classification accuracy is low; moreover, the above methods are limited to simple classification fitting of biological sequences, ignoring the classification hierarchical semantic relationship between "kingdom, phylum, class, order, family, genus, and species" of biological sequence data itself, and have poor interpretability.

[0007] Therefore, there is an urgent need for a classification technology that can achieve accurate multi-classification and has strong interpretability. Summary of the invention

[0008] The purpose of this application is to provide a metagenomic data classification method, device, equipment and medium that can achieve accurate multi-classification and strong interpretability.

[0009] To achieve the above objectives, this application provides the following solutions.

[0010] In a first aspect, the present application provides a method for classifying metagenomic data, the method comprising:

[0011] Acquiring metagenomic data; the metagenomic data includes a plurality of base sequences;

[0012] For each of the base sequences, segmenting the base sequence to obtain a plurality of segmented sequences;

[0013] For each segmentation sequence, the segmentation sequence is used as input, and a classification result of the segmentation sequence is determined using a trained classification model; the trained classification model includes a plurality of classification layers connected in parallel, each of the classification layers corresponds to a classification level, different classification layers correspond to different classification levels, and the classification levels are kingdom, phylum, class, order, family, genus or species; the classification result of the segmentation sequence includes an initial category output by each classification layer, and the initial category is a category in the classification level corresponding to the classification layer;

[0014] For each of the base sequences, a classification result of the base sequence is determined based on the classification results of all segmentation sequences corresponding to the base sequence; the classification result of the base sequence includes a final category output by each of the classification layers.

[0015] Optionally, the trained classification model also includes: an input layer and a shared convolutional layer; the output end of the input layer is connected to the input end of the shared convolutional layer; the output end of the shared convolutional layer is respectively connected to the input end of each of the classification layers; wherein the shared convolutional layer includes a plurality of convolutional layers connected in sequence; the classification layer includes a convolutional layer, a pooling layer, an activation function layer and a fully connected layer connected in sequence; the convolutional layer adopts one-dimensional convolution.

[0016] Optionally, before determining the classification result of the base sequence based on the classification results of all segmentation sequences corresponding to the base sequence, the metagenomic data classification method further includes: screening the classification results of the segmentation sequences to obtain a screened result, and using the screened result as a new classification result;

[0017] The classification results of the segmented sequence are screened to obtain the screened results, which specifically include:

[0018] For each of the classification layers, determine whether the probability of the initial category output by the classification layer in the classification results of the segmented sequence is greater than the probability threshold corresponding to the classification layer; if not, remove the initial category output by the classification layer from the classification results of the segmented sequence to filter the classification results of the segmented sequence to obtain a filtered result; the probability is output by the trained classification model.

[0019] Optionally, determining the classification result of the base sequence based on the classification results of all segmentation sequences corresponding to the base sequence specifically includes:

[0020] For each of the classification layers, perform steps 1 and 2:

[0021] Step 1: for each category in the classification level corresponding to the classification layer, according to the classification results of all segmentation sequences corresponding to the base sequence, determine the total number of segmentation sequences whose initial category output by the classification layer is the same as the category, and obtain the weight of the category; add the probabilities of the segmentation sequences whose initial category output by the classification layer is the same as the category, and obtain the total probability of the category; multiply the weight of the category by the total probability of the category, and obtain the weight score of the category; the probability is output by the trained classification model;

[0022] Step 2, selecting the category with the highest weight score as the final category output by the classification layer;

[0023] The final categories output by all the classification layers constitute the classification result of the base sequence.

[0024] Optionally, before taking the segmented sequence as input and using a trained classification model to determine the classification result of the segmented sequence, the metagenomic data classification method also includes: training the initial classification model to obtain a trained classification model; wherein, when training the initial classification model, the loss function used is the weighted sum of the cross entropy loss functions of each classification layer.

[0025] Optionally, taking the segmentation sequence as input and using a trained classification model to determine a classification result of the segmentation sequence specifically includes:

[0026] Performing one-hot encoding on the segmented sequence to obtain encoding features corresponding to the segmented sequence;

[0027] The encoding feature is used as input and the classification result of the segmented sequence is determined using the trained classification model.

[0028] Optionally, before segmenting the base sequence to obtain a plurality of segmented sequences, the metagenomic data classification method further includes: performing reverse complementation processing on the base sequence to obtain a double-stranded sequence, and using the double-stranded sequence as a new base sequence.

[0029] In a second aspect, the present application provides a metagenomic data classification device, the metagenomic data classification device comprising:

[0030] A data acquisition module, used to acquire metagenomic data; the metagenomic data includes a plurality of base sequences;

[0031] A segmentation module, used for segmenting each of the base sequences to obtain a plurality of segmentation sequences;

[0032] A classification module, for determining the classification result of each segmentation sequence using a trained classification model with the segmentation sequence as input; the trained classification model comprises a plurality of classification layers connected in parallel, each of the classification layers corresponds to a classification level, different classification layers correspond to different classification levels, and the classification levels are kingdom, phylum, class, order, family, genus or species; the classification result of the segmentation sequence comprises an initial category output by each classification layer, and the initial category is a category in the classification level corresponding to the classification layer;

[0033] An integration module is used to determine the classification result of each base sequence based on the classification results of all segmentation sequences corresponding to the base sequence; the classification result of the base sequence includes the final category output by each classification layer.

[0034] In a third aspect, the present application provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any of the metagenomic data classification methods described above.

[0035] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described metagenomic data classification methods.

[0036] According to the specific embodiments provided in this application, this application discloses the following technical effects:

[0037] The present application provides a method, apparatus, device and medium for classifying metagenomic data. The trained classification model includes multiple classification layers connected in parallel, each classification layer corresponds to a classification level, different classification layers correspond to different classification levels, and the classification levels are kingdom, phylum, class, order, family, genus or species. When classifying metagenomic data, for each base sequence, the base sequence is segmented to obtain multiple segmented sequences. The segmented sequences are used as inputs, and the classification results of the segmented sequences are determined using the trained classification model. The classification results of the base sequences are determined based on the classification results of all segmented sequences corresponding to the base sequences. The classification results of the base sequences include the final categories output by each classification layer. Therefore, by designing the structure of the trained classification model, the accurate classification of base sequences at multiple classification levels can be completed simultaneously, and the categories of base sequences in kingdom, phylum, class, order, family, genus or species can be determined, and the interpretability is strong. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0039] Figure 1 This is an application environment diagram of a metagenomic data classification method provided in Example 1 of the present application.

[0040] Figure 2 A schematic diagram of a process for classifying metagenomic data provided in Example 1 of the present application.

[0041] Figure 3 A schematic diagram of the network structure of the trained classification model provided in Example 1 of the present application.

[0042] Figure 4 Schematic diagram of the one-dimensional convolution provided in Example 1 of the present application.

[0043] Figure 5 Schematic diagram of the classification hierarchy of the 12 respiratory pathogens provided in Example 1 of the present application.

[0044] Figure 6 A schematic diagram of the functional modules of a metagenomic data classification device provided in Example 2 of the present application.

[0045] Figure 7 A schematic diagram of the structure of a computer device provided in Example 3 of the present application. DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0047] Example 1

[0048] The metagenomic data classification method provided in this embodiment can be applied to Figure 1 In the application environment shown. Among them, the terminal communicates with the server through the network. The data storage system can store the data that the server needs to process. The data storage system can be set up separately, integrated on the server, or placed on the cloud or other servers. The terminal can send the metagenome data to be processed to the server. After the server receives the metagenome data to be processed, for the metagenome data to be processed, the server segments each base sequence in the metagenome data to obtain multiple segmentation sequences; for each segmentation sequence, the segmentation sequence is used as input, and the classification result of the segmentation sequence is determined using the trained classification model; for each base sequence, the classification result of the base sequence is determined based on the classification results of all segmentation sequences corresponding to the base sequence. The server can feedback the classification result obtained for each base sequence in the metagenome data to the terminal.

[0049] In addition, in some embodiments, the metagenomic data classification method can also be implemented independently by a server or a terminal. For example, the terminal can directly classify the metagenomic data to be processed, or the server can obtain the metagenomic data to be processed from the data storage system and classify the metagenomic data to be processed.

[0050] like Figure 2As shown, this embodiment provides a method for classifying metagenomic data. The method is executed by a computer device, and can be executed by a computer device such as a terminal or a server alone, or by a terminal and a server together. In this embodiment, the method is applied to Figure 1 Taking the server in as an example, the metagenomic data classification method includes the following steps.

[0051] S1: Acquire metagenomic data; the metagenomic data includes multiple base sequences.

[0052] S2: For each of the base sequences, the base sequence is segmented to obtain a plurality of segmented sequences.

[0053] S3: For each of the segmented sequences, the segmented sequence is taken as input, and a classification result of the segmented sequence is determined using a trained classification model; the trained classification model includes a plurality of classification layers connected in parallel, each of the classification layers corresponds to a classification level, different classification layers correspond to different classification levels, and the classification levels are kingdom, phylum, class, order, family, genus or species; the classification result of the segmented sequence includes an initial category output by each of the classification layers, and the initial category is a category in the classification level corresponding to the classification layer.

[0054] S4: For each of the base sequences, based on the classification results of all segmentation sequences corresponding to the base sequence, determine the classification result of the base sequence; the classification result of the base sequence includes the final category output by each of the classification layers.

[0055] By implementing the above-mentioned steps S1 to S4, this embodiment is based on a deep hierarchical network, and the classification hierarchical semantic information between species is integrated into the model construction process to obtain a trained classification model. The trained classification model is subsequently used to classify each base sequence in the metagenomic data to determine the kingdom, phylum, class, order, family, genus and species to which the base sequence belongs. It can complete multiple classifications with high classification accuracy, and at the same time increase the biological interpretability of the model, so as to obtain effective information about species from short and disordered data and restore the relevant characteristics of species.

[0056] In S1, the metagenomic samples are sequenced by a high-throughput sequencing method to obtain metagenomic data, which includes multiple base sequences (i.e., reads).

[0057] Taking into account the double-stranded structure of the base sequence, before splitting the base sequence to obtain multiple split sequences, the metagenomic data classification method of this embodiment also includes: performing reverse complementation processing on the base sequence to obtain a complete double-stranded sequence, and using the double-stranded sequence as a new base sequence to perform the splitting process in S2.

[0058] In S2, for each base sequence, the base sequence is segmented, specifically, the base sequence can be segmented into k-mer short sequences (sequences including k base pairs), and multiple segmented sequences are obtained. Of course, other segmentation methods can also be performed as needed, as long as the number of base pairs in the segmented sequences obtained finally is guaranteed to be consistent.

[0059] In S3, for each segmented sequence, the segmented sequence is used as input, and the classification result of the segmented sequence is determined using the trained classification model, specifically including: performing one-hot encoding on the segmented sequence to obtain the encoding features corresponding to the segmented sequence, using the encoding features as input, and determining the classification result of the segmented sequence using the trained classification model.

[0060] The specific method of one-hot encoding is as follows: for each base in the split sequence, if the type of the base is A (adenine), the encoding of the base is [1, 0, 0, 0]; if the type of the base is C (cytosine), the encoding of the base is [0, 1, 0, 0]; if the type of the base is T (thymine), the encoding of the base is [0, 0, 1, 0]; if the type of the base is G (guanine), the encoding of the base is [0, 0, 0, 1]; if the type of the base is N (unknown), that is, the base is an unknown base, then the encoding of the base is [1 / 4, 1 / 4, 1 / 4, 1 / 4]. The encoding feature corresponding to the split sequence is the encoding of each base arranged in order, and the dimension is K 4, K represents the number of bases included in the segmented sequence, that is, the length of the sequence. One-hot encoding expands the value of discrete features to Euclidean space, making the distance calculation between features more reasonable. The discrete features are one-hot encoded. In the encoded features obtained by one-hot encoding, the features of each dimension can be regarded as continuous features.

[0061] In this embodiment, the trained classification model adopts a hierarchical model architecture similar to B-CNN (Branch Convolutional Neural Network) to ensure that for each input segmentation sequence, a hierarchical classification result can be obtained, thereby increasing the interpretability of the classification. Specifically, in the trained classification model, the features extracted by the convolution kernel have hierarchical characteristics, and the classification results actually also contain hierarchical information from coarse-grained to fine-grained. The granularity gradually becomes finer in the order of kingdom, phylum, class, order, family, genus, and species. As the network deepens, the network outputs the finer initial categories. There are both similarities and differences between the various classification layers. The similarities are that they share a part of the convolution layer to extract common feature information, and the difference is that each classification layer has its own convolution layer, pooling layer, activation function layer, and fully connected layer to extract the unique feature information at the classification level.

[0062] In this embodiment, Figure 3 As shown, the trained classification model includes an input layer, a shared convolution layer and multiple classification layers connected in parallel, the output end of the input layer is connected to the input end of the shared convolution layer, and the output end of the shared convolution layer is respectively connected to the input end of each classification layer. Among them, the shared convolution layer includes multiple convolution layers connected in sequence, and specifically may include 2 convolution layers, and the classification layer includes a convolution layer, a pooling layer, an activation function layer and a fully connected layer connected in sequence. Each classification layer corresponds to a classification level, and different classification layers correspond to different classification levels. The classification levels are kingdom, phylum, class, order, family, genus or species, and each classification level includes multiple categories. The number of classification layers depends on user needs. If the user wants to train a classification model that can distinguish between phyla and species, the classification layer is two layers.

[0063] Sequence classification problems are different from image classification problems. For traditional image classification problems, people tend to use two-dimensional convolution to extract features in the length and width of the entire image. For sequence classification problems, when convolution is used to deal with this problem, it only needs to extract features in the dimension of sequence length. The role of one-dimensional convolution is to deal with feature extraction problems in one dimension. Therefore, in this embodiment, the convolution layer in the shared convolution layer and the convolution layer in the classification layer both use one-dimensional convolution. Figure 4 As shown in the figure, the one-dimensional convolution performs a convolution operation on the dimension of the sequence length of the segmented sequence, which can extract the local features of the segmented sequence and increase the receptive field through multi-layer convolution to obtain information in a longer direction, thereby mining the potential information of the sequence data.

[0064] The activation function is used to introduce nonlinear factors into the neural network. Through the activation function, the neural network can fit various curves. If the activation function is not used, the output of each layer is a linear function of the input of the previous layer. No matter how many layers the neural network has, the output is a linear combination of the input. After using the activation function, the neuron is given a nonlinear factor, so that the neural network can approximate any function. In this embodiment, ReLU is selected as the activation function, that is, the activation function layer adopts the ReLU activation function, and its mathematical expression is as follows:

[0065] ;

[0066] in, is the output feature; is the input feature; Indicates taking 0 and The maximum value in is used as the output feature. The ReLU activation function solves the problem of gradient disappearance. Since ReLU has the characteristics of linearity and non-saturation, it can converge quickly in the stochastic gradient descent optimizer.

[0067] Consider that after a segmentation sequence is trained with a classification model, multiple initial categories will be obtained, that is, labels of multiple classification levels will be obtained. The labels of each classification level represent the classification results of the segmentation sequence at this classification level. In fact, it is hoped that the classification results of the segmentation sequence only correspond to a certain node on the classification tree. The classification tree includes multiple layers, each layer corresponds to a classification level, and the number of nodes in this layer is equal to the total number of classification levels corresponding to this layer. The connection relationship between the nodes of adjacent layers is determined according to the actual inclusion relationship. If the trained classification model only includes two classification levels of phylum and species, and the phylum category A includes the species category B and category C, then the nodes corresponding to category A are respectively connected to the nodes corresponding to category B and the nodes corresponding to category C, which requires the classification results of the segmentation sequence to be screened. Since the output of the neural network is a probability value, the classification results of the segmentation sequence are screened by setting a threshold. Different probability thresholds such as 0.9, 0.99, 0.9999, and 0.999999 can be set for the initial categories of each layer. The specific threshold setting can be determined by experiments. If the probability of the initial category exceeds the probability threshold, the classification is considered to be credible. During screening, the classification results of the segmented sequence are screened from fine-grained to coarse-grained by a probability threshold to obtain a node on the classification tree corresponding to a high confidence level.

[0068] Before determining the classification result of the base sequence based on the classification results of all segmentation sequences corresponding to the base sequence, the metagenomic data classification method of this embodiment also includes: screening the classification results of the segmentation sequences to obtain the screened results, and using the screened results as new classification results to execute S4.

[0069] Among them, the classification results of the segmentation sequence are screened to obtain the screened results, specifically including: for each classification layer, judging whether the probability of the initial category output by the classification layer in the classification results of the segmentation sequence is greater than the probability threshold corresponding to the classification layer; if not, removing the initial category output by the classification layer in the classification results of the segmentation sequence to screen the classification results of the segmentation sequence to obtain the screened results, and the probability is output by the trained classification model.

[0070] It should be noted that for each classification layer, when the trained classification model performs classification, it will output the probability that the segmented sequence belongs to each category in the classification level corresponding to the classification layer, and select the category with the largest probability as the initial category.

[0071] For each base sequence, it is divided, and each segmented sequence obtained by the division corresponds to a node on the classification tree. According to the correspondence between this segmented sequence and the node, a simplified classification tree consisting of all nodes matching the segmented sequence and their parent nodes, parent nodes of the parent nodes... until the parent node at the top level can be obtained. In this simplified classification tree, the weight of each node is equal to the number of segmented sequences matching the node, and the total probability of each node is equal to the sum of the probabilities of the segmented sequences matching the node. The probability is output by the trained classification model, and the weight and the total probability are multiplied to obtain the weight score of the node. The path formed by the node with the largest weight score in each layer of the simplified classification tree is the final classification path of the base sequence, and the leaf node (i.e., the node at the bottom level) on this classification path is the classification result of the base sequence.

[0072] In S4, for each base sequence, the classification result of the base sequence is determined based on the classification results of all the segmentation sequences corresponding to the base sequence, specifically including: for each classification layer, executing steps 1 and 2: Step 1, for each category in the classification level corresponding to the classification layer, according to the classification results of all the segmentation sequences corresponding to the base sequence, determine the total number of segmentation sequences with the same initial category output by the classification layer and the category, and obtain the weight of the category; add the probability of the segmentation sequences with the same initial category output by the classification layer and the category (referring to the probability of the initial category) to obtain the total probability of the category; multiply the weight of the category and the total probability of the category to obtain the weight score of the category, and the probability is output by the trained classification model; Step 2: Select the category with the highest weight score as the final category output by the classification layer; The final categories output by all classification layers constitute the classification result of the base sequence.

[0073] Before taking the segmented sequence as input and using the trained classification model to determine the classification result of the segmented sequence, the metagenomic data classification method of this embodiment also includes: training the initial classification model to obtain a trained classification model, which specifically includes the following steps.

[0074] (1) Select the reference sequences of each sample species in the NCBI (National Center for Biotechnology Information) database as training data.

[0075] This embodiment can determine the classification level required for the classification model based on the genus-species relationship of the sample species, thereby generating an initial classification model.

[0076] (2) Taking into account the double-stranded structure of the reference sequence, each reference sequence is reverse-complemented to obtain a complete sample double-stranded sequence, and the sample double-stranded sequence is divided into multiple sample segmentation sequences, which can be k-mer short sequences.

[0077] (3) Taking into account the imbalance of data samples, for sample species with relatively short sequences, the sample segmentation sequences of the sample species are sampled by repeated sampling, so that the number of sample segmentation sequences included in each sample species is roughly the same, so as to achieve data balance and obtain a training data set.

[0078] (4) For the test data set, other sequence data of each sample species in the NCBI database were randomly selected as test data, and the test data were divided into two forms: k-mer and simulated metagenome to evaluate and analyze the model. For the test data in k-mer form, it was processed in the same way as the training data and divided into k-mer form. For the test data of simulated metagenome, the test data was divided into data of about 120~200bp in length to simulate the situation of classification under the real metagenome.

[0079] (5) Use the training data set to train the initial classification model to obtain a trained classification model.

[0080] Use one-hot encoding to encode the sample segmentation sequence.

[0081] When training the initial classification model, the loss function used is the weighted sum of the cross entropy loss functions of each classification layer.

[0082] There are multiple outputs in the classification model designed in this embodiment. Therefore, when designing the loss function, it is not simply equivalent to the loss function of the traditional classification layer. The loss of multiple outputs needs to be considered during the design. The loss function of the classification model is defined as follows:

[0083] ;

[0084] in, for loss; is the total number of classification layers; For the The weight of the loss function of the layer is used to represent the The importance of the layer to the entire loss function; Indicates The cross entropy loss function of the layer, For the Tier The probability of the category, The categories represent real categories; For the Tier The probability of the category, all probabilities are predicted probabilities, output by the classification model.

[0085] The final loss function takes into account the loss function of each classification level, and the setting of the loss function weights gives different classification levels different degrees of importance. The design of such a weighted loss function enables the classification model of this embodiment to become various forms of classification models. Assuming that the weights are all set at the first layer, then the classification model of this embodiment is equivalent to classification at the first layer. If the weights are all set at the last layer, then the classification model of this embodiment is equivalent to classification at the last layer. The weights can be adjusted during the training process. The weights of different classification layers are dynamically adjusted in a large and small way, making the entire training process more flexible. This adjustment strategy can dynamically adjust the part of the training process that you want to focus on as you wish.

[0086] (6) Use the test data set to test the trained classification model and evaluate its performance.

[0087] In this embodiment, the error rate ( )、Sensitivity( )、Recall( )、Accuracy( ) and the k-th layer proportion ( Five indicators are used to evaluate the performance of the trained classification model in different situations.

[0088] The error rate can be expressed as:

[0089] ;

[0090] in, Indicates the number of misclassified segmentation sequences; Indicates the total number of segmentation sequences.

[0091] The error rate can also be expressed as:

[0092] ;

[0093] in, Indicates the number of misclassified base sequences; Indicates the total number of base sequences.

[0094] The error rate in this embodiment is the ratio of the number of incorrectly classified segmentation sequences or base sequences to the total number of segmentation sequences or base sequences.

[0095] Sensitivity can be expressed as:

[0096] ;

[0097] in, Indicates the number of classified segmentation sequences.

[0098] Sensitivity can also be expressed as:

[0099] ;

[0100] in, Indicates the number of classified base sequences.

[0101] The sensitivity in this embodiment is the ratio of the number of classified segmentation sequences or base sequences to the total number of segmentation sequences or base sequences.

[0102] The expression of recall is:

[0103] ;

[0104] in, Indicates the number of correctly classified base sequences.

[0105] The recall rate in this embodiment is the ratio of the number of correctly classified base sequences to the total number of base sequences.

[0106] The expression of precision is:

[0107] ;

[0108] The accuracy rate in this embodiment is the ratio of the number of correctly classified base sequences to the number of classified base sequences.

[0109] The expression of the k-th layer ratio is:

[0110] ;

[0111] in, Represents the number of base sequences classified correctly at the kth layer.

[0112] The k-th layer proportion in this embodiment is the ratio of the number of correctly classified base sequences in the k-th layer to the number of correctly classified base sequences.

[0113] This embodiment can reduce the false positive rate, improve the recall rate and precision, thereby achieving the effect of improving the accuracy of biological sequence classification, and has high flexibility.

[0114] This embodiment uses respiratory pathogen detection as an example to implement classification and identification of respiratory metagenomic data. 12 common clinical respiratory bacterial pathogens are selected, namely: Haemophilus influenzae, Streptococcus pneumoniae, Stenotrophomonas maltophilia, Legionella pneumophila, Staphylococcus aureus, Pseudomonas aeruginosa, Klebsiella pneumoniae, Acinetobacter baumannii, Mycobacterium tuberculosis, Streptococcus pyogenes, Mycoplasma pneumoniae and Chlamydia pneumoniae. Based on the genus-species relationship of these 12 respiratory bacterial pathogens, two classification layers are used for these 12 respiratory bacterial pathogens, and they are classified at the two classification levels of phylum and species. The specific classification relationship of the 12 respiratory bacterial pathogens is as follows. Figure 5 As shown, the three layers from top to bottom are the root node, the phylum classification node, and the species classification node. The first layer is the root node, which represents the nodes that are not initially classified, including 12 respiratory bacterial pathogens. The second layer is the phylum classification node, among which node 0 represents the Pseudomonas phylum, node 1 represents the Bacteroidetes phylum, node 2 represents the Actinobacteria phylum, node 3 represents the Mycoplasma phylum, and node 4 represents the Chlamydia phylum. The third layer is the species classification node, among which node 0 is Haemophilus influenzae, node 1 is Streptococcus pneumoniae, and node 2 is Stenotrophomonas maltophilia. Node 3 is Legionella pneumophila, node 4 is Staphylococcus aureus, node 5 is Pseudomonas aeruginosa, node 6 is Klebsiella pneumoniae, node 7 is Acinetobacter baumannii, node 8 is Mycobacterium tuberculosis, node 9 is Streptococcus pyogenes, node 10 is Mycoplasma pneumoniae, and node 11 is Chlamydia pneumoniae. It should be noted that the nodes in the third-level species classification nodes that are connected to the second-level phylum classification nodes indicate that they belong to the corresponding "phylum" in the second-level phylum classification nodes, such as node 0 and node 2, etc., which belong to the Pseudomonas phylum.

[0115] The training data set of the above 12 respiratory bacterial pathogens was constructed as shown in Table 1.

[0116] Table 1 Training dataset

[0117]

[0118] The training data set is used to train the initial classification model to obtain a trained classification model, which can then be used to accurately classify 12 respiratory bacterial pathogens.

[0119] This embodiment also provides an application scenario, which applies the above-mentioned metagenomic data classification method. Specifically, the metagenomic data classification method provided in this embodiment can be applied in a species identification scenario. The species identification scenario includes a data acquisition link, a data classification link, and a result display link. The metagenomic data is acquired through the data acquisition link, the metagenomic data is classified through the data classification link, and the classification results of each base sequence are displayed through the result display link. The metagenomic data classification method provided in this embodiment belongs to the data classification link.

[0120] Example 2

[0121] Based on the same inventive concept, this embodiment also provides a metagenomic data classification device for implementing the metagenomic data classification method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the metagenomic data classification device provided below can refer to the limitations of the metagenomic data classification method above, and will not be repeated here.

[0122] like Figure 6 As shown, this embodiment provides a metagenomic data classification device, and the metagenomic data classification device includes the following modules.

[0123] The data acquisition module M1 is used to acquire metagenomic data; the metagenomic data includes a plurality of base sequences.

[0124] The segmentation module M2 is used for segmenting each of the base sequences to obtain a plurality of segmentation sequences.

[0125] The classification module M3 is used for determining the classification result of each segmentation sequence using a trained classification model with the segmentation sequence as input; the trained classification model includes a plurality of classification layers connected in parallel, each of the classification layers corresponds to a classification level, different classification layers correspond to different classification levels, and the classification levels are kingdom, phylum, class, order, family, genus or species; the classification result of the segmentation sequence includes an initial category output by each classification layer, and the initial category is a category in the classification level corresponding to the classification layer.

[0126] The integration module M4 is used to determine the classification result of each base sequence based on the classification results of all segmentation sequences corresponding to the base sequence; the classification result of the base sequence includes the final category output by each classification layer.

[0127] Example 3

[0128] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store metagenomic data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a metagenomic data classification method is implemented.

[0129] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0130] In an exemplary embodiment, a computer device is also provided, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the metagenomic data classification method described in Example 1.

[0131] Example 4

[0132] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the metagenomic data classification method described in Embodiment 1 is implemented.

[0133] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, 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.

[0134] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A method for classifying metagenomic data, It is characterized in that The metagenomic data classification method comprises: Acquiring metagenomic data; the metagenomic data includes a plurality of base sequences; For each of the base sequences, segmenting the base sequence to obtain a plurality of segmented sequences; For each segmentation sequence, the segmentation sequence is used as input, and a classification result of the segmentation sequence is determined using a trained classification model; the trained classification model includes a plurality of classification layers connected in parallel, each of the classification layers corresponds to a classification level, different classification layers correspond to different classification levels, and the classification levels are kingdom, phylum, class, order, family, genus or species; the classification result of the segmentation sequence includes an initial category output by each classification layer, and the initial category is a category in the classification level corresponding to the classification layer; For each of the base sequences, based on the classification results of all the segmentation sequences corresponding to the base sequence, determining the classification result of the base sequence; the classification result of the base sequence includes the final category output by each of the classification layers; The trained classification model further includes: an input layer and a shared convolution layer; the output end of the input layer is connected to the input end of the shared convolution layer; the output end of the shared convolution layer is respectively connected to the input end of each of the classification layers; Determining the classification result of the base sequence based on the classification results of all segmentation sequences corresponding to the base sequence specifically includes: For each of the classification layers, perform steps 1 and 2: Step 1: for each category in the classification level corresponding to the classification layer, according to the classification results of all segmentation sequences corresponding to the base sequence, determine the total number of segmentation sequences whose initial category output by the classification layer is the same as the category, and obtain the weight of the category; add the probabilities of the segmentation sequences whose initial category output by the classification layer is the same as the category, and obtain the total probability of the category; multiply the weight of the category by the total probability of the category, and obtain the weight score of the category; the probability is output by the trained classification model; Step 2, selecting the category with the highest weight score as the final category output by the classification layer; The final categories output by all the classification layers constitute the classification result of the base sequence.

2. The method for classifying metagenomic data according to claim 1, It is characterized in that The shared convolution layer includes a plurality of convolution layers connected in sequence; the classification layer includes a convolution layer, a pooling layer, an activation function layer and a fully connected layer connected in sequence; and the convolution layer adopts one-dimensional convolution.

3. The method for classifying metagenomic data according to claim 1, It is characterized in that Before determining the classification result of the base sequence based on the classification results of all segmentation sequences corresponding to the base sequence, the metagenomic data classification method further includes: screening the classification results of the segmentation sequences to obtain a screened result, and using the screened result as a new classification result; The classification results of the segmented sequence are screened to obtain the screened results, which specifically include: For each of the classification layers, determine whether the probability of the initial category output by the classification layer in the classification results of the segmented sequence is greater than the probability threshold corresponding to the classification layer; if not, remove the initial category output by the classification layer from the classification results of the segmented sequence to filter the classification results of the segmented sequence to obtain a filtered result; the probability is output by the trained classification model.

4. The method for classifying metagenomic data according to claim 1, It is characterized in that Before taking the segmented sequence as input and using the trained classification model to determine the classification result of the segmented sequence, the metagenomic data classification method also includes: training the initial classification model to obtain the trained classification model; wherein, when training the initial classification model, the loss function used is the weighted sum of the cross entropy loss functions of each classification layer.

5. The method for classifying metagenomic data according to claim 1, It is characterized in that Taking the segmented sequence as input, using the trained classification model to determine the classification result of the segmented sequence specifically includes: Performing one-hot encoding on the segmented sequence to obtain encoding features corresponding to the segmented sequence; The encoding feature is used as input and the classification result of the segmented sequence is determined using the trained classification model.

6. The method for classifying metagenomic data according to claim 1, It is characterized in that Before segmenting the base sequence to obtain a plurality of segmented sequences, the metagenomic data classification method further comprises: performing reverse complementation processing on the base sequence to obtain a double-stranded sequence, and using the double-stranded sequence as a new base sequence.

7. A metagenomic data classification device, It is characterized in that The metagenomic data classification device comprises: A data acquisition module, used to acquire metagenomic data; the metagenomic data includes a plurality of base sequences; A segmentation module, used for segmenting each of the base sequences to obtain a plurality of segmentation sequences; A classification module, for determining the classification result of each segmentation sequence using a trained classification model with the segmentation sequence as input; the trained classification model comprises a plurality of classification layers connected in parallel, each of the classification layers corresponds to a classification level, different classification layers correspond to different classification levels, and the classification levels are kingdom, phylum, class, order, family, genus or species; the classification result of the segmentation sequence comprises an initial category output by each classification layer, and the initial category is a category in the classification level corresponding to the classification layer; An integration module, for determining, for each of the base sequences, a classification result of the base sequence based on the classification results of all segmentation sequences corresponding to the base sequence; the classification result of the base sequence includes a final category output by each of the classification layers; The trained classification model further includes: an input layer and a shared convolution layer; the output end of the input layer is connected to the input end of the shared convolution layer; the output end of the shared convolution layer is respectively connected to the input end of each of the classification layers; Determining the classification result of the base sequence based on the classification results of all segmentation sequences corresponding to the base sequence specifically includes: For each of the classification layers, perform steps 1 and 2: Step 1: for each category in the classification level corresponding to the classification layer, according to the classification results of all segmentation sequences corresponding to the base sequence, determine the total number of segmentation sequences whose initial category output by the classification layer is the same as the category, and obtain the weight of the category; add the probabilities of the segmentation sequences whose initial category output by the classification layer is the same as the category, and obtain the total probability of the category; multiply the weight of the category by the total probability of the category, and obtain the weight score of the category; the probability is output by the trained classification model; Step 2, selecting the category with the highest weight score as the final category output by the classification layer; The final categories output by all the classification layers constitute the classification result of the base sequence.

8. A computer device, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the metagenomic data classification method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the metagenomic data classification method described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Microbial gene sequence classification model method based on dynamic convolutional network

    CN108009402A

  • Metagenome sequencing data processing system based on IIB type restriction enzyme characteristics and processing method thereof

    CN114078568A

  • Method for clustering metagenome sequences by using double-layer probability model

    CN114446394A

  • Metagenome species reconstruction method based on pre-training and deep clustering

    CN115579068A

  • Construction method and construction system of clinical pathogenic microorganism metagenome database

    CN117316299A