Training method, identification method and electronic device for sequencing data contamination identification model
By performing quality filtering and feature extraction on sequencing data, merging sample and target contamination sequencing data, and training a supervised learning model, the problem of existing technologies being unable to identify the types and proportions of contamination in sequencing data is solved, and accurate contamination identification is achieved.
Patent Information
- Application Number
- CN202510847132.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2045-06-24
AI Technical Summary
Existing sequencing data contamination identification models are unable to determine the microbial contamination category corresponding to the contaminated data and the proportion of contaminated sequencing data.
By obtaining the original sequencing data, performing quality filtering and feature extraction, screening out the sample sequencing data, merging the sample sequencing data with the target category contamination sequencing data, generating the first training sequencing data, and inputting the pre-trained large language model, outputting the context features, generating the joint features of the sequencing data, training the supervised learning model, and determining the contamination category and proportion.
The system can identify the pollution categories of sequencing data and accurately output the pollution ratio, solving the problem of being unable to determine the pollution categories and ratios in the existing technology.
Smart Images

Figure CN120356517B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of sequencing data processing, and in particular to a training method, an identification method, and an electronic device for a sequencing data contamination identification model. Background Art
[0002] With the development of sequencing technology, users are increasingly concerned about the impact of microbial contamination on test data results. The sources of microbial contamination include the sampling process, sample cross-contamination, reagent contamination, and laboratory environment.
[0003] In the prior art, for identification of sequencing data contamination, existing sequencing data contamination identification models can identify data that differs greatly from normal sequencing data distribution as contaminated data corresponding to microbial contamination.
[0004] However, the existing sequencing data contamination identification model has the problem of being unable to determine the contamination category of the microbial contamination corresponding to the contaminated data and the contamination ratio of the sequencing data. Summary of the Invention
[0005] The training method, identification method, and electronic device for a sequencing data contamination identification model provided in the embodiments of the present application are used to address the problem that existing sequencing data contamination identification models are unable to determine the contamination category of microbial contamination corresponding to the contaminated data and the contaminated proportion of the sequencing data.
[0006] In a first aspect, an embodiment of the present application provides a method for training a sequencing data contamination identification model, comprising: obtaining original sequencing data, wherein the original sequencing data includes multiple original sequencing sequences; performing quality filtering on the original sequencing data to obtain initial sequencing data, wherein the initial sequencing data includes multiple initial sequencing sequences; performing feature extraction on the initial sequencing data to obtain data contamination features; screening the initial sequencing data based on the data contamination features to obtain sample sequencing data; wherein the sample sequencing data includes multiple sample sequencing sequences; determining target category contaminated sequencing data from multiple categories of preset contaminated sequencing data based on the data contamination features; the target category contaminated sequencing data includes a one or more contaminated sequencing sequences; merging the sample sequencing data and the target category contaminated sequencing data to obtain first training sequencing data; wherein the ratio of the number of sample sequencing sequences to the number of contaminated sequencing sequences in the first training sequencing data is a preset contamination ratio; performing feature extraction on the first training sequencing data to generate a first data structure feature; inputting the first training sequencing data into a pre-trained large language model to output a context feature; generating a sequencing data joint feature based on the first data structure feature and the context feature; training a supervised learning model based on the sequencing data joint feature to obtain a target supervised learning model; and obtaining a sequencing data contamination identification model based on the target supervised learning model.
[0007] In one possible embodiment, the supervised learning model includes a gradient classifier model and a neural network model; the supervised learning model is trained according to the joint features of the sequencing data to obtain a target supervised learning model, including: training the gradient classifier model according to the joint features of the sequencing data to obtain the area under a first receiver operating characteristic curve; training the neural network model according to the joint features of the sequencing data to obtain the area under a second receiver operating characteristic curve; if the area under the first receiver operating characteristic curve is greater than or equal to a preset area threshold under the receiver operating characteristic curve, the trained gradient classifier model is determined as the target gradient classifier model; if the area under the first receiver operating characteristic curve is less than the preset receiver operating characteristic curve, the trained neural network model is determined as the target gradient classifier model. If the area under the receiver operating characteristic curve is greater than or equal to the area threshold under the preset receiver operating characteristic curve, the trained neural network model is determined as the target neural network model; if the area under the second receiver operating characteristic curve is less than the area threshold under the preset receiver operating characteristic curve, the training step of the neural network model according to the joint features of the sequencing data is returned to, and the area under the second receiver operating characteristic curve is obtained; the target supervised learning model is obtained based on the target gradient classifier model and the target neural network model.
[0008] In a possible embodiment, after obtaining the sequencing data contamination identification model according to the target supervised learning model, the method further includes: merging the sample sequencing data and the target category contaminated sequencing data to obtain second training sequencing data; wherein the ratio of the number of sample sequencing sequences to the number of contaminant sequencing sequences in the second training sequencing data is an arbitrary ratio; performing feature extraction on the second training sequencing data to generate a second data structure feature; training an unsupervised learning model according to the second data structure feature to obtain a target unsupervised learning model; and obtaining a merged sequencing data contamination identification model according to the target unsupervised learning model and the sequencing data contamination identification model.
[0009] In one possible implementation, the unsupervised learning model includes an autoencoder and a clustering model; the training of the unsupervised learning model according to the second data structure feature to obtain a target unsupervised learning model includes: training the autoencoder according to the second data structure feature to determine a reconstruction error threshold; training the clustering model according to the second data structure feature to determine an intra-cluster distance threshold; and obtaining a target unsupervised learning model based on the reconstruction error threshold, the intra-cluster distance threshold, the autoencoder, and the clustering model.
[0010] In a possible embodiment, the method of determining target category contaminated sequencing data from multiple categories of preset contaminated sequencing data based on the data contamination characteristics includes: determining species category characteristics based on the data contamination characteristics; determining contaminated species based on the species category characteristics; and determining target category contaminated sequencing data from multiple categories of preset contaminated sequencing data based on the genome sequence of the contaminant species.
[0011] In a possible embodiment, after determining the target category contaminated sequencing data from multiple categories of preset contaminated sequencing data based on the genome sequence of the contaminating species, the method further includes: determining a GC content deviation from the data contamination characteristics; processing the bases of one or more sample sequencing sequences based on the GC content deviation to generate sample contaminated sequencing data; and merging the target category contaminated sequencing data and the sample contaminated sequencing data to obtain updated target category contaminated sequencing data.
[0012] In a possible embodiment, the quality filtering of the original sequencing data to obtain initial sequencing data includes: determining the Phred quality score corresponding to each original sequencing sequence in the original sequencing data; aggregating the original sequencing sequences corresponding to the Phred quality scores greater than the Phred quality score threshold to obtain first sequencing data; pruning the adapter sequence data of each original sequencing sequence in the first sequencing data to obtain second sequencing data; and retaining the original sequencing sequences in the second sequencing data that are different from the host sequence data to obtain the initial sequencing data.
[0013] In a second aspect, an embodiment of the present application provides a method for identifying sequencing data contamination, comprising: obtaining target sequencing data; wherein the target sequencing data includes multiple target sequencing sequences; performing feature extraction on the target sequencing data to generate target data structural features; inputting the target sequencing data into a pre-trained large language model to output target context features; generating target sequencing data joint features based on the target data structural features and the target context features; inputting the target sequencing data joint features and the target data structural features into a sequencing data contamination identification model, and outputting a sequencing data contamination ratio and a sequencing data contamination source category; wherein the sequencing data contamination identification model is obtained using the training method described in the first aspect and / or various possible implementation methods of the first aspect.
[0014] In a possible embodiment, the target sequencing data joint feature and the target data structural feature are input into a sequencing data contamination identification model, and the sequencing data contamination ratio and the sequencing data contamination source category are output, including: determining a target coverage from the target data structural feature; determining a model parameter threshold of the sequencing data contamination identification model based on a size relationship between the target coverage and the coverage threshold; inputting the target sequencing data joint feature, the target data structural feature, and the model parameter threshold into the sequencing data contamination identification model, and outputting the sequencing data contamination ratio and the sequencing data contamination source category.
[0015] In a third aspect, an embodiment of the present application provides a training device for a sequencing data contamination identification model, comprising:
[0016] A first acquisition module is configured to acquire raw sequencing data, wherein the raw sequencing data includes a plurality of raw sequencing sequences;
[0017] a first processing module configured to perform quality filtering on the raw sequencing data to obtain initial sequencing data, wherein the initial sequencing data includes a plurality of initial sequencing sequences; perform feature extraction on the initial sequencing data to obtain data contamination features; screen the initial sequencing data based on the data contamination features to obtain sample sequencing data; wherein the sample sequencing data includes a plurality of sample sequencing sequences; and determine target category contaminated sequencing data from a plurality of categories of preset contaminated sequencing data based on the data contamination features; wherein the target category contaminated sequencing data includes one or more contaminated sequencing sequences;
[0018] a second processing module, configured to merge the sample sequencing data and the target category contamination sequencing data to obtain first training sequencing data; wherein the ratio of the number of sample sequencing sequences to the number of contamination sequencing sequences in the first training sequencing data is a preset contamination ratio; perform feature extraction on the first training sequencing data to generate a first data structure feature; input the first training sequencing data into a pre-trained large language model to output context features;
[0019] A training module is used to generate a joint feature of sequencing data based on the first data structure feature and the context feature; train a supervised learning model based on the joint feature of sequencing data to obtain a target supervised learning model; and obtain a sequencing data contamination identification model based on the target supervised learning model.
[0020] In a possible embodiment, the supervised learning model includes a gradient classifier model and a neural network model; when the training module trains the supervised learning model according to the joint features of the sequencing data to obtain a target supervised learning model, it is specifically used to: train the gradient classifier model according to the joint features of the sequencing data to obtain the area under the first receiver operating characteristic curve; train the neural network model according to the joint features of the sequencing data to obtain the area under the second receiver operating characteristic curve; if the area under the first receiver operating characteristic curve is greater than or equal to the preset area threshold under the receiver operating characteristic curve, the trained gradient classifier model is determined as the target gradient classifier model; if the area under the first receiver operating characteristic curve is less than the preset area threshold, the trained gradient classifier model is determined as the target gradient classifier model. If the area under the receiver operating characteristic curve is greater than or equal to the area threshold under the preset receiver operating characteristic curve, the method returns to the step of training the gradient classifier model according to the joint features of the sequencing data to obtain the area under the first receiver operating characteristic curve; if the area under the second receiver operating characteristic curve is greater than or equal to the area threshold under the preset receiver operating characteristic curve, the trained neural network model is determined as the target neural network model; if the area under the second receiver operating characteristic curve is less than the area threshold under the preset receiver operating characteristic curve, the method returns to the step of training the neural network model according to the joint features of the sequencing data to obtain the area under the second receiver operating characteristic curve; the target supervised learning model is obtained according to the target gradient classifier model and the target neural network model.
[0021] In one possible embodiment, after obtaining the sequencing data contamination identification model based on the target supervised learning model, the training device for the sequencing data contamination identification model is further used to: merge the sample sequencing data and the target category contaminated sequencing data to obtain second training sequencing data; wherein the ratio of the number of sample sequencing sequences to the number of contaminant sequencing sequences in the second training sequencing data is an arbitrary ratio; perform feature extraction on the second training sequencing data to generate a second data structure feature; train an unsupervised learning model based on the second data structure feature to obtain a target unsupervised learning model; and obtain a merged sequencing data contamination identification model based on the target unsupervised learning model and the sequencing data contamination identification model.
[0022] In one possible embodiment, the unsupervised learning model includes an autoencoder and a clustering model; when the training device of the sequencing data contamination identification model trains the unsupervised learning model according to the second data structure feature to obtain a target unsupervised learning model, it is specifically used to: train the autoencoder according to the second data structure feature to determine a reconstruction error threshold; train the clustering model according to the second data structure feature to determine an intra-cluster distance threshold; and obtain the target unsupervised learning model based on the reconstruction error threshold, the intra-cluster distance threshold, the autoencoder and the clustering model.
[0023] In a possible embodiment, when the first processing module determines the target category contaminated sequencing data from multiple categories of preset contaminated sequencing data based on the data contamination characteristics, it is specifically used to: determine the species category characteristics based on the data contamination characteristics; determine the contaminating species based on the species category characteristics; and determine the target category contaminated sequencing data from multiple categories of preset contaminated sequencing data based on the genome sequence of the contaminating species.
[0024] In a possible embodiment, after determining the target category contaminated sequencing data from multiple categories of preset contaminated sequencing data based on the genome sequence of the contaminating species, the first processing module is further used to: determine the GC content deviation from the data contamination characteristics; process the bases of one or more sample sequencing sequences based on the GC content deviation to generate sample contaminated sequencing data; and merge the target category contaminated sequencing data and the sample contaminated sequencing data to obtain updated target category contaminated sequencing data.
[0025] In one possible embodiment, when the first processing module performs quality filtering on the raw sequencing data to obtain initial sequencing data, the module is specifically configured to: determine the Phred quality score corresponding to each raw sequencing sequence in the raw sequencing data; aggregate the raw sequencing sequences corresponding to the Phred quality scores greater than a Phred quality score threshold to obtain first sequencing data; trim the adapter sequence data of each raw sequencing sequence in the first sequencing data to obtain second sequencing data; and retain the raw sequencing sequences in the second sequencing data that are different from the host sequence data to obtain the initial sequencing data.
[0026] In a fourth aspect, an embodiment of the present application provides a device for identifying sequencing data contamination, comprising:
[0027] A second acquisition module is configured to acquire target sequencing data, wherein the target sequencing data includes a plurality of target sequencing sequences;
[0028] A third processing module is configured to extract features from the target sequencing data to generate target data structural features; input the target sequencing data into a pre-trained large language model to output target context features; and generate target sequencing data joint features based on the target data structural features and the target context features;
[0029] An output module is used to input the target sequencing data joint features and the target data structural features into a sequencing data contamination identification model, and output the sequencing data contamination ratio and sequencing data contamination source category; wherein the sequencing data contamination identification model is obtained using the training method described in the first aspect and / or various possible implementation methods of the first aspect.
[0030] In a possible embodiment, when the output module inputs the target sequencing data joint feature and the target data structural feature into the sequencing data contamination identification model and outputs the sequencing data contamination ratio and the sequencing data contamination source category, it is specifically used to: determine the target coverage from the target data structural feature; determine the model parameter threshold of the sequencing data contamination identification model based on the size relationship between the target coverage and the coverage threshold; input the target sequencing data joint feature, the target data structural feature, and the model parameter threshold into the sequencing data contamination identification model, and output the sequencing data contamination ratio and the sequencing data contamination source category.
[0031] In a fifth aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;
[0032] The memory stores computer-executable instructions;
[0033] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above-mentioned first aspect and / or various possible implementations of the first aspect, or the second aspect and / or various possible implementations of the second aspect.
[0034] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the above-mentioned first aspect and / or various possible implementation methods of the first aspect, or the second aspect and / or various possible implementation methods of the second aspect.
[0035] In the seventh aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the first aspect and / or various possible implementation methods of the first aspect, or the second aspect and / or various possible implementation methods of the second aspect.
[0036] The training method, identification method and electronic device of the sequencing data contamination identification model provided in the embodiments of the present application, based on obtaining original sequencing data, perform quality filtering on the original sequencing data to obtain initial sequencing data; then, perform feature extraction on the initial sequencing data to obtain data contamination features; based on the data contamination features, screen the initial sequencing data to obtain sample sequencing data; based on the data contamination features, determine target category contaminated sequencing data from multiple categories of preset contaminated sequencing data; by determining different target category contaminated sequencing data, enable the trained sequencing data contamination identification model to identify and output the contamination category of the measured sequencing data; merge the sample sequencing data and the target category contaminated sequencing data based on a preset contamination ratio to obtain a first training sequencing data; According to the method, by generating first training sequencing data corresponding to different preset contamination ratios, the trained sequencing data contamination identification model is enabled to output the contamination ratio of the measured sequencing data; feature extraction is performed on the first training sequencing data to generate a first data structure feature; the first training sequencing data is input into a pre-trained large language model to output a context feature; based on the first data structure feature and the context feature, a sequencing data joint feature is generated; based on the sequencing data joint feature, a supervised learning model is trained to obtain a target supervised learning model; based on the target supervised learning model, a sequencing data contamination identification model is obtained; that is, the problem that the sequencing data contamination identification model of the existing technical solution cannot determine the contamination category of the microbial contamination corresponding to the contaminated data and the contamination ratio of the sequencing data is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0038] Figure 1 A flowchart of a method for training a sequencing data contamination identification model provided in one embodiment of the present application;
[0039] Figure 2 A flowchart of a method for identifying sequencing data contamination provided in one embodiment of the present application;
[0040] Figure 3 A schematic diagram of the structure of a training device for a sequencing data contamination identification model provided in one embodiment of the present application;
[0041] Figure 4 A schematic diagram of the structure of a device for identifying sequencing data contamination provided in one embodiment of the present application;
[0042] Figure 5 This is a schematic diagram of the structure of the electronic device provided in this application.
[0043] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION
[0044] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0045] In the technical solution of this application, the user personal information involved and the collection, storage, use, processing, transmission, provision and disclosure of data are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0046] 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, stored data, displayed data, 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 relevant data must comply with the relevant laws, regulations and standards of the relevant regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0047] First, let’s explain the terms involved in this application:
[0048] Area under the receiver operating characteristic curve (AUC-ROC): The ROC curve (Receiver Operating Characteristic Curve) describes the performance of the binary classification model at different thresholds, with the horizontal axis representing the false positive rate (FPR) and the vertical axis representing the true positive rate (TPR). AUC (Area Under the Curve) refers to the area under the ROC curve (receiver operating characteristic curve). In microbiome sequencing data, AUC-ROC is used to evaluate the model's ability to distinguish between contaminated and normal sequences.
[0049] Phred quality score: It is a standardized method for evaluating base quality in DNA sequencing data. The Phred quality score uses a logarithmic scale to represent base quality values. The value range is generally between 0 and 40, where 0 represents the worst quality and 40 represents the best quality.
[0050] With the advancement of sequencing technology, users are increasingly concerned about the impact of microbial contamination on test data results. Sources of microbial contamination include the sampling process, sample cross-contamination, reagent contamination, and the laboratory environment. Existing sequencing data contamination identification models can identify data with significant distribution differences from normal sequencing data as contaminated data corresponding to microbial contamination. However, existing sequencing data contamination identification models are unable to determine the contamination category of the contaminated data or the contaminated percentage of the sequencing data.
[0051] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0052] Figure 1 A flowchart of a method for training a sequencing data contamination identification model provided in one embodiment of the present application is shown in FIG. Figure 1 As shown, the training method for the sequencing data contamination identification model provided in this embodiment can be executed by any electronic device. For example, the training method for the sequencing data contamination identification model provided in this embodiment includes the following steps:
[0053] Step S101: obtaining original sequencing data, wherein the original sequencing data includes a plurality of original sequencing sequences.
[0054] Illustratively, the original sequencing data is the original data used to train a sequencing data contamination identification model, wherein the original sequencing data includes multiple original sequencing sequences.
[0055] Step S102 : performing quality filtering on the original sequencing data to obtain initial sequencing data, wherein the initial sequencing data includes a plurality of initial sequencing sequences.
[0056] Illustratively, after obtaining the original sequencing data, the original sequencing data is quality filtered to obtain initial sequencing data, wherein the initial sequencing data includes a plurality of initial sequencing sequences.
[0057] Specifically, the specific implementation steps of step S102 include:
[0058] Step S1021 : determining the Phred quality score corresponding to each original sequencing sequence in the original sequencing data.
[0059] Step S1022 : Aggregate the original sequencing sequences corresponding to the Phred quality scores that are greater than the Phred quality score threshold to obtain first sequencing data.
[0060] Illustratively, based on determining the Phred quality score of each original sequencing sequence, by comparing the size relationship between the Phred quality score of each original sequencing sequence and the Phred quality score threshold, the original sequencing sequences corresponding to the Phred quality score greater than the Phred quality score threshold are aggregated to obtain the first sequencing data.
[0061] Furthermore, based on obtaining the first sequencing data, the method provided in the embodiment of the present application also includes: determining the N content corresponding to each original sequencing sequence in the original sequencing data; and summarizing the original sequencing sequences in the first sequencing data corresponding to the N content that is less than the N content threshold to obtain updated first sequencing data.
[0062] Step S1023 , pruning the adapter sequence data of each original sequencing sequence in the first sequencing data to obtain second sequencing data.
[0063] Exemplarily, the adapter sequence of each original sequencing sequence in the first sequencing data is identified and trimmed, thereby obtaining each original sequencing sequence after trimming the adapter sequence, that is, obtaining the second sequencing data; wherein the adapter sequence is a universal adapter sequence, for example, an Illumina universal adapter sequence.
[0064] Step S1024: retain the original sequencing sequences in the second sequencing data that are different from the host sequence data to obtain initial sequencing data.
[0065] Exemplarily, the original sequencing sequence in the second sequencing data is compared with the host sequencing sequence in the host sequence data, the original sequencing sequence that is successfully compared with the host sequencing sequence in the host sequence data is removed, and the original sequencing sequence that is different from the host sequence data is retained, thereby obtaining the initial sequencing data.
[0066] Step S103: extract features from the initial sequencing data to obtain data contamination features.
[0067] Exemplarily, for each initial sequencing sequence in the initial sequencing data: the initial sequencing sequence is split into continuous substrings of length k, for example, k is 4, 5, and 6; then the number of occurrences of all k-mers is counted to obtain the k-mer distribution; wherein, an abnormal k-mer distribution indicates that the initial sequencing sequence is contaminated, that is, the data contamination feature includes an abnormal k-mer distribution.
[0068] Illustratively, for each initial sequencing sequence in the initial sequencing data: obtain the ratio of G and C bases in the sequence, for example, slide a fixed window along the sequence, and calculate the GC content of each window; then calculate the deviation between the window GC content and the GC content of the target genome, that is, obtain the GC content deviation; then measure the degree of fluctuation through the standard deviation, and identify abnormal fluctuation areas, that is, the data contamination characteristics include GC content deviation.
[0069] Exemplarily, for each initial sequencing sequence in the initial sequencing data, each initial sequencing sequence is compared with the species sequencing sequence in the database to determine the species label of each initial sequencing sequence, and then the proportion of initial sequencing sequences of non-target species is obtained, that is, the data contamination characteristics include the proportion of initial sequencing sequences of non-target species.
[0070] Exemplarily, for each initial sequencing sequence in the initial sequencing data: the initial sequencing sequence is compared with the reference genomes of multiple species, and the initial sequencing sequences that are screened and compared to multiple species and whose score difference is less than or equal to the score difference threshold are marked as chimeric initial sequencing sequences; wherein, for example, the score difference threshold is 10%; and then the chimeric sequence ratio of the chimeric initial sequencing sequence is obtained, that is, the data contamination feature includes the chimeric sequence ratio of the chimeric initial sequencing sequence.
[0071] Exemplarily, for each initial sequencing sequence in the initial sequencing data: calculate the average depth of the initial sequencing sequence relative to a specific region of the target genome to obtain coverage, that is, the data contamination characteristics include coverage; among them, the window with a high coverage value is a deep abnormal area, corresponding to exogenous DNA contamination.
[0072] Step S104 , screening the initial sequencing data according to the data contamination characteristics to obtain sample sequencing data; wherein the sample sequencing data includes a plurality of sample sequencing sequences.
[0073] Illustratively, based on the relationship between the data contamination feature and the sample data contamination rate threshold, and / or based on the degree of matching between the data contamination feature and the sample data distribution condition, the initial sequencing sequence in the initial sequencing data is screened to obtain the sample sequencing data; wherein the sample sequencing data includes multiple sample sequencing sequences; and the contamination rate of the sample sequencing data is less than or equal to the sample contamination rate threshold.
[0074] Specifically, the data contamination characteristics include abnormal k-mer distribution, and the sample data distribution condition includes the absence of abnormal k-mer distribution. If the abnormal k-mer distribution matches the sample data distribution condition, that is, the initial sequencing sequence does not have an abnormal k-mer distribution, then the initial sequencing sequence is retained; if the abnormal k-mer distribution does not match the sample data distribution condition, that is, the initial sequencing sequence has an abnormal k-mer distribution, then the initial sequencing sequence is eliminated; and then the sample sequencing data is obtained.
[0075] Specifically, the data contamination characteristics include GC content deviation, and the sample data contamination rate threshold includes a GC content deviation threshold. If the GC content deviation is greater than the GC content deviation threshold, the initial sequencing sequence corresponding to the GC content deviation is eliminated; if the GC content deviation is less than or equal to the GC content deviation threshold, the initial sequencing sequence corresponding to the GC content deviation is retained, thereby obtaining the sample sequencing data.
[0076] Specifically, the data contamination characteristics include the proportion of initial sequencing sequences of non-target species, and the sample data contamination rate threshold includes the initial sequencing sequence proportion threshold of non-target species. If the initial sequencing sequence proportion of non-target species is less than or equal to the initial sequencing sequence proportion threshold of non-target species, the initial sequencing data is determined as sample sequencing data; if the initial sequencing sequence proportion of non-target species is greater than the initial sequencing sequence proportion threshold of non-target species, the initial sequencing sequences of non-target species in the initial sequencing data are removed so that the initial sequencing sequence proportion of non-target species is less than or equal to the initial sequencing sequence proportion threshold of non-target species, thereby obtaining sample sequencing data.
[0077] Specifically, the data contamination feature includes the chimeric sequence ratio of the chimeric initial sequencing sequence, and the sample data contamination rate threshold includes the chimeric sequence ratio threshold of the chimeric initial sequencing sequence. If the chimeric sequence ratio of the chimeric initial sequencing sequence is less than or equal to the chimeric sequence ratio threshold of the chimeric initial sequencing sequence, the initial sequencing data is determined as the sample sequencing data; if the chimeric sequence ratio of the chimeric initial sequencing sequence is greater than the chimeric sequence ratio threshold of the chimeric initial sequencing sequence, the chimeric initial sequencing sequence in the initial sequencing data is removed so that the chimeric sequence ratio of the chimeric initial sequencing sequence is less than or equal to the chimeric sequence ratio threshold of the chimeric initial sequencing sequence, thereby obtaining the sample sequencing data.
[0078] Specifically, the data contamination characteristics include coverage, and the sample data contamination rate threshold includes the coverage threshold. If the coverage is less than the coverage threshold, the initial sequencing sequence corresponding to the coverage is eliminated; if the coverage is greater than or equal to the coverage threshold, the initial sequencing sequence corresponding to the coverage is retained; and then the sample sequencing data is obtained.
[0079] It is understandable that the embodiments of the present application do not impose specific restrictions on the data contamination features used to determine the sample sequencing data; for example, the sample sequencing data can be determined based on abnormal k-mer distribution, GC content deviation, the proportion of initial sequencing sequences of non-target species, the proportion of chimeric sequences of chimeric initial sequencing sequences, and coverage; the sample sequencing data can also be determined based on GC content deviation.
[0080] Step S105 , determining target category contaminated sequencing data from multiple categories of preset contaminated sequencing data according to data contamination characteristics; the target category contaminated sequencing data includes one or more contaminated sequencing sequences.
[0081] Illustratively, different sample sequencing data may be contaminated into different types, and based on the data contamination characteristics, the type of contamination of the sample sequencing data is determined; and then, according to the type of contamination of the sample sequencing data, target category contaminated sequencing data is determined from multiple categories of preset contaminated sequencing data; wherein the target category contaminated sequencing data includes one or more contaminated sequencing sequences.
[0082] In the steps of this embodiment, by determining different target categories of contaminated sequencing data, the trained sequencing data contamination identification model is enabled to identify and output the contamination category of the measured sequencing data.
[0083] In a possible implementation, the specific implementation steps of step S105 include:
[0084] Step S1051: Determine species category characteristics based on data pollution characteristics.
[0085] Step S1052: Determine the pollutant species based on the species category characteristics.
[0086] Step S1053 , determining target category contaminated sequencing data from multiple categories of preset contaminated sequencing data based on the genome sequence of the contaminating species.
[0087] Exemplarily, the data contamination characteristics include the proportion of initial sequencing sequences of non-target species, and then the species category characteristics are determined based on the data contamination characteristics, and the species category characteristics include target species category characteristics and non-target species category characteristics; based on the non-target species category characteristics, the non-target species are determined, and the non-target species are determined as contaminant species; then, the genomic sequence of the contaminant species is matched with the contamination sequencing sequences corresponding to multiple categories of preset contamination sequencing data, and the preset contamination sequencing data corresponding to the contamination sequencing sequence that matches the genomic sequence of the contaminant species is determined as the target category contamination sequencing data. That is, if the target sequencing data corresponding to the sample sequencing data is susceptible to contamination by Class A contaminant species, the preset contamination sequencing data corresponding to the contamination sequencing sequence that matches the genomic sequence of Class A contaminant species is determined as the target category contamination sequencing data; if the target sequencing data corresponding to the sample sequencing data is susceptible to contamination by Class B contaminant species, the preset contamination sequencing data corresponding to the contamination sequencing sequence that matches the genomic sequence of Class B contaminant species is determined as the target category contamination sequencing data.
[0088] Specifically, for example, based on the embodiment of step S103, it can be known that the data contamination feature includes the proportion of initial sequencing sequences of non-target species, that is, if for each initial sequencing sequence in the initial sequencing data, each initial sequencing sequence is compared with the species sequencing sequence in the database, and the species label of each initial sequencing sequence is determined; then, it is determined whether the species label of each initial sequencing sequence matches the species label of the target species. If they do not match, the corresponding initial sequencing sequence is determined as the initial sequencing sequence of the non-target species, and the corresponding sequence quantity data_1 is obtained. If they match, the corresponding initial sequencing sequence is determined as the initial sequencing sequence of the target species, and the corresponding sequence quantity data_2 is obtained; then, the ratio of the sequence quantity data_1 to the total number of initial sequencing sequences in the initial sequencing data (the sum of the sequence quantity data_1 and the sequence quantity data_2) is the proportion of initial sequencing sequences of non-target species.
[0089] On this basis, species category characteristics are determined according to data contamination characteristics. Species category characteristics include target species category characteristics and non-target species category characteristics. Non-target species category characteristics are used to indicate the number of non-target species and the proportion of contamination of the initial sequencing data by each non-target species.
[0090] According to the category characteristics of the non-target species, if it is determined that there is only one non-target species, the non-target species will be determined as the contaminant species. Then, according to the genome sequence of the contaminant species, the contamination sequencing sequences corresponding to the preset contamination sequencing data of multiple categories will be matched, and the preset contamination sequencing data corresponding to the contamination sequencing sequence that matches the genome sequence of the contaminant species will be determined as the target category contamination sequencing data.
[0091] Based on the non-target species category characteristics, it is determined that there are multiple non-target species. For example, if there are two non-target species, namely a first non-target species and a second non-target species, then the initial sequencing sequence ratio of the first non-target species and the initial sequencing sequence ratio of the second non-target species are determined based on the initial sequencing sequence ratio of the non-target species; for example, the initial sequencing sequence ratio of the first non-target species is 5%, and the initial sequencing sequence ratio of the second non-target species is 0.1%. Further, the contaminant species are determined based on the species category characteristics, that is, the contaminant species are determined based on the non-target species category characteristics, that is, based on the contamination ratio of each non-target species to the initial sequencing data, the non-target species with the largest contamination ratio is determined as the contaminant species; for example, the initial sequencing sequence ratio of the first non-target species is 5%, and the initial sequencing sequence ratio of the second non-target species is 0.1%, so the first non-target species is determined as the contaminant species. Furthermore, based on the genomic sequence of the first non-target species, the contaminant sequencing sequences corresponding to multiple categories of preset contaminant sequencing data are matched, and the preset contaminant sequencing data corresponding to the contaminant sequencing sequence that matches the genomic sequence of the first non-target species is determined as the target category contaminant sequencing data.
[0092] In the steps of this embodiment, by determining the contaminant species that the target sequencing data corresponding to the sample sequencing data is susceptible to contamination, and then determining the target category contaminated sequencing data, the training effect of the subsequent model training step is improved, and the recognition accuracy of using the model to identify sequencing data contamination is improved.
[0093] Furthermore, based on steps S1051-S1053 of the embodiment, the method provided in the embodiment of the present application further includes:
[0094] Step S1054: determining the GC content deviation from the data contamination characteristics.
[0095] Step S1055 : processing the bases of one or more sample sequencing sequences according to the GC content deviation to generate sample contamination sequencing data.
[0096] Step S1056: Merge the target category contamination sequencing data and the sample contamination sequencing data to obtain updated target category contamination sequencing data.
[0097] Exemplarily, the data contamination feature includes GC content deviation, so the GC content deviation is determined from the data contamination feature; based on the GC content deviation, the base pair mutation information that may occur in the sequencing sequence of the target sequencing data corresponding to the sample sequencing data is determined; then, according to the base pair mutation information, the bases of one or more sample sequencing sequences are processed to generate sample contaminated sequencing data; then, the target category contaminated sequencing data and the sample contaminated sequencing data are merged to obtain updated target category contaminated sequencing data for subsequent model training.
[0098] Furthermore, based on steps S1051-S1056 of the embodiment, the method provided in the embodiment of the present application also includes: determining the chimeric sequence ratio of the chimeric initial sequencing sequence from the data contamination characteristics; generating chimeric sequence contamination sequencing data based on the chimeric sequence ratio; and merging the updated target category contamination sequencing data and the chimeric sequence contamination sequencing data to obtain the second updated target category contamination sequencing data.
[0099] Step S106 , merging the sample sequencing data and the target category contamination sequencing data to obtain first training sequencing data; wherein the ratio of the number of sample sequencing sequences to the number of contamination sequencing sequences in the first training sequencing data is a preset contamination ratio.
[0100] Illustratively, according to a preset contamination ratio, the number of sample sequencing sequences of the sample sequencing data and the number of contaminated sequencing sequences of the target category contaminated sequencing data are determined, and then the sample sequencing sequences of the sample sequencing data and the contaminated sequencing sequences of the target category contaminated sequencing data are merged to obtain the first training sequencing data.
[0101] In the steps of this embodiment, by generating first training sequencing data corresponding to different preset contamination ratios, the trained sequencing data contamination identification model is enabled to output the contamination ratio of the measured sequencing data.
[0102] Step S107: extract features from the first training sequencing data to generate first data structure features.
[0103] Exemplarily, referring to the feature extraction process in step S103, feature extraction is performed on the first training sequencing data to obtain the k-mer distribution, GC content, species category of non-target species, coverage, and the proportion of chimeric sequences in the chimeric initial sequence, thereby obtaining a first data structure feature. Specifically, in one possible implementation, the k-mer distribution is a 100-dimensional vector, the GC content is a 5-dimensional vector, the species category of non-target species is a 19-dimensional vector, the coverage is a 3-dimensional vector, and the proportion of chimeric sequences in the chimeric initial sequence is a 1-dimensional vector.
[0104] Step S108: input the first training sequence data into a pre-trained large language model and output context features.
[0105] For example, the pre-trained large language model learns deep feature representations of DNA sequences, namely contextual features, by pre-training on large-scale DNA sequence data. Furthermore, the pre-trained large language model can output corresponding contextual features based on the input first training sequencing data. Contextual features refer to feature representations obtained by comprehensively understanding and encoding the input sequencing data through the pre-trained large language model. Contextual features include: dependencies and co-occurrence patterns between bases or amino acids in the sequence, local and global structural information of sequence fragments, association information between the sequence and its surrounding environment, and functional and evolutionary implicit information of the sequence. Specifically, in one possible implementation, the contextual features are 128-dimensional vectors.
[0106] Step S109: Generate a joint feature of sequencing data based on the first data structure feature and the context feature.
[0107] Exemplarily, the first data structure feature and the context feature are combined to generate a sequencing data joint feature. In one possible implementation, the sequencing data joint feature is a 256-dimensional vector.
[0108] Step S110 , training the supervised learning model based on the joint features of the sequencing data to obtain a target supervised learning model.
[0109] Specifically, the supervised learning model includes a gradient classifier model and a neural network model. The specific implementation steps of step S110 include:
[0110] S1101 , training a gradient classifier model based on the combined features of the sequencing data to obtain a first area under the receiver operating characteristic curve (ie, a first AUC-ROC).
[0111] S1102, training the neural network model based on the combined features of the sequencing data to obtain a second AUC-ROC.
[0112] S1103: If the first AUC-ROC is greater than or equal to a preset AUC-ROC threshold, the trained gradient classifier model is determined as a target gradient classifier model.
[0113] S1104: If the first AUC-ROC is less than the preset AUC-ROC threshold, the process returns to step S1101.
[0114] S1105: If the second AUC-ROC is greater than or equal to the preset AUC-ROC threshold, the trained neural network model is determined as the target neural network model.
[0115] S1106: If the second AUC-ROC is less than the preset AUC-ROC threshold, the process returns to step S1102.
[0116] Exemplarily, the gradient classifier model and the neural network model are trained separately by a five-fold cross-validation method, that is, the joint features of the sequencing data are divided into 5 sub-sequencing data joint features, and 4 sub-sequencing data joint features are used for model training and 1 sub-sequencing data joint features are used for model verification each time, and this is repeated 5 times to reduce the risk of overfitting; then, based on the output results of the model training, the first AUC-ROC corresponding to the gradient classifier model and the second AUC-ROC corresponding to the neural network model are calculated respectively; then, if the first AUC-ROC is less than the preset AUC-ROC threshold, the process returns to step S1101; if the first AUC-ROC is greater than or equal to the preset AUC-ROC threshold, the trained gradient classifier model is determined as the target gradient classifier model; if the second AUC-ROC is less than the preset AUC-ROC threshold, the process returns to step S1102; if the second AUC-ROC is greater than or equal to the preset AUC-ROC threshold, the trained neural network model is determined as the target neural network model.
[0117] Furthermore, oversampling or weighted loss function is used to adjust the ratio of positive and negative samples corresponding to the joint features of sequencing data to solve the problem of class imbalance of minority class samples, thereby increasing the amount of data used for model training.
[0118] Specifically, in one possible implementation, the model parameters of the gradient classifier model include tree depth, learning rate, number of early stopping rounds, and weighted cross entropy (contamination class weight). For example, the tree depth is 5, the learning rate is 0.05, the number of early stopping rounds is 50 (wherein training is stopped when the first AUC-ROC is greater than or equal to a preset AUC-ROC threshold), and the contamination class weight is 10. The neural network model includes a convolutional neural network branch, a fully connected neural network branch, and a merged output layer. The convolutional neural network branch includes a one-dimensional convolution layer (including 64 filters with a convolution kernel size of 5), a maximum pooling layer, a long short-term memory network layer (including 32 long short-term memory network units), and a random inactivation probability of 0.3. The fully connected neural network branch includes a fully connected layer consisting of 64 neurons. The merged output layer is used to fuse the features of the convolutional neural network branch and the fully connected neural network branch, and then output the contamination ratio corresponding to the joint features of the sequencing data.
[0119] S1107, obtaining a target supervised learning model based on the target gradient classifier model and the target neural network model.
[0120] Exemplarily, on the basis of obtaining the target gradient classifier model and the target neural network model, a model is constructed according to the target gradient classifier model and the target neural network model to obtain a target supervised learning model.
[0121] Step S111: obtaining a sequencing data contamination identification model based on the target supervised learning model.
[0122] Exemplarily, a target supervised learning model is used as the core of the model to construct a model, thereby obtaining a sequencing data contamination identification model.
[0123] In this embodiment, on the basis of obtaining the original sequencing data, the original sequencing data is quality filtered to obtain initial sequencing data; then, feature extraction is performed on the initial sequencing data to obtain data contamination features; based on the data contamination features, the initial sequencing data is screened to obtain sample sequencing data; based on the data contamination features, target category contaminated sequencing data is determined from multiple categories of preset contaminated sequencing data, and by determining different target category contaminated sequencing data, the trained sequencing data contamination identification model is enabled to identify and output the contamination category of the measured sequencing data; based on the preset contamination ratio, the sample sequencing data and the target category contaminated sequencing data are merged to obtain first training sequencing data, and by generating different preset contamination ratios, the contamination identification model is trained to identify the contaminated sequencing data. The method uses the corresponding first training sequencing data to enable the trained sequencing data contamination identification model to output the contamination ratio of the measured sequencing data; performs feature extraction on the first training sequencing data to generate a first data structure feature; inputs the first training sequencing data into a pre-trained large language model to output a context feature; generates a sequencing data joint feature based on the first data structure feature and the context feature; trains a supervised learning model based on the sequencing data joint feature to obtain a target supervised learning model; obtains a sequencing data contamination identification model based on the target supervised learning model; thus, the method solves the problem that the sequencing data contamination identification model of the prior art solution cannot determine the contamination category of the microbial contamination corresponding to the contaminated data and the contamination ratio of the sequencing data.
[0124] On this basis, the method provided in the embodiment of the present application further includes:
[0125] Step S112: Merge the sample sequencing data and the target category contamination sequencing data to obtain second training sequencing data; wherein the ratio of the number of sample sequencing sequences to the number of contamination sequencing sequences in the second training sequencing data is arbitrary.
[0126] Illustratively, the sample sequencing sequences of the sample sequencing data and the contamination sequencing sequences of the target category contamination sequencing data are merged in an arbitrary ratio to obtain the second training sequencing data.
[0127] Step S113: extract features from the second training sequencing data to generate second data structure features.
[0128] Exemplarily, referring to the feature extraction process of step S103, feature extraction is performed on the second training sequencing data to obtain k-mer distribution, GC content, species category of non-target species, coverage, and chimeric sequence ratio of chimeric initial sequencing sequences, that is, to obtain the second data structure feature.
[0129] Step S114: training the unsupervised learning model according to the second data structure feature to obtain a target unsupervised learning model.
[0130] Specifically, the unsupervised learning model includes an autoencoder and a clustering model; the specific implementation steps of step S114 include:
[0131] Step S1141 : training the autoencoder according to the second data structure feature to determine a reconstruction error threshold.
[0132] Exemplarily, based on the second data structure feature, the autoencoder is trained, and based on the encoding process and the decoding process, the reconstruction error of the second data structure feature is calculated. Jie'er determines the reconstruction error threshold so that when the reconstruction error is greater than the reconstruction error threshold, it is determined that the second training sequencing data corresponding to the second data structure feature includes the target category contaminated sequencing data, that is, there is a contaminated sequencing sequence in the second training sequencing data.
[0133] Step S1142: training the clustering model according to the second data structure feature to determine the intra-cluster distance threshold.
[0134] Exemplarily, the clustering model includes a density-based clustering model. Based on the second data structure feature, the density-based clustering model is trained to determine the intra-cluster distance threshold to identify groups that deviate from the distribution of sample sequencing sequences, that is, groups corresponding to contaminated sequencing sequences.
[0135] Step S1143 , obtaining a target unsupervised learning model according to the reconstruction error threshold, the intra-cluster distance threshold, the autoencoder, and the clustering model.
[0136] Exemplarily, the model parameters of the autoencoder are set according to the reconstruction error threshold, and the model parameters of the clustering model are set according to the intra-cluster distance threshold. Then, the model is constructed based on the autoencoder with set parameters and the clustering model with set parameters to obtain the target unsupervised learning model.
[0137] Step S115 , obtaining a merged sequencing data contamination identification model based on the target unsupervised learning model and the sequencing data contamination identification model.
[0138] Specifically, the sequencing data contamination identification model obtained based on steps S101 to S115 includes a target unsupervised learning model and a target supervised learning model.
[0139] Based on the above embodiments, Figure 2 A flowchart of a method for identifying sequencing data contamination provided in one embodiment of the present application is shown below. Figure 2 As shown, the method for identifying sequencing data contamination provided in this embodiment includes the following steps:
[0140] Step S201: Acquire target sequencing data; the target sequencing data includes multiple target sequencing sequences.
[0141] Step S202: extract features from the target sequencing data to generate target data structure features.
[0142] Exemplarily, referring to the feature extraction process of step S103, feature extraction is performed on the target sequencing data to obtain k-mer distribution, GC content, species category of non-target species, coverage, and chimeric sequence ratio of chimeric sequencing sequences, that is, to obtain target data structure features.
[0143] Step S203: input the target sequencing data into a pre-trained large language model and output target context features.
[0144] Exemplarily, referring to the processing process of step S108, the pre-trained large language model can output target context features based on the input target sequencing data; context features include: dependencies and co-occurrence patterns between bases or amino acids in the sequence, local and global structural information of sequence fragments, association information between the sequence and the surrounding environment, and functional and evolutionary implicit information of the sequence.
[0145] Step S204: Generate target sequencing data joint features based on the target data structure features and the target context features.
[0146] Exemplarily, the target data structure feature and the target context feature are merged to generate a target sequencing data joint feature; in one possible implementation, the target sequencing data joint feature is a 256-dimensional vector.
[0147] In step S205, the target sequencing data joint features and the target data structural features are input into a sequencing data contamination identification model, and the sequencing data contamination ratio and the sequencing data contamination source category are output; wherein the sequencing data contamination identification model is obtained by using a training method for the sequencing data contamination identification model in any of the above method embodiments.
[0148] In a possible implementation, the sequencing data contamination identification model is obtained by using the training method of the sequencing data contamination identification model in steps S101 to S111 above, and the sequencing data contamination identification model includes a target supervised learning model.
[0149] Specifically, the target sequencing data joint features and target data structural features are input into the sequencing data contamination identification model. The model then determines whether the target sequencing data contains known contaminating sequences based on the target data structural features. If the target sequencing data does not contain known contaminating sequences, the target sequencing data joint features are input into the target supervised learning model to output the sequencing data contamination ratio and sequencing data contamination source category. If the target sequencing data includes known contamination sequences, the known contamination sequences are filtered to obtain a first sequencing data contamination ratio, a first sequencing data contamination source category, and filtered target sequencing data; then, the target sequencing data joint features corresponding to the filtered target sequencing data are input into a target supervised learning model to output a second sequencing data contamination ratio and a second sequencing data contamination source category; then, based on the first sequencing data contamination ratio, the first sequencing data contamination source category, the second sequencing data contamination ratio, and the second sequencing data contamination source category, the sequencing data contamination ratio and the sequencing data contamination source category are output; wherein, the processing process of the target sequencing data joint features corresponding to the filtered target sequencing data includes: performing feature extraction on the filtered target sequencing data to generate filtered target data structural features; inputting the filtered target sequencing data into a pre-trained large language model to output filtered target context features; and generating target sequencing data joint features corresponding to the filtered target sequencing data based on the filtered target data structural features and the filtered target context features.
[0150] In another possible implementation, the sequencing data contamination identification model is obtained by using the training method of the sequencing data contamination identification model in steps S101 to S115 above, and the sequencing data contamination identification model includes a target supervised learning model and a target unsupervised learning model, and the target unsupervised learning model includes an autoencoder and a clustering model.
[0151] Specifically, the target sequencing data joint features and target data structural features are first input into the sequencing data contamination identification model. Target data structural features include k-mer distribution, GC content, species type of non-target species, coverage, and chimeric sequence ratio of chimeric sequencing sequences; target sequencing data joint features include target data structural features and target context features.
[0152] In the first stage, the target unsupervised learning model performs dimensionality reduction and cluster analysis on the target data's structural features. Specifically, an autoencoder performs nonlinear dimensionality reduction to extract low-dimensional structural features. Furthermore, a clustering model is used to perform cluster analysis to determine whether there are potential contaminant sequences in the target sequencing data. If no potential contaminant sequences are present, the sequencing data contamination identification model outputs a signal indicating that the target sequencing data is uncontaminated.
[0153] In the second stage, if there are potential contamination sequences in the target sequencing data, the joint features of the target sequencing data and the target data structural features are input into the target supervised learning model, and then the sequencing data contamination ratio and sequencing data contamination source category are output; among them, the sequencing data contamination ratio represents the percentage of contaminated sequences corresponding to each sequencing data contamination source category in all sequences. The sequencing data contamination source categories include GC content deviation, contaminating species (non-target species), and chimeric sequencing sequences.
[0154] Furthermore, in another possible implementation, the specific implementation steps of step S205 include:
[0155] Step S2051, determining target coverage from target data structure features.
[0156] Step S2052: Determine the model parameter threshold of the sequencing data contamination identification model based on the relationship between the target coverage and the coverage threshold.
[0157] In a possible implementation, the sequencing data contamination identification model is obtained by using the training method of the sequencing data contamination identification model in steps S101 to S111 above, and the sequencing data contamination identification model includes a target supervised learning model.
[0158] Furthermore, based on the relationship between the target coverage and the coverage threshold, the model parameter threshold of the sequencing data contamination identification model is determined, including the preset AUC-ROC threshold of the target supervised learning model.
[0159] In another possible implementation, the sequencing data contamination identification model is obtained by using the training method of the sequencing data contamination identification model in steps S101 to S115 above, and the sequencing data contamination identification model includes a target supervised learning model and a target unsupervised learning model.
[0160] Furthermore, based on the relationship between the target coverage and the coverage threshold, the model parameter thresholds of the sequencing data contamination identification model are determined, including the preset AUC-ROC threshold of the target supervised learning model, the reconstruction error threshold of the autoencoder in the target unsupervised learning model, and the intra-cluster distance threshold of the clustering model in the target unsupervised learning model.
[0161] In the steps of this embodiment, the greater the coverage, the greater the probability of false positive contamination. Therefore, the corresponding model parameter threshold is determined based on the relationship between the target coverage and the coverage threshold to reduce the probability of false positive contamination. By dynamically adjusting the model parameter threshold, the sequencing data contamination identification model can be applied to different sequencing scenarios.
[0162] Step S2053 : Input the target sequencing data joint features, target data structural features, and model parameter thresholds into the sequencing data contamination identification model, and output the sequencing data contamination ratio and sequencing data contamination source category.
[0163] Exemplarily, the model parameter threshold is input into the sequencing data contamination identification model to update the model parameters of the sequencing data contamination identification model; then, the sequencing data contamination identification model after updating the model parameters can output the sequencing data contamination ratio and sequencing data contamination source category based on the input target sequencing data joint features and target data structure features.
[0164] Figure 3 A schematic diagram of the structure of a training device for a sequencing data contamination identification model provided in one embodiment of the present application is shown in FIG. Figure 3 As shown, the training device 3 for the sequencing data contamination identification model provided in this embodiment includes:
[0165] A first acquisition module 31 is used to acquire raw sequencing data, wherein the raw sequencing data includes a plurality of raw sequencing sequences;
[0166] The first processing module 32 is configured to perform quality filtering on the raw sequencing data to obtain initial sequencing data, wherein the initial sequencing data includes a plurality of initial sequencing sequences; perform feature extraction on the initial sequencing data to obtain data contamination features; filter the initial sequencing data based on the data contamination features to obtain sample sequencing data; wherein the sample sequencing data includes a plurality of sample sequencing sequences; and determine target category contaminated sequencing data from a plurality of categories of preset contaminated sequencing data based on the data contamination features; wherein the target category contaminated sequencing data includes one or more contaminated sequencing sequences;
[0167] A second processing module 33 is configured to merge the sample sequencing data and the target category contamination sequencing data to obtain first training sequencing data; wherein the ratio of the number of sample sequencing sequences to the number of contamination sequencing sequences in the first training sequencing data is a preset contamination ratio; perform feature extraction on the first training sequencing data to generate a first data structure feature; input the first training sequencing data into a pre-trained large language model to output context features;
[0168] The training module 34 is used to generate a joint feature of sequencing data based on the first data structure feature and the context feature; train the supervised learning model based on the joint feature of sequencing data to obtain a target supervised learning model; and obtain a sequencing data contamination identification model based on the target supervised learning model.
[0169] In one possible embodiment, the supervised learning model includes a gradient classifier model and a neural network model; when the training module 34 trains the supervised learning model according to the joint features of the sequencing data to obtain the target supervised learning model, it is specifically used to: train the gradient classifier model according to the joint features of the sequencing data to obtain the area under the first receiver operating characteristic curve; train the neural network model according to the joint features of the sequencing data to obtain the area under the second receiver operating characteristic curve; if the area under the first receiver operating characteristic curve is greater than or equal to the preset area threshold under the receiver operating characteristic curve, the trained gradient classifier model is determined as the target gradient classifier model; if the area under the first receiver operating characteristic curve is less than If the area threshold under the receiver operating characteristic curve is preset, the method returns to the step of training the gradient classifier model according to the joint features of the sequencing data to obtain the area under the first receiver operating characteristic curve; if the area under the second receiver operating characteristic curve is greater than or equal to the preset area threshold under the receiver operating characteristic curve, the trained neural network model is determined as the target neural network model; if the area under the second receiver operating characteristic curve is less than the preset area threshold under the receiver operating characteristic curve, the method returns to the step of training the neural network model according to the joint features of the sequencing data to obtain the area under the second receiver operating characteristic curve; and a target supervised learning model is obtained based on the target gradient classifier model and the target neural network model.
[0170] In one possible embodiment, after obtaining a sequencing data contamination identification model based on a target supervised learning model, the training device 3 for the sequencing data contamination identification model is further used to: merge the sample sequencing data and the target category contaminated sequencing data to obtain second training sequencing data; wherein the ratio of the number of sample sequencing sequences to the number of contamination sequencing sequences in the second training sequencing data is an arbitrary ratio; perform feature extraction on the second training sequencing data to generate a second data structure feature; train an unsupervised learning model based on the second data structure feature to obtain a target unsupervised learning model; and obtain a merged sequencing data contamination identification model based on the target unsupervised learning model and the sequencing data contamination identification model.
[0171] In one possible embodiment, the unsupervised learning model includes an autoencoder and a clustering model; when the training device 3 of the sequencing data contamination identification model trains the unsupervised learning model according to the second data structure feature to obtain the target unsupervised learning model, it is specifically used to: train the autoencoder according to the second data structure feature to determine the reconstruction error threshold; train the clustering model according to the second data structure feature to determine the intra-cluster distance threshold; and obtain the target unsupervised learning model based on the reconstruction error threshold, the intra-cluster distance threshold, the autoencoder and the clustering model.
[0172] In a possible embodiment, when the first processing module 32 determines the target category contaminated sequencing data from multiple categories of preset contaminated sequencing data based on the data contamination characteristics, it is specifically used to: determine the species category characteristics based on the data contamination characteristics; determine the contaminated species based on the species category characteristics; and determine the target category contaminated sequencing data from multiple categories of preset contaminated sequencing data based on the genome sequence of the contaminant species.
[0173] In one possible embodiment, after determining the target category contaminated sequencing data from multiple categories of preset contaminated sequencing data based on the genome sequence of the contaminating species, the first processing module 32 is further used to: determine the GC content deviation from the data contamination characteristics; process the bases of one or more sample sequencing sequences based on the GC content deviation to generate sample contaminated sequencing data; and merge the target category contaminated sequencing data and the sample contaminated sequencing data to obtain updated target category contaminated sequencing data.
[0174] In one possible embodiment, when the first processing module 32 performs quality filtering on the original sequencing data to obtain initial sequencing data, it is specifically used to: determine the Phred quality score corresponding to each original sequencing sequence in the original sequencing data; summarize the original sequencing sequences corresponding to the Phred quality score greater than the Phred quality score threshold to obtain first sequencing data; trim the adapter sequence data of each original sequencing sequence in the first sequencing data to obtain second sequencing data; retain the original sequencing sequences in the second sequencing data that are different from the host sequence data to obtain initial sequencing data.
[0175] The first acquisition module 31, the first processing module 32, the second processing module 33 and the training module 34 are connected in sequence. The training device 3 of the sequencing data contamination identification model provided in this embodiment can be executed as follows: Figure 1 The technical solution of the method embodiment shown has similar implementation principles and technical effects, which will not be repeated here.
[0176] Figure 4 A schematic diagram of a device for identifying sequencing data contamination according to an embodiment of the present application is shown in FIG. Figure 4 As shown, the sequencing data contamination identification device 4 provided in this embodiment includes:
[0177] The second acquisition module 41 is used to acquire target sequencing data; wherein the target sequencing data includes multiple target sequencing sequences;
[0178] The third processing module 42 is used to extract features from the target sequencing data and generate target data structural features; input the target sequencing data into a pre-trained large language model and output target context features; and generate target sequencing data joint features based on the target data structural features and target context features;
[0179] Output module 43 is used to input the target sequencing data joint features and target data structural features into a sequencing data contamination identification model, and output the sequencing data contamination ratio and sequencing data contamination source category; wherein the sequencing data contamination identification model is obtained using a training method such as the first aspect and / or various possible implementation methods of the first aspect.
[0180] In one possible embodiment, when the output module 43 inputs the target sequencing data joint features and the target data structural features into the sequencing data contamination identification model and outputs the sequencing data contamination ratio and the sequencing data contamination source category, it is specifically used to: determine the target coverage from the target data structural features; determine the model parameter threshold of the sequencing data contamination identification model based on the relationship between the target coverage and the coverage threshold; input the target sequencing data joint features, the target data structural features, and the model parameter threshold into the sequencing data contamination identification model, and output the sequencing data contamination ratio and the sequencing data contamination source category.
[0181] The second acquisition module 41, the third processing module 42 and the output module 43 are connected in sequence. Figure 2 The technical solution of the method embodiment shown has similar implementation principles and technical effects, which will not be repeated here.
[0182] Figure 5 This is a schematic diagram of the structure of the electronic device provided in this application. Figure 5 As shown, the electronic device 50 provided in this embodiment includes: at least one processor 501 and a memory 502. Optionally, the device 50 further includes a communication component 503. The processor 501, the memory 502 and the communication component 503 are connected via a bus 504.
[0183] During the specific implementation process, at least one processor 501 executes the computer-executable instructions stored in the memory 502, so that at least one processor 501 executes the above-mentioned training method for the sequencing data contamination identification model or the sequencing data contamination identification method.
[0184] The specific implementation process of the processor 501 can be found in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here in this embodiment.
[0185] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASICs), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the present invention may be directly executed by a hardware processor or by a combination of hardware and software modules within the processor.
[0186] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage.
[0187] A bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be categorized as address buses, data buses, and control buses. For ease of illustration, the buses in the drawings of this application are not limited to just one bus or just one type of bus.
[0188] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the above-mentioned method for training a sequencing data contamination identification model or the method for identifying sequencing data contamination.
[0189] The present application also provides a computer-readable storage medium, which stores computer-executable instructions. When a processor executes the computer-executable instructions, the above-mentioned sequencing data contamination identification model training method or sequencing data contamination identification method is implemented.
[0190] The readable storage medium may be implemented by any type of volatile or non-volatile memory device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0191] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be an integral part of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0192] The division of units is merely a logical functional division; actual implementations may employ alternative divisions, such as combining or integrating multiple units or components into another system, or omitting or disabling certain features. Furthermore, any direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units, either through an interface, electrical, mechanical, or other means.
[0193] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0194] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0195] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the method of the present invention. The aforementioned storage medium includes various media that can store program code, such as USB flash drives, mobile hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.
[0196] Those skilled in the art will appreciate that all or part of the steps in the above-described method embodiments can be implemented using hardware associated with program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0197] Finally, it should be noted that those skilled in the art will readily identify other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art not disclosed herein. The present invention is not limited to the precise structure described above and illustrated in the accompanying drawings, and various modifications and variations may be made without departing from the scope thereof. The scope of the present invention is limited solely by the appended claims.
Claims
1. A method for training a sequencing data contamination identification model, characterized in that: include: Obtaining raw sequencing data, wherein the raw sequencing data includes a plurality of raw sequencing sequences; Performing quality filtering on the raw sequencing data to obtain initial sequencing data, wherein the initial sequencing data includes a plurality of initial sequencing sequences; performing feature extraction on the initial sequencing data to obtain data contamination features; Screening the initial sequencing data according to the data contamination characteristics to obtain sample sequencing data; wherein the sample sequencing data includes multiple sample sequencing sequences; Determining target category contaminated sequencing data from multiple categories of preset contaminated sequencing data according to the data contamination characteristics; the target category contaminated sequencing data includes one or more contaminated sequencing sequences; Merging the sample sequencing data and the target category contamination sequencing data to obtain first training sequencing data; wherein the ratio of the number of sample sequencing sequences to the number of contamination sequencing sequences in the first training sequencing data is a preset contamination ratio; performing feature extraction on the first training sequencing data to generate a first data structure feature; Inputting the first training sequencing data into a pre-trained large language model to output context features; generating a sequencing data joint feature according to the first data structure feature and the context feature; Training the supervised learning model according to the combined features of the sequencing data to obtain a target supervised learning model; Obtaining a sequencing data contamination identification model based on the target supervised learning model; The performing quality filtering on the raw sequencing data to obtain initial sequencing data includes: Determining the Phred quality score corresponding to each original sequencing sequence in the original sequencing data; Summarizing the original sequencing sequences corresponding to the Phred quality scores greater than the Phred quality score threshold to obtain first sequencing data; Trimming the adapter sequence data of each original sequencing sequence in the first sequencing data to obtain second sequencing data; retaining the original sequencing sequence in the second sequencing data that is different from the host sequence data to obtain the initial sequencing data; Determining target category contaminated sequencing data from multiple categories of preset contaminated sequencing data based on the data contamination characteristics includes: Determining species category characteristics based on the data pollution characteristics; Determine the pollutant species based on the characteristics of the species category; Determining target category contaminated sequencing data from multiple categories of preset contaminated sequencing data according to the genome sequence of the contaminating species; After determining the target category contaminated sequencing data from a plurality of categories of preset contaminated sequencing data based on the genome sequence of the contaminating species, the method further includes: determining GC content bias from the data contamination signature; Processing the bases of one or more sample sequencing sequences according to the GC content deviation to generate sample contamination sequencing data; The target category contamination sequencing data and the sample contamination sequencing data are merged to obtain updated target category contamination sequencing data.
2. The method according to claim 1, characterized in that The supervised learning model includes a gradient classifier model and a neural network model; The supervised learning model is trained according to the combined features of the sequencing data to obtain a target supervised learning model, including: Training the gradient classifier model according to the combined features of the sequencing data to obtain an area under a first receiver operating characteristic curve; Training the neural network model according to the combined features of the sequencing data to obtain an area under a second receiver operating characteristic curve; If the area under the first receiver operating characteristic curve is greater than or equal to a preset area under the receiver operating characteristic curve threshold, the trained gradient classifier model is determined as a target gradient classifier model; If the area under the first receiver operating characteristic curve is less than the preset area under the receiver operating characteristic curve threshold, returning to the step of training the gradient classifier model according to the joint features of the sequencing data to obtain the area under the first receiver operating characteristic curve; If the area under the second receiver operating characteristic curve is greater than or equal to the area threshold under the preset receiver operating characteristic curve, the trained neural network model is determined as the target neural network model; If the area under the second receiver operating characteristic curve is less than the preset area under the receiver operating characteristic curve threshold, returning to the step of training the neural network model according to the joint features of the sequencing data to obtain the area under the second receiver operating characteristic curve; The target supervised learning model is obtained according to the target gradient classifier model and the target neural network model.
3. The method according to claim 1, characterized in that After obtaining the sequencing data contamination identification model according to the target supervised learning model, the method further includes: Merging the sample sequencing data and the target category contamination sequencing data to obtain second training sequencing data; wherein the ratio of the number of sample sequencing sequences to the number of contamination sequencing sequences in the second training sequencing data is any ratio; performing feature extraction on the second training sequencing data to generate a second data structure feature; Training an unsupervised learning model according to the second data structure feature to obtain a target unsupervised learning model; A merged sequencing data contamination identification model is obtained based on the target unsupervised learning model and the sequencing data contamination identification model.
4. The method according to claim 3, characterized in that The unsupervised learning model includes an autoencoder and a clustering model; The step of training the unsupervised learning model according to the second data structure feature to obtain a target unsupervised learning model includes: Training the autoencoder according to the second data structure feature to determine a reconstruction error threshold; Training the clustering model according to the second data structure feature to determine an intra-cluster distance threshold; A target unsupervised learning model is obtained according to the reconstruction error threshold, the intra-cluster distance threshold, the autoencoder and the clustering model.
5. A method for identifying sequencing data contamination, characterized in that: include: Obtain target sequencing data; Wherein the target sequencing data includes multiple target sequencing sequences; Performing feature extraction on the target sequencing data to generate target data structure features; Inputting the target sequencing data into a pre-trained large language model to output target context features; generating a target sequencing data joint feature according to the target data structure feature and the target context feature; The target sequencing data joint features and the target data structural features are input into a sequencing data contamination identification model, and the sequencing data contamination ratio and sequencing data contamination source category are output; wherein the sequencing data contamination identification model is obtained using the training method according to any one of claims 1 to 4.
6. The method according to claim 5, characterized in that The step of inputting the target sequencing data joint feature and the target data structural feature into a sequencing data contamination identification model and outputting a sequencing data contamination ratio and a sequencing data contamination source category includes: determining target coverage from the target data structure features; Determining a model parameter threshold of the sequencing data contamination identification model according to a relationship between the target coverage and the coverage threshold; The target sequencing data joint features, the target data structural features, and the model parameter threshold are input into a sequencing data contamination identification model, and the sequencing data contamination ratio and sequencing data contamination source category are output.
7. An electronic device, characterized in that: include: a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the training method of the sequencing data contamination identification model according to any one of claims 1 to 4 or the method for identifying sequencing data contamination according to any one of claims 5 to 6.
Citation Information
Patent Citations
Genome protozoa pollutant detection method based on DNA bar code technology
CN117059170A
Evaluation method for identifying sequencing data pollution
CN118675617A